org.activemq.transport
Class NetworkConnector

java.lang.Object
  extended by org.activemq.transport.NetworkConnector
All Implemented Interfaces:
Service
Direct Known Subclasses:
DiscoveryNetworkConnector, RemoteNetworkConnector

public class NetworkConnector
extends Object
implements Service

Represents a connector to one or more remote brokers. This class manages a number of NetworkChannel instances which may or may not be connected to a remote broker at any point in time.

The implementation of this class could use a fixed number of configured NetworkChannel instances or could use discovery to find them.

Version:
$Revision: 1.1.1.1 $

Field Summary
protected  PooledExecutor threadPool
           
 
Constructor Summary
NetworkConnector(BrokerContainer brokerContainer)
           
 
Method Summary
 void addNetworkChannel(NetworkChannel networkChannel)
          Adds a new network channel
 NetworkChannel addNetworkChannel(String uri)
          Adds a new network channel for the given URI
protected  void configure(NetworkChannel networkChannel)
          Performs any network connector based configuration; such as setting the dispatch policies
protected  NetworkChannel createNetworkChannel(String url)
          Create a channel from the url
 BrokerContainer getBrokerContainer()
           
 Map getLocalDetails()
           
 int getLocalDurableTopicPrefetch()
           
 ActiveMQPrefetchPolicy getLocalPrefetchPolicy()
           
 int getLocalQueueBrowserPrefetch()
           
 int getLocalQueuePrefetch()
           
 int getLocalTopicPrefetch()
           
 List getNetworkChannels()
           
 int getRemoteDurableTopicPrefetch()
           
 String getRemotePassword()
           
 ActiveMQPrefetchPolicy getRemotePrefetchPolicy()
           
 int getRemoteQueueBrowserPrefetch()
           
 int getRemoteQueuePrefetch()
           
 int getRemoteTopicPrefetch()
           
 String getRemoteUserName()
           
 PooledExecutor getThreadPool()
           
 void removeNetworkChannel(NetworkChannel networkChannel)
          Removes a network channel
 void setLocalDetails(Map localDetails)
           
 void setLocalDurableTopicPrefetch(int durableTopicPrefetch)
           
 void setLocalPrefetchPolicy(ActiveMQPrefetchPolicy localPrefetchPolicy)
           
 void setLocalQueueBrowserPrefetch(int queueBrowserPrefetch)
           
 void setLocalQueuePrefetch(int queuePrefetch)
           
 void setLocalTopicPrefetch(int topicPrefetch)
           
 void setNetworkChannels(List networkChannels)
          Sets a list of NetworkChannel instances
 void setRemoteDurableTopicPrefetch(int durableTopicPrefetch)
           
 void setRemotePassword(String remotePassword)
           
 void setRemotePrefetchPolicy(ActiveMQPrefetchPolicy remotePrefetchPolicy)
           
 void setRemoteQueueBrowserPrefetch(int queueBrowserPrefetch)
           
 void setRemoteQueuePrefetch(int queuePrefetch)
           
 void setRemoteTopicPrefetch(int topicPrefetch)
           
 void setRemoteUserName(String remoteUserName)
           
 void setTransportChannelListener(TransportChannelListener listener)
           
 void start()
          Called to start the service
 void stop()
          Called to shutdown the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadPool

protected PooledExecutor threadPool
Constructor Detail

NetworkConnector

public NetworkConnector(BrokerContainer brokerContainer)
Method Detail

start

public void start()
           throws JMSException
Description copied from interface: Service
Called to start the service

Specified by:
start in interface Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
Description copied from interface: Service
Called to shutdown the service

Specified by:
stop in interface Service
Throws:
JMSException

setTransportChannelListener

public void setTransportChannelListener(TransportChannelListener listener)

getBrokerContainer

public BrokerContainer getBrokerContainer()

getThreadPool

public PooledExecutor getThreadPool()
Returns:
Returns the threadPool.

getNetworkChannels

public List getNetworkChannels()

getLocalDetails

public Map getLocalDetails()

setLocalDetails

public void setLocalDetails(Map localDetails)

getRemotePassword

public String getRemotePassword()

setRemotePassword

public void setRemotePassword(String remotePassword)

getRemoteUserName

public String getRemoteUserName()

setRemoteUserName

public void setRemoteUserName(String remoteUserName)

setNetworkChannels

public void setNetworkChannels(List networkChannels)
Sets a list of NetworkChannel instances

Parameters:
networkChannels -

addNetworkChannel

public NetworkChannel addNetworkChannel(String uri)
                                 throws JMSException
Adds a new network channel for the given URI

Parameters:
uri -
Returns:
Throws:
JMSException

addNetworkChannel

public void addNetworkChannel(NetworkChannel networkChannel)
                       throws JMSException
Adds a new network channel

Throws:
JMSException

removeNetworkChannel

public void removeNetworkChannel(NetworkChannel networkChannel)
Removes a network channel


getLocalPrefetchPolicy

public ActiveMQPrefetchPolicy getLocalPrefetchPolicy()

setLocalPrefetchPolicy

public void setLocalPrefetchPolicy(ActiveMQPrefetchPolicy localPrefetchPolicy)

getRemotePrefetchPolicy

public ActiveMQPrefetchPolicy getRemotePrefetchPolicy()

setRemotePrefetchPolicy

public void setRemotePrefetchPolicy(ActiveMQPrefetchPolicy remotePrefetchPolicy)

getLocalDurableTopicPrefetch

public int getLocalDurableTopicPrefetch()

setLocalDurableTopicPrefetch

public void setLocalDurableTopicPrefetch(int durableTopicPrefetch)

getLocalQueuePrefetch

public int getLocalQueuePrefetch()

setLocalQueuePrefetch

public void setLocalQueuePrefetch(int queuePrefetch)

getLocalQueueBrowserPrefetch

public int getLocalQueueBrowserPrefetch()

setLocalQueueBrowserPrefetch

public void setLocalQueueBrowserPrefetch(int queueBrowserPrefetch)

getLocalTopicPrefetch

public int getLocalTopicPrefetch()

setLocalTopicPrefetch

public void setLocalTopicPrefetch(int topicPrefetch)

getRemoteDurableTopicPrefetch

public int getRemoteDurableTopicPrefetch()

setRemoteDurableTopicPrefetch

public void setRemoteDurableTopicPrefetch(int durableTopicPrefetch)

getRemoteQueuePrefetch

public int getRemoteQueuePrefetch()

setRemoteQueuePrefetch

public void setRemoteQueuePrefetch(int queuePrefetch)

getRemoteQueueBrowserPrefetch

public int getRemoteQueueBrowserPrefetch()

setRemoteQueueBrowserPrefetch

public void setRemoteQueueBrowserPrefetch(int queueBrowserPrefetch)

getRemoteTopicPrefetch

public int getRemoteTopicPrefetch()

setRemoteTopicPrefetch

public void setRemoteTopicPrefetch(int topicPrefetch)

createNetworkChannel

protected NetworkChannel createNetworkChannel(String url)
Create a channel from the url

Parameters:
url -
Returns:

configure

protected void configure(NetworkChannel networkChannel)
                  throws JMSException
Performs any network connector based configuration; such as setting the dispatch policies

Parameters:
networkChannel -
Throws:
JMSException


Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.