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 package org.activemq.transport.jrms; 019 020 import org.activemq.io.WireFormat; 021 import org.activemq.transport.TransportChannel; 022 import org.activemq.transport.TransportChannelFactorySupport; 023 024 import javax.jms.JMSException; 025 import java.net.URI; 026 027 /** 028 * A JRMS implementation of a TransportChannelFactory 029 * 030 * @version $Revision$ 031 */ 032 public class JRMSTransportChannelFactory extends TransportChannelFactorySupport { 033 034 /** 035 * Create a Channel to a remote Node - e.g. a Broker 036 * 037 * @param wireFormat 038 * @param remoteLocation 039 * @return the TransportChannel bound to the remote node 040 * @throws JMSException 041 */ 042 public TransportChannel create(WireFormat wireFormat, URI remoteLocation) throws JMSException { 043 return populateProperties(new JRMSTransportChannel(wireFormat, remoteLocation), remoteLocation); 044 } 045 046 /** 047 * Create a Channel to a remote Node - e.g. a Broker 048 * 049 * @param wireFormat 050 * @param remoteLocation 051 * @param localLocation - 052 * e.g. local InetAddress and local port 053 * @return the TransportChannel bound to the remote node 054 * @throws JMSException 055 */ 056 public TransportChannel create(WireFormat wireFormat, URI remoteLocation, URI localLocation) throws JMSException { 057 return create(wireFormat, remoteLocation); 058 } 059 060 public boolean requiresEmbeddedBroker() { 061 return true; 062 } 063 064 }