org.apache.activemq.broker
Class TransportConnector

java.lang.Object
  extended by org.apache.activemq.broker.TransportConnector
All Implemented Interfaces:
BrokerServiceAware, Connector, Service
Direct Known Subclasses:
ManagedTransportConnector

public class TransportConnector
extends Object
implements Connector, BrokerServiceAware

Version:
$Revision: 1.6 $

Field Summary
protected  CopyOnWriteArrayList<TransportConnection> connections
           
protected  TransportStatusDetector statusDector
           
 
Constructor Summary
TransportConnector()
           
TransportConnector(TransportServer server)
           
 
Method Summary
 ManagedTransportConnector asManagedConnector(MBeanServer mbeanServer, ObjectName connectorName)
          Factory method to create a JMX managed version of this transport connector
protected  Connection createConnection(Transport transport)
           
protected  DiscoveryAgent createDiscoveryAgent()
           
protected  TransportServer createTransportServer()
           
 Broker getBroker()
           
 BrokerInfo getBrokerInfo()
           
 BrokerService getBrokerService()
           
 CopyOnWriteArrayList<TransportConnection> getConnections()
           
 URI getConnectUri()
           
 DiscoveryAgent getDiscoveryAgent()
           
 URI getDiscoveryUri()
           
 MessageAuthorizationPolicy getMessageAuthorizationPolicy()
           
 String getName()
           
 TransportServer getServer()
           
 ConnectorStatistics getStatistics()
           
 TaskRunnerFactory getTaskRunnerFactory()
           
 URI getUri()
           
 boolean isDisableAsyncDispatch()
           
 boolean isEnableStatusMonitor()
           
 void onStarted(TransportConnection connection)
           
 void onStopped(TransportConnection connection)
           
 void setBrokerInfo(BrokerInfo brokerInfo)
           
 void setBrokerName(String name)
          Deprecated. use the setBrokerService(BrokerService) method instead.
 void setBrokerService(BrokerService brokerService)
          This is called by the BrokerService right before it starts the transport.
 void setConnectUri(URI transportUri)
           
 void setDisableAsyncDispatch(boolean disableAsyncDispatch)
           
 void setDiscoveryAgent(DiscoveryAgent discoveryAgent)
           
 void setDiscoveryUri(URI discoveryUri)
           
 void setEnableStatusMonitor(boolean enableStatusMonitor)
           
 void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
          Sets the policy used to decide if the current connection is authorized to consume a given message
 void setName(String name)
           
 void setServer(TransportServer server)
           
 void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
           
 void setUri(URI uri)
          Sets the server transport URI to use if there is not a TransportServer configured via the setServer(TransportServer) method.
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connections

protected CopyOnWriteArrayList<TransportConnection> connections

statusDector

protected TransportStatusDetector statusDector
Constructor Detail

TransportConnector

public TransportConnector()

TransportConnector

public TransportConnector(TransportServer server)
Method Detail

getConnections

public CopyOnWriteArrayList<TransportConnection> getConnections()
Returns:
Returns the connections.

asManagedConnector

public ManagedTransportConnector asManagedConnector(MBeanServer mbeanServer,
                                                    ObjectName connectorName)
                                             throws IOException,
                                                    URISyntaxException
Factory method to create a JMX managed version of this transport connector

Throws:
IOException
URISyntaxException

getBrokerInfo

public BrokerInfo getBrokerInfo()
Specified by:
getBrokerInfo in interface Connector
Returns:

setBrokerInfo

public void setBrokerInfo(BrokerInfo brokerInfo)

setBrokerName

@Deprecated
public void setBrokerName(String name)
Deprecated. use the setBrokerService(BrokerService) method instead.


getServer

public TransportServer getServer()
                          throws IOException,
                                 URISyntaxException
Throws:
IOException
URISyntaxException

setServer

public void setServer(TransportServer server)

getUri

public URI getUri()

setUri

public void setUri(URI uri)
Sets the server transport URI to use if there is not a TransportServer configured via the setServer(TransportServer) method. This value is used to lazy create a TransportServer instance

Parameters:
uri -

getTaskRunnerFactory

public TaskRunnerFactory getTaskRunnerFactory()

setTaskRunnerFactory

public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)

getStatistics

public ConnectorStatistics getStatistics()
Specified by:
getStatistics in interface Connector
Returns:
the statistics for this connector

getMessageAuthorizationPolicy

public MessageAuthorizationPolicy getMessageAuthorizationPolicy()

setMessageAuthorizationPolicy

public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy)
Sets the policy used to decide if the current connection is authorized to consume a given message


start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

createConnection

protected Connection createConnection(Transport transport)
                               throws IOException
Throws:
IOException

createTransportServer

protected TransportServer createTransportServer()
                                         throws IOException,
                                                URISyntaxException
Throws:
IOException
URISyntaxException

getDiscoveryAgent

public DiscoveryAgent getDiscoveryAgent()
                                 throws IOException
Throws:
IOException

createDiscoveryAgent

protected DiscoveryAgent createDiscoveryAgent()
                                       throws IOException
Throws:
IOException

setDiscoveryAgent

public void setDiscoveryAgent(DiscoveryAgent discoveryAgent)

getDiscoveryUri

public URI getDiscoveryUri()

setDiscoveryUri

public void setDiscoveryUri(URI discoveryUri)

getConnectUri

public URI getConnectUri()
                  throws IOException,
                         URISyntaxException
Throws:
IOException
URISyntaxException

setConnectUri

public void setConnectUri(URI transportUri)

onStarted

public void onStarted(TransportConnection connection)

onStopped

public void onStopped(TransportConnection connection)

getName

public String getName()

setName

public void setName(String name)

toString

public String toString()
Overrides:
toString in class Object

isDisableAsyncDispatch

public boolean isDisableAsyncDispatch()

setDisableAsyncDispatch

public void setDisableAsyncDispatch(boolean disableAsyncDispatch)

isEnableStatusMonitor

public boolean isEnableStatusMonitor()
Returns:
the enableStatusMonitor

setEnableStatusMonitor

public void setEnableStatusMonitor(boolean enableStatusMonitor)
Parameters:
enableStatusMonitor - the enableStatusMonitor to set

setBrokerService

public void setBrokerService(BrokerService brokerService)
This is called by the BrokerService right before it starts the transport.

Specified by:
setBrokerService in interface BrokerServiceAware

getBroker

public Broker getBroker()

getBrokerService

public BrokerService getBrokerService()


Copyright © 2009. All Rights Reserved.