private void unregister( final Collection<SessionFactory> sessionFactories, final Collection<CommandWrapper> wrappers) { for (final SessionFactory sessionFactory : sessionFactories) { unregister(sessionFactory.getRegistry(), wrappers); } }
public HelpCommand(SessionFactory factory) { Registry registry = factory.getRegistry(); registry.register(this); registry.register(new SimpleHelpProvider()); registry.register(new CommandListHelpProvider()); registry.register(new SingleCommandHelpProvider()); }
@Reference( cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeSessionFactory") protected void addSessionFactory(final SessionFactory sessionFactory) { sessionFactories.add(sessionFactory); register(sessionFactory.getRegistry()); }
protected void removeSessionFactory(final SessionFactory sessionFactory) { if (sessionFactories.remove(sessionFactory)) { unregister(sessionFactory.getRegistry()); } }