org.mule.util.counters
Class CounterFactory

java.lang.Object
  extended by org.mule.util.counters.CounterFactory

public final class CounterFactory
extends Object

This class is the Counter's factory. It is the main entry point for operations on counters. The user can:


Nested Class Summary
static class CounterFactory.Type
          Enum class for all different types of counters.
 
Method Summary
static Counter createCounter(String name, CounterFactory.Type type)
          Create a new public counter of the given type.
static Counter createCounter(String name, CounterFactory.Type type, boolean visible)
          Create a new counter of the given type and visibility.
static Counter createCounter(String name, String base, CounterFactory.Type type)
          Create a new public aggregate counter of the given type.
static Counter createCounter(String name, String base, CounterFactory.Type type, boolean visible)
          Create a new aggregate counter of the given type and visibility.
static Counter createCounter(String name, String first, String second, CounterFactory.Type type)
          Create a new public aggregate counter of the given type.
static Counter createCounter(String name, String first, String second, CounterFactory.Type type, boolean visible)
          Create a new aggregate counter of the given type and visibility.
static Counter getCounter(String name)
          Search the defined counters for a counter of the given name.
static Iterator getCounters()
          Retrieve an iterator giving the list of public defined counters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCounter

public static Counter getCounter(String name)
Search the defined counters for a counter of the given name.

Parameters:
name - the name of the counter to retrieve
Returns:
the counter

createCounter

public static Counter createCounter(String name,
                                    CounterFactory.Type type)
Create a new public counter of the given type.

Parameters:
name - the name of the counter to create
type - the type of the counter
Returns:
the newly created counter

createCounter

public static Counter createCounter(String name,
                                    CounterFactory.Type type,
                                    boolean visible)
Create a new counter of the given type and visibility.

Parameters:
name - the name of the counter to create
type - the type of the counter
visible - boolean specifying if the counter is public or not
Returns:
the newly created counter

createCounter

public static Counter createCounter(String name,
                                    String base,
                                    CounterFactory.Type type)
Create a new public aggregate counter of the given type.

Parameters:
name - the name of the counter to create
base - the name of the counter to use for computation
type - the type of the counter
Returns:
the newly created counter

createCounter

public static Counter createCounter(String name,
                                    String base,
                                    CounterFactory.Type type,
                                    boolean visible)
Create a new aggregate counter of the given type and visibility.

Parameters:
name - the name of the counter to create
base - the name of the counter to use for computation
type - the type of the counter
visible - boolean specifying if the counter is public or not
Returns:
the newly created counter

createCounter

public static Counter createCounter(String name,
                                    String first,
                                    String second,
                                    CounterFactory.Type type)
Create a new public aggregate counter of the given type.

Parameters:
name - the name of the counter to create
first - the name of the first counter to use for computation
second - the name of the first counter to use for computation
type - the type of the counter
Returns:
the newly created counter

createCounter

public static Counter createCounter(String name,
                                    String first,
                                    String second,
                                    CounterFactory.Type type,
                                    boolean visible)
Create a new aggregate counter of the given type and visibility.

Parameters:
name - the name of the counter to create
first - the name of the first counter to use for computation
second - the name of the first counter to use for computation
type - the type of the counter
visible - boolean specifying if the counter is public or not
Returns:
the newly created counter

getCounters

public static Iterator getCounters()
Retrieve an iterator giving the list of public defined counters.

Returns:
an iterator to walk throught the list of public defined counters


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.