public class SessionComponent extends ProviderCollection { public SessionComponent(final Container container) { super(container, Singleton.instance); } public void createAll() { for (final Provider<?> p : getProviders()) { p.get(); } } }This class is a replacement of GroupedSingleton: it's not limited to singletons and behave correctly when providers are removed from the container.
|
|
|
|