org.javasimon.jmx
Class SimonInfo

java.lang.Object
  extended by org.javasimon.jmx.SimonInfo

public final class SimonInfo
extends Object

Value object for retrieving Simon name and type info via Simon MXBean (SimonManagerMXBean). This value object make possible to retrieve list of all instantiated Simons together with their types, so no multiple roundtrips are needed.

Example: Following example shows usage of SimonInfo object to find out Simon type through jmx.

 System.out.println("List of stopwatch Simons:");
 for (SimonInfo si : simon.getSimonInfos()) {
 if (si.getType().equals(SimonInfo.STOPWATCH)) {
 System.out.println("  " + si.getName());
 }
 }

Since:
2.0
Author:
Radovan Sninsky, Richard "Virgo" Richter
See Also:
SimonManagerMXBean.getSimonInfos()

Field Summary
static String COUNTER
          Type identifier for Counter.
private  String name
           
static String STOPWATCH
          Type identifier for Stopwatch.
private  String type
           
static String UNKNOWN
          Type identifier for unknown Simon.
 
Constructor Summary
SimonInfo(String name, String type)
          Class constructor due to JMX requirements.
 
Method Summary
 String getName()
          Returns fully hierarchical name of Simon.
 String getType()
          Returns Simon type, either 'stopwatch' or 'counter' strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final String UNKNOWN
Type identifier for unknown Simon.

See Also:
Constant Field Values

STOPWATCH

public static final String STOPWATCH
Type identifier for Stopwatch.

See Also:
Constant Field Values

COUNTER

public static final String COUNTER
Type identifier for Counter.

See Also:
Constant Field Values

name

private String name

type

private String type
Constructor Detail

SimonInfo

@ConstructorProperties(value={"name","type"})
public SimonInfo(String name,
                                            String type)
Class constructor due to JMX requirements.

Parameters:
name - Simon name
type - Simon type ('stopwatch' or 'counter')
Method Detail

getName

public String getName()
Returns fully hierarchical name of Simon.

Returns:
Simon name

getType

public String getType()
Returns Simon type, either 'stopwatch' or 'counter' strings.

Returns:
Simon type
See Also:
UNKNOWN, STOPWATCH, COUNTER


Copyright © 2013. All Rights Reserved.