private synchronized void initializeRemote() throws JMSException {
if (remoteConnection == null) {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(remoteUserName, remotePassword, uri);
factory.setUseAsyncSend(true);
remoteConnection = (ActiveMQConnection) factory.createConnection();
remoteConnection.setJ2EEcompliant(false);
remoteConnection.setClientID(brokerContainer.getBroker().getBrokerName() + "_NetworkChannel");
TransportChannel transportChannel = remoteConnection.getTransportChannel();
if (transportChannel instanceof CompositeTransportChannel) {
CompositeTransportChannel composite = (CompositeTransportChannel) transportChannel;