org.jsesoft.mmbi.samples
Class SampleResource

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.jsesoft.mmbi.samples.SampleResource
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class SampleResource
extends javax.management.NotificationBroadcasterSupport

Serves as a sample for a managed resource.

This class demonstrates both, automatic and JMX annotation controlled instrumentation as a Model MBean.

Version:
1.0
Author:
JSESoft

Constructor Summary
  SampleResource()
          Non-parameter constructor.
  SampleResource(java.lang.Object coverage)
          One-parameter constructor.
protected SampleResource(java.lang.Object coverage, java.lang.Object protect)
          Protected constructor.
 
Method Summary
 char getCharacter()
          Returns a character.
 int getInteger()
          Returns an integer.
 boolean isControlled()
          The getter for the controlled field.
protected  boolean isManageable()
          Protected getters aren't remotely manageable.
 boolean isReadOnlyField()
          The getter for the read-only field.
 boolean isReady()
          Returns a boolean.
 void namedFunction(long l)
          Does nothing.
 long parametrizedFunction(long aLongParameter)
          parametrizedFunction.
 void setCharacter(char value)
          Returns a character.
 void setControlled(boolean isControlled)
          The setter for the controlled field.
protected  void setManageable(boolean value)
          Protected setters aren't remotely manageable.
 void xmlFunction()
          Doesn't do anything.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleResource

@JMX(hide=true)
public SampleResource()
Non-parameter constructor.


SampleResource

public SampleResource(java.lang.Object coverage)
One-parameter constructor.

Parameters:
coverage - constructor parameter

SampleResource

protected SampleResource(java.lang.Object coverage,
                         java.lang.Object protect)
Protected constructor.

Parameters:
coverage - constructor param
protect - constructor param
Method Detail

isReadOnlyField

@JMX(hide=true)
public boolean isReadOnlyField()
The getter for the read-only field.

Returns:
value of the read-only field

isControlled

@JMXNotification(description="Test Notification",
                 types={"jsesoft.mmbi.test.on","jsesoft.mmbi.test.off"})
public boolean isControlled()
The getter for the controlled field.

Returns:
if true the test doesn't stop until the stopped attribute is true

isManageable

protected boolean isManageable()
Protected getters aren't remotely manageable.

Returns:
false

setManageable

protected void setManageable(boolean value)
Protected setters aren't remotely manageable.

Parameters:
value - a boolean value

setControlled

public void setControlled(boolean isControlled)
The setter for the controlled field.

Parameters:
isControlled - the new value for the controlled field

parametrizedFunction

@JMX(displayName="coverage",
     description="coverage description")
public long parametrizedFunction(long aLongParameter)
parametrizedFunction.

Parameters:
aLongParameter - a long value
Returns:
the long value

namedFunction

@JMX(impact=1)
public void namedFunction(@JMX(name="value")
                                    long l)
Does nothing.

Parameters:
l - long

xmlFunction

@JMX(xml="")
public void xmlFunction()
Doesn't do anything.


getInteger

@JMX(name="getInteger")
public int getInteger()
Returns an integer.

Returns:
the integer

getCharacter

public char getCharacter()
Returns a character.

Returns:
the character

setCharacter

public void setCharacter(char value)
Returns a character.

Parameters:
value - the character

isReady

public boolean isReady()
Returns a boolean.

Returns:
true if ready


Copyright © 2010 JSESoft. All Rights Reserved.