Ejemplo n.º 1
0
 @Override
 public void stop() {
   try {
     messageConsumer.close();
   } catch (final JMSException ignored) {
   }
   jmsManager.release();
 }
Ejemplo n.º 2
0
 @Override
 public void start() {
   if (state.compareAndSet(State.INITIALIZED, State.STARTING)) {
     try {
       messageConsumer = jmsManager.createMessageConsumer();
       messageConsumer.setMessageListener(this);
     } catch (final JMSException e) {
       throw new LoggingException(e);
     }
   }
 }
Ejemplo n.º 3
0
 public JmsServer(
     final String connectionFactoryBindingName,
     final String destinationBindingName,
     final String username,
     final String password) {
   final String managerName = JmsServer.class.getName() + '@' + JmsServer.class.hashCode();
   final JndiManager jndiManager = JndiManager.getDefaultManager(managerName);
   jmsManager =
       JmsManager.getJmsManager(
           managerName,
           jndiManager,
           connectionFactoryBindingName,
           destinationBindingName,
           username,
           password);
 }