net.dpml.transit.monitor
Class ConnectionMonitorAdapter

java.lang.Object
  extended by net.dpml.transit.monitor.ConnectionMonitorAdapter
All Implemented Interfaces:
ConnectionMonitor, Monitor

public class ConnectionMonitorAdapter
extends Object
implements ConnectionMonitor

Adapts connection events to logging messages.

The NetworkMonitor must be thread safe.

Version:
1.1.0
Author:
Digital Product Meta Library
See Also:
Monitor

Field Summary
 
Fields inherited from interface net.dpml.transit.monitor.Monitor
BOOTSTRAP_DEBUG_KEY
 
Constructor Summary
ConnectionMonitorAdapter(Adapter adapter)
          Creation of a new adaptive connection monitor.
 
Method Summary
 void connectCompleted(URL url)
          Notify the monitor that a connection was completed.
 void connectionOpened(URL url)
          Notify the monitor that a connection was opened.
 void connectStarted(URL url)
          Notify the monitor that a connection was started.
protected  Adapter getAdapter()
          Returns the adapter assigned to this adaptive monitor.
 boolean isTraceEnabled()
          Test is debug trace monitoring is enabled.
 void trace(String message)
          Notify the monitor of a trace level message to log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionMonitorAdapter

public ConnectionMonitorAdapter(Adapter adapter)
Creation of a new adaptive connection monitor.

Parameters:
adapter - the adapter to assign to the monitor
Method Detail

connectionOpened

public void connectionOpened(URL url)
Notify the monitor that a connection was opened.

Specified by:
connectionOpened in interface ConnectionMonitor
Parameters:
url - the url on which the open connection was issued

connectStarted

public void connectStarted(URL url)
Notify the monitor that a connection was started.

Specified by:
connectStarted in interface ConnectionMonitor
Parameters:
url - the target connection

connectCompleted

public void connectCompleted(URL url)
Notify the monitor that a connection was completed.

Specified by:
connectCompleted in interface ConnectionMonitor
Parameters:
url - the target connection

isTraceEnabled

public boolean isTraceEnabled()
Test is debug trace monitoring is enabled.

Returns:
true if debug trace messages are enabled else false

trace

public void trace(String message)
Notify the monitor of a trace level message to log. An implement is responsible for checking if trace debug logging is enabled before handling content.

Parameters:
message - the trace level message to log

getAdapter

protected Adapter getAdapter()
Returns the adapter assigned to this adaptive monitor.

Returns:
the assigned adapter