Let's say I have following spring.xml (SomeBean is managed by spring)
<bean id="some_bean" class="SomeBean" />
and class (this one is not managed)
public class MyClass {
@<some magic or something else?>
private SomeBean sb;
}
and my main
public class Main {
public static void main(String[] args) {
new MyClass().getSB();
}
}
How to make that by creation of new class (using new keyword) MyClass instance have access to bean with id="some_bean"?