Class SocketTrace

  • All Implemented Interfaces:
    Trace

    class SocketTrace
    extends java.lang.Object
    implements Trace
    The SocketTrace is used to wrap an trace for safety. Wrapping an trace in this way ensures that even if the trace is badly written there is little chance that it will affect the operation of the server.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Trace trace
      This is the actual trace that is being wrapped by this.
    • Constructor Summary

      Constructors 
      Constructor Description
      SocketTrace​(Trace trace)
      Constructor for the SocketTrace object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void trace​(java.lang.Object event)
      This method is used to accept an event that occurred on the socket associated with this trace.
      void trace​(java.lang.Object event, java.lang.Object value)
      This method is used to accept an event that occurred on the socket associated with this trace.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • trace

        private final Trace trace
        This is the actual trace that is being wrapped by this.
    • Constructor Detail

      • SocketTrace

        public SocketTrace​(Trace trace)
        Constructor for the SocketTrace object. This will create a trace object that wraps the one provided. If the provided trace is null then this will simply ignore all events.
        Parameters:
        trace - this is the trace that is to be wrapped by this
    • Method Detail

      • trace

        public void trace​(java.lang.Object event)
        This method is used to accept an event that occurred on the socket associated with this trace. Typically the event is a symbolic description of the event such as an enum or a string.
        Specified by:
        trace in interface Trace
        Parameters:
        event - this is the event that occurred on the socket
      • trace

        public void trace​(java.lang.Object event,
                          java.lang.Object value)
        This method is used to accept an event that occurred on the socket associated with this trace. Typically the event is a symbolic description of the event such as an enum or a string.
        Specified by:
        trace in interface Trace
        Parameters:
        event - this is the event that occurred on the socket
        value - provides additional information such as an exception