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