protected Destination processReplyToDestination(Destination destination) { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); }
@Override protected Connection getConnectionForProducer() { return getProducerConnection(); } }
public String getName() { if (name == null) { name = "Connector:" + getNextId(); } return name; }
protected void initializeInboundDestinationBridgesOutboundSide(TopicConnection connection) throws JMSException { if (inboundTopicBridges != null) { TopicSession outboundSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); for (InboundTopicBridge bridge : inboundTopicBridges) { String TopicName = bridge.getInboundTopicName(); Topic foreignTopic = createForeignTopic(outboundSession, TopicName); bridge.setConsumer(null); bridge.setConsumerTopic(foreignTopic); bridge.setConsumerConnection(connection); bridge.setJmsConnector(this); addInboundBridge(bridge); } outboundSession.close(); } }
protected void initializeInboundDestinationBridgesOutboundSide(QueueConnection connection) throws JMSException { if (inboundQueueBridges != null) { QueueSession outboundSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); for (InboundQueueBridge bridge : inboundQueueBridges) { String queueName = bridge.getInboundQueueName(); Queue foreignQueue = createForeignQueue(outboundSession, queueName); bridge.setConsumer(null); bridge.setConsumerQueue(foreignQueue); bridge.setConsumerConnection(connection); bridge.setJmsConnector(this); addInboundBridge(bridge); } outboundSession.close(); } }
/** * @param consumerConnection The consumerConnection to set. */ public void setConsumerConnection(QueueConnection consumerConnection) { this.consumerConnection = consumerConnection; if (started.get()) { try { createConsumer(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); } } }
/** * @param consumerConnection The consumerConnection to set. */ public void setConsumerConnection(TopicConnection consumerConnection) { this.consumerConnection = consumerConnection; if (started.get()) { try { createConsumer(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); } } }
@Override public void start() throws Exception { if (started.compareAndSet(false, true)) { createConsumer(); createProducer(); } }
public void stop() throws Exception { super.stop(); if (consumerSession != null) { consumerSession.close(); } if (producerSession != null) { producerSession.close(); } }
protected Connection getConnnectionForConsumer() { return getConsumerConnection(); }
public void start() throws Exception { connector.start(); }
public void stop() throws Exception { connector.stop(); } }
protected Connection getConnectionForProducer() { return getProducerConnection(); } }
@Override protected Connection getConnnectionForConsumer() { return getConsumerConnection(); }
@Override public void onException(JMSException exception) { handleConnectionFailure(localConnection.get()); } });
@Override public void onException(JMSException exception) { handleConnectionFailure(foreignConnection.get()); } });
@Override public void stop() throws Exception { super.stop(); if (consumerSession != null) { consumerSession.close(); } if (producerSession != null) { producerSession.close(); } }
@Override public void onException(JMSException exception) { handleConnectionFailure(foreignConnection.get()); } });
@Override public void onException(JMSException exception) { handleConnectionFailure(localConnection.get()); } });