org.fusesource.commons.management.noop
Class ManagementStrategyImpl

java.lang.Object
  extended by org.fusesource.commons.management.noop.ManagementStrategyImpl
All Implemented Interfaces:
ManagementStrategy

public class ManagementStrategyImpl
extends java.lang.Object
implements ManagementStrategy

An implementation of the ManagementStrategy interface that acts as a sink and does nothing.

Intended for use when no management is required.


Constructor Summary
ManagementStrategyImpl()
           
 
Method Summary
 Statistic createStatistic(java.lang.String name, java.lang.Object owner, Statistic.UpdateMode updateMode)
          Creates a statistic; a representation of raw statistical data.
<T> T
getManagedObjectName(java.lang.Object managableObject, java.lang.String customName, java.lang.Class<T> nameType)
          Construct an object name, where either the object to be managed and/or a custom name component are provided
 boolean isManaged(java.lang.Object managableObject, java.lang.Object name)
          Determines if an object or name is managed.
 void manageNamedObject(java.lang.Object managedObject, java.lang.Object preferedName)
          Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.
 void manageObject(java.lang.Object managedObject)
          Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.
 void notify(java.util.EventObject event)
          Management events provide a single model for capturing information about execution points in the application code.
 void unmanageNamedObject(java.lang.Object name)
          Removes a managed object by name.
 void unmanageObject(java.lang.Object managedObject)
          Removes the managed object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagementStrategyImpl

public ManagementStrategyImpl()
Method Detail

manageObject

public void manageObject(java.lang.Object managedObject)
                  throws java.lang.Exception
Description copied from interface: ManagementStrategy
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.

Specified by:
manageObject in interface ManagementStrategy
Parameters:
managedObject - the managed object
Throws:
java.lang.Exception - can be thrown if the object could not be added

getManagedObjectName

public <T> T getManagedObjectName(java.lang.Object managableObject,
                                  java.lang.String customName,
                                  java.lang.Class<T> nameType)
                       throws java.lang.Exception
Description copied from interface: ManagementStrategy
Construct an object name, where either the object to be managed and/or a custom name component are provided

Specified by:
getManagedObjectName in interface ManagementStrategy
Parameters:
managableObject - the object to be managed
customName - a custom name component
nameType - the name type required
Returns:
an object name of the required type if supported, otherwise null
Throws:
java.lang.Exception - can be thrown if the object name could not be created

manageNamedObject

public void manageNamedObject(java.lang.Object managedObject,
                              java.lang.Object preferedName)
                       throws java.lang.Exception
Description copied from interface: ManagementStrategy
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit.

Specified by:
manageNamedObject in interface ManagementStrategy
Parameters:
managedObject - the managed object
preferedName - representing the preferred name, maybe a String, or a JMX ObjectName
Throws:
java.lang.Exception - can be thrown if the object could not be added

unmanageObject

public void unmanageObject(java.lang.Object managedObject)
                    throws java.lang.Exception
Description copied from interface: ManagementStrategy
Removes the managed object.

Specified by:
unmanageObject in interface ManagementStrategy
Parameters:
managedObject - the managed object
Throws:
java.lang.Exception - can be thrown if the object could not be removed

unmanageNamedObject

public void unmanageNamedObject(java.lang.Object name)
                         throws java.lang.Exception
Description copied from interface: ManagementStrategy
Removes a managed object by name.

Specified by:
unmanageNamedObject in interface ManagementStrategy
Parameters:
name - an object name previously created by this strategy.
Throws:
java.lang.Exception - can be thrown if the object could not be removed

isManaged

public boolean isManaged(java.lang.Object managableObject,
                         java.lang.Object name)
Description copied from interface: ManagementStrategy
Determines if an object or name is managed.

Specified by:
isManaged in interface ManagementStrategy
Parameters:
managableObject - the object to consider
name - the name to consider
Returns:
true if the given object or name is managed

notify

public void notify(java.util.EventObject event)
            throws java.lang.Exception
Description copied from interface: ManagementStrategy
Management events provide a single model for capturing information about execution points in the application code. Management strategy implementations decide if and where to record these events. Applications communicate events to management strategy implementations via the notify(EventObject) method.

Specified by:
notify in interface ManagementStrategy
Parameters:
event - the event
Throws:
java.lang.Exception - can be thrown if the notification failed

createStatistic

public Statistic createStatistic(java.lang.String name,
                                 java.lang.Object owner,
                                 Statistic.UpdateMode updateMode)
Description copied from interface: ManagementStrategy
Creates a statistic; a representation of raw statistical data.

Specified by:
createStatistic in interface ManagementStrategy
Parameters:
name - The unique name assigned to the statistic usage.
owner - The object whose identity is to be associated with the metric.
updateMode - The update mode to be assigned to the returned statistic.
Returns:
the statistic
See Also:
Statistic.UpdateMode


Copyright © 2009 FuseSource. All Rights Reserved.