A method to register an instance of a bean for a particular scope would be very useful. For example:
String scope = "foo";
ScopeContext<String> context = (ScopeContext<String>) beanManager.getContext(MyScope.class);
context.enter(scope);
context.register(scope, MyBean.class, new MyBeanImpl(scope));
// or
context.getScope(scope).register(MyBean.class, new MyBeanImpl(scope));
This way when entering a certain scope one can register instances of particular beans, e.g. when the bean implementation requires arguments.
A method to register an instance of a bean for a particular scope would be very useful. For example:
This way when entering a certain scope one can register instances of particular beans, e.g. when the bean implementation requires arguments.