org.javasimon
Class DisabledManager

java.lang.Object
  extended by org.javasimon.DisabledManager
All Implemented Interfaces:
Manager

public final class DisabledManager
extends Object
implements Manager

Manager implementation that does nothing or returns null or NullSimon as expected from manager in disabled state. Does not support enable()/disable() - for this use SwitchingManager.

Author:
Richard "Virgo" Richter

Field Summary
 
Fields inherited from interface org.javasimon.Manager
HIERARCHY_DELIMITER, ROOT_SIMON_NAME
 
Constructor Summary
DisabledManager()
           
 
Method Summary
 CompositeCallback callback()
          Accesses default composite callback of this manager.
 void clear()
          Clears the whole manager and starts again with a single newly created Root Simon.
 ManagerConfiguration configuration()
          Accesses configuration of this manager.
 void destroySimon(String name)
          Removes Simon from the Manager.
 void disable()
          Throws UnsupportedOperationException.
 void enable()
          Throws UnsupportedOperationException.
 Counter getCounter(String name)
          Returns "Null Counter" that always returns empty/null values and cannot measure anything.
 Simon getRootSimon()
          Returns "Null Simon" that always returns empty/null values and cannot measure anything.
 Simon getSimon(String name)
          Returns "Null Simon" that always returns empty/null values and cannot measure anything.
 Collection<String> getSimonNames()
          Returns unmodifiable collection containing names of all existing Simons.
 Collection<Simon> getSimons(SimonPattern pattern)
          Returns collection containing all existing Simons matching the pattern (can be null).
 Stopwatch getStopwatch(String name)
          Returns "Null Stopwatch" that always returns empty/null values and cannot measure anything.
 boolean isEnabled()
          Returns false.
 void message(String message)
          Does nothing here.
 void warning(String message, Exception cause)
          Does nothing here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisabledManager

public DisabledManager()
Method Detail

getSimon

public Simon getSimon(String name)
Returns "Null Simon" that always returns empty/null values and cannot measure anything. Null Simon returned by this method is neither Stopwatch nor Counter.

Specified by:
getSimon in interface Manager
Parameters:
name - ignored
Returns:
null Simon

destroySimon

public void destroySimon(String name)
Description copied from interface: Manager
Removes Simon from the Manager. If Simon has some children it will be replaced by UnknownSimon.

Specified by:
destroySimon in interface Manager
Parameters:
name - name of the Simon

clear

public void clear()
Description copied from interface: Manager
Clears the whole manager and starts again with a single newly created Root Simon.

Specified by:
clear in interface Manager

callback

public CompositeCallback callback()
Description copied from interface: Manager
Accesses default composite callback of this manager. Default callback can't be removed or replaced, only other callbacks can be added or removed.

Specified by:
callback in interface Manager
Returns:
Simon callback

configuration

public ManagerConfiguration configuration()
Description copied from interface: Manager
Accesses configuration of this manager.

Specified by:
configuration in interface Manager
Returns:
configuration of this manager

getCounter

public Counter getCounter(String name)
Returns "Null Counter" that always returns empty/null values and cannot measure anything.

Specified by:
getCounter in interface Manager
Parameters:
name - ignored
Returns:
null Counter

getStopwatch

public Stopwatch getStopwatch(String name)
Returns "Null Stopwatch" that always returns empty/null values and cannot measure anything.

Specified by:
getStopwatch in interface Manager
Parameters:
name - ignored
Returns:
null Stopwatch

getRootSimon

public Simon getRootSimon()
Returns "Null Simon" that always returns empty/null values and cannot measure anything. Null Simon returned by this method is neither Stopwatch nor Counter.

Specified by:
getRootSimon in interface Manager
Returns:
null Simon

getSimonNames

public Collection<String> getSimonNames()
Description copied from interface: Manager
Returns unmodifiable collection containing names of all existing Simons. Collection is not ordered.

Specified by:
getSimonNames in interface Manager
Returns:
collection of all Simon names

getSimons

public Collection<Simon> getSimons(SimonPattern pattern)
Description copied from interface: Manager
Returns collection containing all existing Simons matching the pattern (can be null). Collection is unmodifiable if null pattern is provided and all Simons are returned, otherwise new collection with matching Simons is returned.

Specified by:
getSimons in interface Manager
Parameters:
pattern - Simon name pattern (see SimonPattern
Returns:
collection of all Simons matching the pattern
See Also:
to find out more about possible patterns

enable

public void enable()
Throws UnsupportedOperationException.

Specified by:
enable in interface Manager

disable

public void disable()
Throws UnsupportedOperationException.

Specified by:
disable in interface Manager

isEnabled

public boolean isEnabled()
Returns false.

Specified by:
isEnabled in interface Manager
Returns:
false

message

public void message(String message)
Does nothing here.

Specified by:
message in interface Manager
Parameters:
message - not used

warning

public void warning(String message,
                    Exception cause)
Does nothing here.

Specified by:
warning in interface Manager
Parameters:
message - not used
cause - not used


Copyright © 2013. All Rights Reserved.