public Destination getCommandDestination() { if (commandDestination == null) { commandDestination = createCommandDestination(); } return commandDestination; }
public void onException(JMSException exception) { try { stop(); } catch (Exception e) { } } }
/** * * @throws Exception * @org.apache.xbean.InitMethod */ @PostConstruct public void start() throws Exception { session = getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE); listener = new CommandMessageListener(session); Destination destination = getCommandDestination(); if (LOG.isDebugEnabled()) { LOG.debug("Agent subscribing to control destination: " + destination); } consumer = session.createConsumer(destination); consumer.setMessageListener(listener); }
protected Connection createConnection() throws JMSException { return getConnectionFactory().createConnection(username, password); }
public Connection getConnection() throws JMSException { if (connection == null) { connection = createConnection(); connection.setExceptionListener(this); connection.start(); } return connection; }