Class TransportLogger

  • All Implemented Interfaces:
    org.apache.activemq.Service, org.apache.activemq.transport.Transport, org.apache.activemq.transport.TransportListener

    public class TransportLogger
    extends org.apache.activemq.transport.TransportFilter
    This TransportFilter implementation writes output to a log as it intercepts commands / events before sending them to the following layer in the Transport stack.
    Author:
    David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
    • Field Summary

      • Fields inherited from class org.apache.activemq.transport.TransportFilter

        next, transportListener
    • Constructor Summary

      Constructors 
      Constructor Description
      TransportLogger​(org.apache.activemq.transport.Transport next, org.slf4j.Logger log, boolean startLogging, org.apache.activemq.transport.LogWriter logWriter)  
    • Constructor Detail

      • TransportLogger

        public TransportLogger​(org.apache.activemq.transport.Transport next,
                               org.slf4j.Logger log,
                               boolean startLogging,
                               org.apache.activemq.transport.LogWriter logWriter)
    • Method Detail

      • isLogging

        public boolean isLogging()
        Returns true if logging is activated for this TransportLogger, false otherwise.
        Returns:
        true if logging is activated for this TransportLogger, false otherwise.
      • setLogging

        public void setLogging​(boolean logging)
        Sets if logging should be activated for this TransportLogger.
        Parameters:
        logging - true to activate logging, false to deactivate.
      • request

        public Object request​(Object command)
                       throws IOException
        Specified by:
        request in interface org.apache.activemq.transport.Transport
        Overrides:
        request in class org.apache.activemq.transport.TransportFilter
        Throws:
        IOException
      • request

        public Object request​(Object command,
                              int timeout)
                       throws IOException
        Specified by:
        request in interface org.apache.activemq.transport.Transport
        Overrides:
        request in class org.apache.activemq.transport.TransportFilter
        Throws:
        IOException
      • asyncRequest

        public org.apache.activemq.transport.FutureResponse asyncRequest​(Object command,
                                                                         org.apache.activemq.transport.ResponseCallback responseCallback)
                                                                  throws IOException
        Specified by:
        asyncRequest in interface org.apache.activemq.transport.Transport
        Overrides:
        asyncRequest in class org.apache.activemq.transport.TransportFilter
        Throws:
        IOException
      • oneway

        public void oneway​(Object command)
                    throws IOException
        Specified by:
        oneway in interface org.apache.activemq.transport.Transport
        Overrides:
        oneway in class org.apache.activemq.transport.TransportFilter
        Throws:
        IOException
      • onCommand

        public void onCommand​(Object command)
        Specified by:
        onCommand in interface org.apache.activemq.transport.TransportListener
        Overrides:
        onCommand in class org.apache.activemq.transport.TransportFilter
      • onException

        public void onException​(IOException error)
        Specified by:
        onException in interface org.apache.activemq.transport.TransportListener
        Overrides:
        onException in class org.apache.activemq.transport.TransportFilter
      • getView

        public TransportLoggerView getView()
        Gets the associated MBean for this TransportLogger.
        Returns:
        the associated MBean for this TransportLogger.
      • setView

        public void setView​(TransportLoggerView view)
        Sets the associated MBean for this TransportLogger.
        Parameters:
        view - the associated MBean for this TransportLogger.
      • toString

        public String toString()
        Overrides:
        toString in class org.apache.activemq.transport.TransportFilter
      • stop

        public void stop()
                  throws Exception
        Specified by:
        stop in interface org.apache.activemq.Service
        Overrides:
        stop in class org.apache.activemq.transport.TransportFilter
        Throws:
        Exception