jfun.yan.monitoring
Class MonitoringContainer

java.lang.Object
  extended by jfun.yan.containers.SimpleContainer
      extended by jfun.yan.monitoring.MonitoringContainer
All Implemented Interfaces:
java.io.Serializable, ComponentMap, Container, Registrar

public class MonitoringContainer
extends SimpleContainer

A container implementation that adds monitoring support for constructors and methods registered using registerConstructor(), registerStaticMethod() and registerMethod().

Components registered with registerComponent() are not automatically monitored.

Only components directly registerd with the registerConstructor(), registerMethod(), registerStaticMethod() are monitored. Parameters of the components are not monitored.
Use Monitors to add monitoring support.

Author:
Michelle Lei
See Also:
Serialized Form

Constructor Summary
MonitoringContainer(ComponentMonitor mon)
          To create a MonitoringContainer object.
MonitoringContainer(Registrar target, ComponentMonitor mon)
          To create a MonitoringContainer object.
 
Method Summary
 void registerConstructor(java.lang.Object key, java.lang.Class c)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 void registerConstructor(java.lang.Object key, java.lang.Class c, java.lang.Class[] param_types)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 void registerMethod(java.lang.Object key, java.lang.Object obj, java.lang.String name)
           
 void registerMethod(java.lang.Object key, java.lang.Object obj, java.lang.String name, java.lang.Class[] param_types)
           
 void registerMethod(java.lang.Object obj, java.lang.String name)
           
 void registerMethod(java.lang.Object obj, java.lang.String name, java.lang.Class[] param_types)
           
 void registerStaticMethod(java.lang.Class c, java.lang.String name)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 void registerStaticMethod(java.lang.Class c, java.lang.String name, java.lang.Class[] param_types)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 void registerStaticMethod(java.lang.Object key, java.lang.Class c, java.lang.String name)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 void registerStaticMethod(java.lang.Object key, java.lang.Class c, java.lang.String name, java.lang.Class[] param_types)
          The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton.
 
Methods inherited from class jfun.yan.containers.SimpleContainer
containsKey, containsType, defaultTransform, equals, getComponent, getComponentOfType, getComponents, getComponentsOfType, getComponentType, getDelegateTarget, getDependency, getDependency, getDependencyOfType, getDependencyOfType, getFactory, getFactory, getFactoryOfType, getFactoryOfType, getInstance, getInstance, getInstanceOfType, getInstanceOfType, getInstances, getInstances, getInstances, getInstances, getInstancesOfType, getInstancesOfType, hashCode, inherit, instantiateComponent, instantiateComponent, instantiateComponent, instantiateComponent, keys, registerComponent, registerComponent, registerConstructor, registerConstructor, registerValue, registerValue, toString, unregisterComponent, unregisterComponentsOfType, verify, verify, verifyComponent, verifyKey, verifyType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MonitoringContainer

public MonitoringContainer(Registrar target,
                           ComponentMonitor mon)
To create a MonitoringContainer object.

Parameters:
target - the Registrar object that does the registration.
mon - the ComponentMonitor object.

MonitoringContainer

public MonitoringContainer(ComponentMonitor mon)
To create a MonitoringContainer object.

Parameters:
mon - the ComponentMonitor object.
Method Detail

registerConstructor

public void registerConstructor(java.lang.Object key,
                                java.lang.Class c,
                                java.lang.Class[] param_types)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerConstructor in interface Container
Overrides:
registerConstructor in class SimpleContainer
Parameters:
key - the component key.
c - the class containing the constructor.
param_types - the parameter types of the constructor.

registerConstructor

public void registerConstructor(java.lang.Object key,
                                java.lang.Class c)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerConstructor in interface Container
Overrides:
registerConstructor in class SimpleContainer
Parameters:
key - the component key.
c - the class containing the constructor.

registerStaticMethod

public void registerStaticMethod(java.lang.Class c,
                                 java.lang.String name,
                                 java.lang.Class[] param_types)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerStaticMethod in interface Container
Overrides:
registerStaticMethod in class SimpleContainer
Parameters:
c - the class containing the static method.
name - the method name.

registerStaticMethod

public void registerStaticMethod(java.lang.Class c,
                                 java.lang.String name)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerStaticMethod in interface Container
Overrides:
registerStaticMethod in class SimpleContainer
Parameters:
c - the class containing the static method.
name - the method name.

registerStaticMethod

public void registerStaticMethod(java.lang.Object key,
                                 java.lang.Class c,
                                 java.lang.String name,
                                 java.lang.Class[] param_types)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerStaticMethod in interface Container
Overrides:
registerStaticMethod in class SimpleContainer
Parameters:
key - the component key.
c - the class containing the static method.
name - the method name.
param_types - the parameter types.

registerStaticMethod

public void registerStaticMethod(java.lang.Object key,
                                 java.lang.Class c,
                                 java.lang.String name)
Description copied from class: SimpleContainer
The component is transformed by SimpleContainer.defaultTransform(Component), which makes it singleton. Override SimpleContainer.defaultTransform(Component) if a different default behavior is desired.

Specified by:
registerStaticMethod in interface Container
Overrides:
registerStaticMethod in class SimpleContainer
Parameters:
key - the component key.
c - the class containing the static method.
name - the method name.

registerMethod

public void registerMethod(java.lang.Object key,
                           java.lang.Object obj,
                           java.lang.String name,
                           java.lang.Class[] param_types)

registerMethod

public void registerMethod(java.lang.Object key,
                           java.lang.Object obj,
                           java.lang.String name)

registerMethod

public void registerMethod(java.lang.Object obj,
                           java.lang.String name,
                           java.lang.Class[] param_types)

registerMethod

public void registerMethod(java.lang.Object obj,
                           java.lang.String name)