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