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 java.lang.Object
implements Connector, BrokerServiceAware


Field Summary
protected  java.util.concurrent.CopyOnWriteArrayList<TransportConnection> connections
           
protected  TransportStatusDetector statusDector
           
 
Constructor Summary
TransportConnector()
           
TransportConnector(TransportServer server)
           
 
Method Summary
 ManagedTransportConnector asManagedConnector(ManagementContext context, javax.management.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()
           
protected  ConnectionControl getConnectionControl()
           
 java.util.concurrent.CopyOnWriteArrayList<TransportConnection> getConnections()
           
 java.net.URI getConnectUri()
           
 DiscoveryAgent getDiscoveryAgent()
           
 java.net.URI getDiscoveryUri()
           
 MessageAuthorizationPolicy getMessageAuthorizationPolicy()
           
 java.lang.String getName()
           
 java.lang.String getPublishableConnectString()
           
 TransportServer getServer()
           
 ConnectorStatistics getStatistics()
           
 TaskRunnerFactory getTaskRunnerFactory()
           
 java.lang.String getUpdateClusterFilter()
           
 java.net.URI getUri()
           
 boolean isDisableAsyncDispatch()
           
 boolean isEnableStatusMonitor()
           
 boolean isRebalanceClusterClients()
           
 boolean isUpdateClusterClients()
           
 boolean isUpdateClusterClientsOnRemove()
           
 void onStarted(TransportConnection connection)
           
 void onStopped(TransportConnection connection)
           
 void setBrokerInfo(BrokerInfo brokerInfo)
           
 void setBrokerName(java.lang.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(java.net.URI transportUri)
           
 void setDisableAsyncDispatch(boolean disableAsyncDispatch)
           
 void setDiscoveryAgent(DiscoveryAgent discoveryAgent)
           
 void setDiscoveryUri(java.net.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(java.lang.String name)
           
 void setRebalanceClusterClients(boolean rebalanceClusterClients)
           
 void setServer(TransportServer server)
           
 void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
           
 void setUpdateClusterClients(boolean updateClusterClients)
           
 void setUpdateClusterClientsOnRemove(boolean updateClusterClientsOnRemove)
           
 void setUpdateClusterFilter(java.lang.String updateClusterFilter)
           
 void setUri(java.net.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()
           
 java.lang.String toString()
           
 void updateClientClusterInfo()
          Update all the connections with information about the connected brokers in the cluster
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connections

protected java.util.concurrent.CopyOnWriteArrayList<TransportConnection> connections

statusDector

protected TransportStatusDetector statusDector
Constructor Detail

TransportConnector

public TransportConnector()

TransportConnector

public TransportConnector(TransportServer server)
Method Detail

getConnections

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

asManagedConnector

public ManagedTransportConnector asManagedConnector(ManagementContext context,
                                                    javax.management.ObjectName connectorName)
                                             throws java.io.IOException,
                                                    java.net.URISyntaxException
Factory method to create a JMX managed version of this transport connector

Throws:
java.io.IOException
java.net.URISyntaxException

getBrokerInfo

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

setBrokerInfo

public void setBrokerInfo(BrokerInfo brokerInfo)

setBrokerName

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


getServer

public TransportServer getServer()
                          throws java.io.IOException,
                                 java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

setServer

public void setServer(TransportServer server)

getUri

public java.net.URI getUri()

setUri

public void setUri(java.net.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 java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

getPublishableConnectString

public java.lang.String getPublishableConnectString()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

stop

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

createConnection

protected Connection createConnection(Transport transport)
                               throws java.io.IOException
Throws:
java.io.IOException

createTransportServer

protected TransportServer createTransportServer()
                                         throws java.io.IOException,
                                                java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

getDiscoveryAgent

public DiscoveryAgent getDiscoveryAgent()
                                 throws java.io.IOException
Throws:
java.io.IOException

createDiscoveryAgent

protected DiscoveryAgent createDiscoveryAgent()
                                       throws java.io.IOException
Throws:
java.io.IOException

setDiscoveryAgent

public void setDiscoveryAgent(DiscoveryAgent discoveryAgent)

getDiscoveryUri

public java.net.URI getDiscoveryUri()

setDiscoveryUri

public void setDiscoveryUri(java.net.URI discoveryUri)

getConnectUri

public java.net.URI getConnectUri()
                           throws java.io.IOException,
                                  java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

setConnectUri

public void setConnectUri(java.net.URI transportUri)

onStarted

public void onStarted(TransportConnection connection)

onStopped

public void onStopped(TransportConnection connection)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getConnectionControl

protected ConnectionControl getConnectionControl()

updateClientClusterInfo

public void updateClientClusterInfo()
Description copied from interface: Connector
Update all the connections with information about the connected brokers in the cluster

Specified by:
updateClientClusterInfo in interface Connector

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()

isUpdateClusterClients

public boolean isUpdateClusterClients()
Specified by:
isUpdateClusterClients in interface Connector
Returns:
the updateClusterClients

setUpdateClusterClients

public void setUpdateClusterClients(boolean updateClusterClients)
Parameters:
updateClusterClients - the updateClusterClients to set

isRebalanceClusterClients

public boolean isRebalanceClusterClients()
Specified by:
isRebalanceClusterClients in interface Connector
Returns:
the rebalanceClusterClients

setRebalanceClusterClients

public void setRebalanceClusterClients(boolean rebalanceClusterClients)
Parameters:
rebalanceClusterClients - the rebalanceClusterClients to set

isUpdateClusterClientsOnRemove

public boolean isUpdateClusterClientsOnRemove()
Specified by:
isUpdateClusterClientsOnRemove in interface Connector
Returns:
the updateClusterClientsOnRemove

setUpdateClusterClientsOnRemove

public void setUpdateClusterClientsOnRemove(boolean updateClusterClientsOnRemove)
Parameters:
updateClusterClientsOnRemove - the updateClusterClientsOnRemove to set

getUpdateClusterFilter

public java.lang.String getUpdateClusterFilter()
Returns:
the updateClusterFilter

setUpdateClusterFilter

public void setUpdateClusterFilter(java.lang.String updateClusterFilter)
Parameters:
updateClusterFilter - the updateClusterFilter to set


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.