Class TransportFilter

java.lang.Object
org.apache.activemq.transport.TransportFilter
All Implemented Interfaces:
Service, Transport, TransportListener
Direct Known Subclasses:
AbstractInactivityMonitor, CommandJoiner, DiscoveryTransport, MarshallingTransportFilter, MutexTransport, ResponseCorrelator, ResponseRedirectInterceptor, ThreadNameFilter, WireFormatNegotiator, WriteTimeoutFilter

public class TransportFilter extends Object implements TransportListener, Transport
  • Field Details

  • Constructor Details

    • TransportFilter

      public TransportFilter(Transport next)
  • Method Details

    • getTransportListener

      public TransportListener getTransportListener()
      Description copied from interface: Transport
      Returns the current transport listener
      Specified by:
      getTransportListener in interface Transport
      Returns:
    • setTransportListener

      public void setTransportListener(TransportListener channelListener)
      Description copied from interface: Transport
      Registers an inbound command listener
      Specified by:
      setTransportListener in interface Transport
      Parameters:
      channelListener -
    • start

      public void start() throws Exception
      Specified by:
      start in interface Service
      Throws:
      IOException - if the next channel has not been set.
      Exception
      See Also:
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface Service
      Throws:
      Exception
      See Also:
    • onCommand

      public void onCommand(Object command)
      Description copied from interface: TransportListener
      called to process a command
      Specified by:
      onCommand in interface TransportListener
      Parameters:
      command -
    • getNext

      public Transport getNext()
      Returns:
      Returns the next.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • oneway

      public void oneway(Object command) throws IOException
      Description copied from interface: Transport
      A one way asynchronous send
      Specified by:
      oneway in interface Transport
      Parameters:
      command -
      Throws:
      IOException
    • asyncRequest

      public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
      Description copied from interface: Transport
      An asynchronous request response where the Receipt will be returned in the future. If responseCallback is not null, then it will be called when the response has been completed.
      Specified by:
      asyncRequest in interface Transport
      Parameters:
      command -
      responseCallback - TODO
      Returns:
      the FutureResponse
      Throws:
      IOException
    • request

      public Object request(Object command) throws IOException
      Description copied from interface: Transport
      A synchronous request response
      Specified by:
      request in interface Transport
      Parameters:
      command -
      Returns:
      the response
      Throws:
      IOException
    • request

      public Object request(Object command, int timeout) throws IOException
      Description copied from interface: Transport
      A synchronous request response
      Specified by:
      request in interface Transport
      Parameters:
      command -
      timeout -
      Returns:
      the repsonse or null if timeout
      Throws:
      IOException
    • onException

      public void onException(IOException error)
      Description copied from interface: TransportListener
      An unrecoverable exception has occurred on the transport
      Specified by:
      onException in interface TransportListener
      Parameters:
      error -
    • transportInterupted

      public void transportInterupted()
      Description copied from interface: TransportListener
      The transport has suffered an interuption from which it hopes to recover
      Specified by:
      transportInterupted in interface TransportListener
    • transportResumed

      public void transportResumed()
      Description copied from interface: TransportListener
      The transport has resumed after an interuption
      Specified by:
      transportResumed in interface TransportListener
    • narrow

      public <T> T narrow(Class<T> target)
      Specified by:
      narrow in interface Transport
      Parameters:
      target -
      Returns:
      the target
    • getRemoteAddress

      public String getRemoteAddress()
      Specified by:
      getRemoteAddress in interface Transport
      Returns:
      the remote address for this connection
    • isFaultTolerant

      public boolean isFaultTolerant()
      Description copied from interface: Transport
      Indicates if the transport can handle faults
      Specified by:
      isFaultTolerant in interface Transport
      Returns:
      See Also:
    • isDisposed

      public boolean isDisposed()
      Specified by:
      isDisposed in interface Transport
      Returns:
      true if the transport is disposed
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface Transport
      Returns:
      true if the transport is connected
    • reconnect

      public void reconnect(URI uri) throws IOException
      Description copied from interface: Transport
      reconnect to another location
      Specified by:
      reconnect in interface Transport
      Parameters:
      uri -
      Throws:
      IOException - on failure of if not supported
    • getReceiveCounter

      public int getReceiveCounter()
      Description copied from interface: Transport
      Returns a counter which gets incremented as data is read from the transport. It should only be used to determine if there is progress being made in reading the next command from the transport. The value may wrap into the negative numbers.
      Specified by:
      getReceiveCounter in interface Transport
      Returns:
      a counter which gets incremented as data is read from the transport.
    • isReconnectSupported

      public boolean isReconnectSupported()
      Specified by:
      isReconnectSupported in interface Transport
      Returns:
      true if reconnect is supported
    • isUpdateURIsSupported

      public boolean isUpdateURIsSupported()
      Specified by:
      isUpdateURIsSupported in interface Transport
      Returns:
      true if updating uris is supported
    • updateURIs

      public void updateURIs(boolean rebalance, URI[] uris) throws IOException
      Description copied from interface: Transport
      Provide a list of available alternative locations
      Specified by:
      updateURIs in interface Transport
      Parameters:
      rebalance -
      uris -
      Throws:
      IOException
    • getPeerCertificates

      public X509Certificate[] getPeerCertificates()
      Specified by:
      getPeerCertificates in interface Transport
      Returns:
      the Certificates provided by the peer, or null if not a secure channel.
    • setPeerCertificates

      public void setPeerCertificates(X509Certificate[] certificates)
      Description copied from interface: Transport
      Sets the certificates provided by the connected peer.
      Specified by:
      setPeerCertificates in interface Transport
      Parameters:
      certificates - the Certificates provided by the peer.
    • getWireFormat

      public WireFormat getWireFormat()
      Description copied from interface: Transport
      Retrieves the WireFormat instance associated with this Transport instance.
      Specified by:
      getWireFormat in interface Transport
      Returns:
      the WireFormat in use.