net.dpml.transit.monitor
Class RepositoryMonitorRouter

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

public class RepositoryMonitorRouter
extends AbstractMonitorRouter
implements RepositoryMonitor, Router

A repository monitor router handles mutlicast distribution of monitor events to a set of subscribed monitors.

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
RepositoryMonitorRouter()
           
 
Method Summary
 void addMonitor(Monitor monitor)
          Add a monitor to the set of monitors managed by this router.
 void classloaderConstructed(String type, ClassLoader classloader)
          Notify all monitors of the creation of a new classloader.
 void establishedPluginClass(Class pluginClass)
          Notify all monitorrs of the establishment of a plugin class.
 void exceptionOccurred(String methodname, Exception e)
          Notify all monitors of an exception related to plugin establishment.
 void getPluginRequested(ClassLoader parent, URI uri, Object[] args)
          Notify all monitors of a request for the establishment of a plugin.
 void pluginConstructorFound(Constructor constructor, Object[] args)
          Notify all monitors of the discovery of a plugin constructor.
 void pluginInstantiated(Object pluginInstance)
          Notify all monitors of the instantiation of a plugin.
 void sequenceInfo(String info)
          Notify all subscribed monitors of a info message event.
 void systemExpanded(URI plugin, URL[] urls)
          Handle notification of system classloader expansion.
 
Methods inherited from class net.dpml.transit.monitor.AbstractMonitorRouter
removeMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.dpml.transit.monitor.Router
removeMonitor
 

Constructor Detail

RepositoryMonitorRouter

public RepositoryMonitorRouter()
Method Detail

sequenceInfo

public void sequenceInfo(String info)
Notify all subscribed monitors of a info message event.

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

getPluginRequested

public void getPluginRequested(ClassLoader parent,
                               URI uri,
                               Object[] args)
Notify all monitors 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 pluginClass)
Notify all monitorrs of the establishment of a plugin class.

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

exceptionOccurred

public void exceptionOccurred(String methodname,
                              Exception e)
Notify all monitors of an exception related to plugin establishment.

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

pluginConstructorFound

public void pluginConstructorFound(Constructor constructor,
                                   Object[] args)
Notify all monitors 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 pluginInstance)
Notify all monitors of the instantiation of a plugin.

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

classloaderConstructed

public void classloaderConstructed(String type,
                                   ClassLoader classloader)
Notify all monitors 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

addMonitor

public void addMonitor(Monitor monitor)
                throws IllegalArgumentException
Add a monitor to the set of monitors managed by this router.

Specified by:
addMonitor in interface Router
Overrides:
addMonitor in class AbstractMonitorRouter
Parameters:
monitor - the monitor to add
Throws:
IllegalArgumentException - if the supplied monitor does not implement the RepositoryMonitor interface