Class SocketAnalyzer
java.lang.Object
org.simpleframework.transport.connect.SocketAnalyzer
- All Implemented Interfaces:
TraceAnalyzer
The
SocketAnalyzer
is used to wrap an analyzer object.
Wrapping an analyzer in this way ensures that even if the analyzer
is badly written there is little chance that it will affect the
operation of the server. All Trace
objects returned
from this will catch all exceptions within the created trace.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TraceAnalyzer
This is the analyzer that is used to create the trace objects. -
Constructor Summary
ConstructorsConstructorDescriptionSocketAnalyzer
(TraceAnalyzer analyzer) Constructor for theSocketAnalyzer
object. -
Method Summary
Modifier and TypeMethodDescriptionattach
(SelectableChannel channel) This method is used to attach a trace to the specified channel.void
stop()
This is used to stop the analyzer and clear all trace information.
-
Field Details
-
analyzer
This is the analyzer that is used to create the trace objects.
-
-
Constructor Details
-
SocketAnalyzer
Constructor for theSocketAnalyzer
object. This will be given the analyzer that is to be used to create traces. This can be a null value, in which case the trace provided will be a simple empty void that swallows all trace events.- Parameters:
analyzer
- the analyzer that is to be wrapped by this
-
-
Method Details
-
attach
This method is used to attach a trace to the specified channel. Attaching a trace basically means associating events from that trace with the specified socket. It ensures that the events from a specific channel can be observed in isolation.- Specified by:
attach
in interfaceTraceAnalyzer
- Parameters:
channel
- this is the channel to associate with the trace- Returns:
- this returns a trace associated with the channel
-
stop
public void stop()This is used to stop the analyzer and clear all trace information. Stopping the analyzer is typically done when the server is stopped and is used to free any resources associated with the analyzer. If an analyzer does not hold information this method can be ignored.- Specified by:
stop
in interfaceTraceAnalyzer
-