net.dpml.transit.monitor
Class RepositoryMonitorAdapter

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

public class RepositoryMonitorAdapter
extends Object
implements RepositoryMonitor

Adapts repository service monitor events to a logging channel.

Version:
1.0.3
Author:
Digital Product Meta Library

Field Summary
 
Fields inherited from interface net.dpml.transit.monitor.Monitor
BOOTSTRAP_DEBUG_KEY
 
Constructor Summary
RepositoryMonitorAdapter(Adapter adapter)
          Creation of a new repository monito to logging adapter.
 
Method Summary
 void classloaderConstructed(String type, ClassLoader classloader)
          Handle notification of the creation of a new classloader.
 void establishedPluginClass(Class clazz)
          Handle notification of the establishment of a plugin class.
 void exceptionOccurred(String method, Exception e)
          Handle notification of an exception related to plugin establishment.
protected  Adapter getAdapter()
          Returns the adapter assigned to this adaptive monitor.
 void getPluginRequested(ClassLoader parent, URI uri, Object[] args)
          Handle notification of a request for the establishment of a plugin.
 boolean isTraceEnabled()
          Test is debug trace monitoring is enabled.
 void pluginConstructorFound(Constructor constructor, Object[] args)
          Handle notification of the discovery of a plugin constructor.
 void pluginInstantiated(Object plugin)
          Handle notification of the instantiation of a plugin.
 void sequenceInfo(String info)
          Handle notification of an information message.
 void systemExpanded(URI plugin, URL[] urls)
          Handle notification of system classloader expansion.
 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

RepositoryMonitorAdapter

public RepositoryMonitorAdapter(Adapter adapter)
Creation of a new repository monito to logging adapter.

Parameters:
adapter - the logging adapter
Method Detail

sequenceInfo

public void sequenceInfo(String info)
Handle notification of an information message.

Specified by:
sequenceInfo in interface RepositoryMonitor
Parameters:
info - the message

getPluginRequested

public void getPluginRequested(ClassLoader parent,
                               URI uri,
                               Object[] args)
Handle notification of a request for the establishment of a plugin.

Specified by:
getPluginRequested in interface RepositoryMonitor
Parameters:
parent - the parent classloader
uri - the requested plugin uri
args - the supplied constructor arguments

establishedPluginClass

public void establishedPluginClass(Class clazz)
Handle notification of the establishment of a plugin class.

Specified by:
establishedPluginClass in interface RepositoryMonitor
Parameters:
clazz - the plugin class

exceptionOccurred

public void exceptionOccurred(String method,
                              Exception e)
Handle notification of an exception related to plugin establishment.

Specified by:
exceptionOccurred in interface RepositoryMonitor
Parameters:
method - the method raising the exception
e - the causal exception

pluginConstructorFound

public void pluginConstructorFound(Constructor constructor,
                                   Object[] args)
Handle notification of the discovery of a plugin constructor.

Specified by:
pluginConstructorFound in interface RepositoryMonitor
Parameters:
constructor - the constructor
args - the constructor args

pluginInstantiated

public void pluginInstantiated(Object plugin)
Handle notification of the instantiation of a plugin.

Specified by:
pluginInstantiated in interface RepositoryMonitor
Parameters:
plugin - the plugin instance

classloaderConstructed

public void classloaderConstructed(String type,
                                   ClassLoader classloader)
Handle notification of the creation of a new classloader.

Specified by:
classloaderConstructed in interface RepositoryMonitor
Parameters:
type - the type of classloader (api, spi or impl)
classloader - the new classloader

systemExpanded

public void systemExpanded(URI plugin,
                           URL[] urls)
Handle notification of system classloader expansion.

Specified by:
systemExpanded in interface RepositoryMonitor
Parameters:
plugin - the uri of the plugin requesting system classloader expansion
urls - the array of urls added to the system classloader

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