Class TransportConnector

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

public class TransportConnector extends Object implements Connector, BrokerServiceAware
  • Field Details

  • Constructor Details

    • TransportConnector

      public TransportConnector()
    • TransportConnector

      public TransportConnector(org.apache.activemq.transport.TransportServer server)
  • Method Details

    • getConnections

      public CopyOnWriteArrayList<TransportConnection> 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:
      IOException
      URISyntaxException
    • getBrokerInfo

      public org.apache.activemq.command.BrokerInfo getBrokerInfo()
      Specified by:
      getBrokerInfo in interface Connector
      Returns:
      brokerInfo
    • setBrokerInfo

      public void setBrokerInfo(org.apache.activemq.command.BrokerInfo brokerInfo)
    • getServer

      public org.apache.activemq.transport.TransportServer getServer() throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • setServer

      public void setServer(org.apache.activemq.transport.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 org.apache.activemq.thread.TaskRunnerFactory getTaskRunnerFactory()
    • setTaskRunnerFactory

      public void setTaskRunnerFactory(org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory)
    • getStatistics

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

      public void resetStatistics()
      Reset the statistics for this connector
      Specified by:
      resetStatistics in interface 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 org.apache.activemq.Service
      Throws:
      Exception
    • getRootCause

      public static Throwable getRootCause(Throwable throwable)
    • getPublishableConnectString

      public String getPublishableConnectString() throws Exception
      Throws:
      Exception
    • getPublishableConnectURI

      public URI getPublishableConnectURI() throws Exception
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface org.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:
      IOException
      URISyntaxException
    • 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

      public URI getDiscoveryUri()
    • setDiscoveryUri

      public void setDiscoveryUri(URI discoveryUri)
    • getConnectUri

      public URI getConnectUri() throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • 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
    • 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

      public LinkedList<String> getPeerBrokers()
    • 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 String getUpdateClusterFilter()
      Specified by:
      getUpdateClusterFilter in interface Connector
      Returns:
      the updateClusterFilter
    • setUpdateClusterFilter

      public void setUpdateClusterFilter(String updateClusterFilter)
      Parameters:
      updateClusterFilter - the updateClusterFilter to set
    • connectionCount

      public int connectionCount()
      Specified by:
      connectionCount in interface Connector
    • isAllowLinkStealing

      public boolean isAllowLinkStealing()
      Description copied from interface: Connector
      If enabled, older connections with the same clientID are stopped
      Specified by:
      isAllowLinkStealing in interface Connector
      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

      public PublishedAddressPolicy getPublishedAddressPolicy()
      Gets the currently configured policy for creating the published connection address of this TransportConnector.
      Returns:
      the publishedAddressPolicy
    • setPublishedAddressPolicy

      public void setPublishedAddressPolicy(PublishedAddressPolicy publishedAddressPolicy)
      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:
      getMaxConnectionExceededCount in interface Connector
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface Connector
      Returns:
      true if connector is started