org.picocontainer.defaults
Class MonitoringComponentAdapter

java.lang.Object
  extended by org.picocontainer.defaults.MonitoringComponentAdapter
All Implemented Interfaces:
java.io.Serializable, ComponentAdapter, ComponentMonitorStrategy
Direct Known Subclasses:
AbstractComponentAdapter

public abstract class MonitoringComponentAdapter
extends java.lang.Object
implements ComponentAdapter, ComponentMonitorStrategy, java.io.Serializable

Abstract ComponentAdapter supporting a ComponentMonitorStrategy. It provides a default ComponentMonitor, but does not allow to use null for the component monitor.

Since:
1.2
Version:
$Revision: $
Author:
Mauro Talevi
See Also:
ComponentAdapter, ComponentMonitorStrategy, Serialized Form

Field Summary
private  ComponentMonitor componentMonitor
           
 
Constructor Summary
protected MonitoringComponentAdapter()
          Constructs a MonitoringComponentAdapter with a default monitor.
protected MonitoringComponentAdapter(ComponentMonitor monitor)
          Constructs a MonitoringComponentAdapter with a custom monitor
 
Method Summary
 void changeMonitor(ComponentMonitor monitor)
          Changes the component monitor used
 ComponentMonitor currentMonitor()
          Returns the monitor currently used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.picocontainer.ComponentAdapter
accept, getComponentImplementation, getComponentInstance, getComponentKey, verify
 

Field Detail

componentMonitor

private ComponentMonitor componentMonitor
Constructor Detail

MonitoringComponentAdapter

protected MonitoringComponentAdapter(ComponentMonitor monitor)
Constructs a MonitoringComponentAdapter with a custom monitor

Parameters:
monitor - the component monitor used by this ComponentAdapter

MonitoringComponentAdapter

protected MonitoringComponentAdapter()
Constructs a MonitoringComponentAdapter with a default monitor.

Method Detail

changeMonitor

public void changeMonitor(ComponentMonitor monitor)
Description copied from interface: ComponentMonitorStrategy
Changes the component monitor used

Specified by:
changeMonitor in interface ComponentMonitorStrategy
Parameters:
monitor - the new ComponentMonitor to use

currentMonitor

public ComponentMonitor currentMonitor()
Returns the monitor currently used

Specified by:
currentMonitor in interface ComponentMonitorStrategy
Returns:
The ComponentMonitor currently used