Suppose I have annotated a class X
with @Component
and somewhere else in my application I initiate this class explicitly by new X()
.
Will this class still be managed by Spring?
And if not, is there a way to autowire another class Y
inside this X
class (that is not managed)?