Package org.apache.activemq.broker
Class TransportConnector
java.lang.Object
org.apache.activemq.broker.TransportConnector
- All Implemented Interfaces:
BrokerServiceAware,Connector,org.apache.activemq.Service
- Direct Known Subclasses:
ManagedTransportConnector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CopyOnWriteArrayList<TransportConnection>protected TransportStatusDetector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeerBroker(org.apache.activemq.command.BrokerInfo info) asManagedConnector(ManagementContext context, ObjectName connectorName) Factory method to create a JMX managed version of this transport connectorintprotected ConnectioncreateConnection(org.apache.activemq.transport.Transport transport) protected org.apache.activemq.transport.discovery.DiscoveryAgentprotected org.apache.activemq.transport.TransportServerorg.apache.activemq.command.BrokerInfoprotected org.apache.activemq.command.ConnectionControlorg.apache.activemq.transport.discovery.DiscoveryAgentlongintintgetName()Gets the currently configured policy for creating the published connection address of this TransportConnector.static ThrowablegetRootCause(Throwable throwable) org.apache.activemq.transport.TransportServerorg.apache.activemq.thread.TaskRunnerFactorygetUri()booleanIf enabled, older connections with the same clientID are stoppedbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidonStarted(TransportConnection connection) voidonStopped(TransportConnection connection) voidremovePeerBroker(org.apache.activemq.command.BrokerInfo info) voidReset the statistics for this connectorvoidsetAllowLinkStealing(boolean allowLinkStealing) voidsetAuditNetworkProducers(boolean auditNetworkProducers) Enable a producer audit on network connections, Traps the case of a missing send reply and resend.voidsetAutoStart(boolean autoStart) voidsetBrokerInfo(org.apache.activemq.command.BrokerInfo brokerInfo) voidsetBrokerService(BrokerService brokerService) This is called by the BrokerService right before it starts the transport.voidsetDisableAsyncDispatch(boolean disableAsyncDispatch) voidsetDiscoveryAgent(org.apache.activemq.transport.discovery.DiscoveryAgent discoveryAgent) voidsetDiscoveryUri(URI discoveryUri) voidsetDisplayStackTrace(boolean displayStackTrace) voidsetEnableStatusMonitor(boolean enableStatusMonitor) voidsetMaximumConsumersAllowedPerConnection(int maximumConsumersAllowedPerConnection) voidsetMaximumProducersAllowedPerConnection(int maximumProducersAllowedPerConnection) voidsetMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) Sets the policy used to decide if the current connection is authorized to consume a given messagevoidvoidsetPublishedAddressPolicy(PublishedAddressPolicy publishedAddressPolicy) Sets the configured policy for creating the published connection address of this TransportConnector.voidsetRebalanceClusterClients(boolean rebalanceClusterClients) voidsetServer(org.apache.activemq.transport.TransportServer server) voidsetTaskRunnerFactory(org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory) voidsetUpdateClusterClients(boolean updateClusterClients) voidsetUpdateClusterClientsOnRemove(boolean updateClusterClientsOnRemove) voidsetUpdateClusterFilter(String updateClusterFilter) voidSets the server transport URI to use if there is not aTransportServerconfigured via thesetServer(TransportServer)method.voidsetWarnOnRemoteClose(boolean warnOnRemoteClose) voidstart()voidstop()toString()voidUpdate all the connections with information about the connected brokers in the cluster
-
Field Details
-
connections
-
statusDector
-
-
Constructor Details
-
TransportConnector
public TransportConnector() -
TransportConnector
public TransportConnector(org.apache.activemq.transport.TransportServer server)
-
-
Method Details
-
getConnections
- Returns:
- Returns the connections.
-
asManagedConnector
public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName connectorName) throws IOException, URISyntaxException Factory method to create a JMX managed version of this transport connector- Throws:
IOExceptionURISyntaxException
-
getBrokerInfo
public org.apache.activemq.command.BrokerInfo getBrokerInfo()- Specified by:
getBrokerInfoin interfaceConnector- Returns:
- brokerInfo
-
setBrokerInfo
public void setBrokerInfo(org.apache.activemq.command.BrokerInfo brokerInfo) -
getServer
public org.apache.activemq.transport.TransportServer getServer() throws IOException, URISyntaxException- Throws:
IOExceptionURISyntaxException
-
setServer
public void setServer(org.apache.activemq.transport.TransportServer server) -
getUri
-
setUri
Sets the server transport URI to use if there is not aTransportServerconfigured via thesetServer(TransportServer)method. This value is used to lazy create aTransportServerinstance- Parameters:
uri-
-
getTaskRunnerFactory
public org.apache.activemq.thread.TaskRunnerFactory getTaskRunnerFactory() -
setTaskRunnerFactory
public void setTaskRunnerFactory(org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory) -
getStatistics
- Specified by:
getStatisticsin interfaceConnector- Returns:
- the statistics for this connector
-
resetStatistics
public void resetStatistics()Reset the statistics for this connector- Specified by:
resetStatisticsin interfaceConnector
-
getMessageAuthorizationPolicy
-
setMessageAuthorizationPolicy
Sets the policy used to decide if the current connection is authorized to consume a given message -
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
getRootCause
-
getPublishableConnectString
- Throws:
Exception
-
getPublishableConnectURI
- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
createConnection
protected Connection createConnection(org.apache.activemq.transport.Transport transport) throws IOException - Throws:
IOException
-
createTransportServer
protected org.apache.activemq.transport.TransportServer createTransportServer() throws IOException, URISyntaxException- Throws:
IOExceptionURISyntaxException
-
getDiscoveryAgent
public org.apache.activemq.transport.discovery.DiscoveryAgent getDiscoveryAgent() throws IOException- Throws:
IOException
-
createDiscoveryAgent
protected org.apache.activemq.transport.discovery.DiscoveryAgent createDiscoveryAgent() throws IOException- Throws:
IOException
-
setDiscoveryAgent
public void setDiscoveryAgent(org.apache.activemq.transport.discovery.DiscoveryAgent discoveryAgent) -
getDiscoveryUri
-
setDiscoveryUri
-
getConnectUri
- Throws:
IOExceptionURISyntaxException
-
onStarted
-
onStopped
-
getName
-
setName
-
toString
-
getConnectionControl
protected org.apache.activemq.command.ConnectionControl getConnectionControl() -
addPeerBroker
public void addPeerBroker(org.apache.activemq.command.BrokerInfo info) -
removePeerBroker
public void removePeerBroker(org.apache.activemq.command.BrokerInfo info) -
getPeerBrokers
-
updateClientClusterInfo
public void updateClientClusterInfo()Description copied from interface:ConnectorUpdate all the connections with information about the connected brokers in the cluster- Specified by:
updateClientClusterInfoin interfaceConnector
-
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
This is called by the BrokerService right before it starts the transport.- Specified by:
setBrokerServicein interfaceBrokerServiceAware
-
getBroker
-
getBrokerService
-
isUpdateClusterClients
public boolean isUpdateClusterClients()- Specified by:
isUpdateClusterClientsin interfaceConnector- Returns:
- the updateClusterClients
-
setUpdateClusterClients
public void setUpdateClusterClients(boolean updateClusterClients) - Parameters:
updateClusterClients- the updateClusterClients to set
-
isRebalanceClusterClients
public boolean isRebalanceClusterClients()- Specified by:
isRebalanceClusterClientsin interfaceConnector- Returns:
- the rebalanceClusterClients
-
setRebalanceClusterClients
public void setRebalanceClusterClients(boolean rebalanceClusterClients) - Parameters:
rebalanceClusterClients- the rebalanceClusterClients to set
-
isUpdateClusterClientsOnRemove
public boolean isUpdateClusterClientsOnRemove()- Specified by:
isUpdateClusterClientsOnRemovein interfaceConnector- Returns:
- the updateClusterClientsOnRemove
-
setUpdateClusterClientsOnRemove
public void setUpdateClusterClientsOnRemove(boolean updateClusterClientsOnRemove) - Parameters:
updateClusterClientsOnRemove- the updateClusterClientsOnRemove to set
-
getUpdateClusterFilter
- Specified by:
getUpdateClusterFilterin interfaceConnector- Returns:
- the updateClusterFilter
-
setUpdateClusterFilter
- Parameters:
updateClusterFilter- the updateClusterFilter to set
-
connectionCount
public int connectionCount()- Specified by:
connectionCountin interfaceConnector
-
isAllowLinkStealing
public boolean isAllowLinkStealing()Description copied from interface:ConnectorIf enabled, older connections with the same clientID are stopped- Specified by:
isAllowLinkStealingin interfaceConnector- Returns:
- true/false if link stealing is enabled
-
setAllowLinkStealing
public void setAllowLinkStealing(boolean allowLinkStealing) -
isAuditNetworkProducers
public boolean isAuditNetworkProducers() -
setAuditNetworkProducers
public void setAuditNetworkProducers(boolean auditNetworkProducers) Enable a producer audit on network connections, Traps the case of a missing send reply and resend. Note: does not work with conduit=false, networked composite destinations or networked virtual topics- Parameters:
auditNetworkProducers-
-
getMaximumProducersAllowedPerConnection
public int getMaximumProducersAllowedPerConnection() -
setMaximumProducersAllowedPerConnection
public void setMaximumProducersAllowedPerConnection(int maximumProducersAllowedPerConnection) -
getMaximumConsumersAllowedPerConnection
public int getMaximumConsumersAllowedPerConnection() -
setMaximumConsumersAllowedPerConnection
public void setMaximumConsumersAllowedPerConnection(int maximumConsumersAllowedPerConnection) -
getPublishedAddressPolicy
Gets the currently configured policy for creating the published connection address of this TransportConnector.- Returns:
- the publishedAddressPolicy
-
setPublishedAddressPolicy
Sets the configured policy for creating the published connection address of this TransportConnector. -
isWarnOnRemoteClose
public boolean isWarnOnRemoteClose() -
setWarnOnRemoteClose
public void setWarnOnRemoteClose(boolean warnOnRemoteClose) -
isDisplayStackTrace
public boolean isDisplayStackTrace() -
setDisplayStackTrace
public void setDisplayStackTrace(boolean displayStackTrace) -
getMaxConnectionExceededCount
public long getMaxConnectionExceededCount()- Specified by:
getMaxConnectionExceededCountin interfaceConnector
-
isStarted
public boolean isStarted() -
setAutoStart
public void setAutoStart(boolean autoStart) -
isAutoStart
public boolean isAutoStart()- Specified by:
isAutoStartin interfaceConnector
-