001 /** 002 * 003 * Copyright 2004 Protique Ltd 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 * 017 **/ 018 019 package org.activemq.transport.remote; 020 import javax.jms.JMSException; 021 022 import org.activemq.broker.BrokerContainer; 023 import org.activemq.io.WireFormat; 024 import org.activemq.transport.NetworkConnector; 025 import org.activemq.transport.RemoteNetworkConnector; 026 import org.activemq.transport.peer.PeerTransportChannel; 027 import org.activemq.util.IdGenerator; 028 029 /** 030 * A <CODE>RemoteTransportChannel</CODE> creates an embedded broker that creates a remote connection to 031 * another broker. This connection type is designed for reliable connections, that can use the storage 032 * mechansims of an embedded broker to be decoupled from the remote broker - i.e. for connections that 033 * need to be reliable, don't block but maybe using a transport across an unreliable network connection 034 * <P> 035 036 * <P> 037 * An example of the expected format is: <CODE>remote://tcp://remotebroker:5060</CODE> 038 * <P> 039 * 040 * @version $Revision: 1.1.1.1 $ 041 */ 042 public class RemoteTransportChannel extends PeerTransportChannel { 043 044 /** 045 * Construct a RemoteTransportChannel 046 * 047 * @param wireFormat 048 * @param peerURIs 049 * @throws JMSException 050 */ 051 protected RemoteTransportChannel(WireFormat wireFormat, String peerURIs) throws JMSException{ 052 super(wireFormat,new IdGenerator().generateId()); 053 setPeerURIs(peerURIs); 054 setDoDiscovery(false); 055 setRemote(true); 056 } 057 058 /** 059 * Create a NetworkConnector 060 * @param container 061 * @return the NetworkConnector 062 */ 063 protected NetworkConnector createNetworkConnector(BrokerContainer container){ 064 return new RemoteNetworkConnector(container); 065 } 066 067 }