org.jsesoft.mmbi.samples
Class PureResource

java.lang.Object
  extended by org.jsesoft.mmbi.samples.PureResource
All Implemented Interfaces:
ManagedResource
Direct Known Subclasses:
FullJavaBeansResource

public class PureResource
extends java.lang.Object
implements ManagedResource

A JavaBean without any special JMX management support.

This resource demonstrates, that basic JMX management can be provided by MMBI without any effort by the resource's developer: simply by confirming to the JavaBeans conventions.

Author:
kwiedera2

Field Summary
 
Fields inherited from interface org.jsesoft.mmbi.samples.ManagedResource
HIGH_WATER_MARK, LOW_WATER_MARK
 
Constructor Summary
PureResource()
          An explicit constructor, better provide one.
 
Method Summary
 void addChangeResourceEventListener(ChangeResourceEventListener listener)
          Adds a resource listener.
 void decrementCount()
          Decrements count by one.
 void fireChangeEvent()
          Fires a resource change event.
 long getCount()
          Reads count attribute.
 void incrementCount()
          Increments count by one.
 void removeChangeResourceEventListener(ChangeResourceEventListener listener)
          Removes a resource listener.
 void resetCount()
          Resets count.
 void setCount(long count)
          Writes count attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PureResource

public PureResource()
An explicit constructor, better provide one.

Method Detail

getCount

public long getCount()
Reads count attribute.

Specified by:
getCount in interface ManagedResource
Returns:
the count

setCount

public void setCount(long count)
              throws java.lang.Exception
Writes count attribute.

Specified by:
setCount in interface ManagedResource
Parameters:
count - the new value of the count attribute.
Throws:
java.lang.Exception - on failure

incrementCount

public void incrementCount()
                    throws java.lang.Exception
Increments count by one.

Specified by:
incrementCount in interface ManagedResource
Throws:
java.lang.Exception - on failure

decrementCount

public void decrementCount()
                    throws java.lang.Exception
Decrements count by one.

Specified by:
decrementCount in interface ManagedResource
Throws:
java.lang.Exception - on failure

resetCount

public void resetCount()
                throws java.lang.Exception
Resets count.

Specified by:
resetCount in interface ManagedResource
Throws:
java.lang.Exception - on failure

addChangeResourceEventListener

public void addChangeResourceEventListener(ChangeResourceEventListener listener)
                                    throws java.util.TooManyListenersException
Adds a resource listener.

Note:
The JConsole disables operations with unserializable parameters (such as ChangeResourceEventListener) for remote management.

Parameters:
listener - the listener to add
Throws:
java.util.TooManyListenersException - on failure

removeChangeResourceEventListener

public void removeChangeResourceEventListener(ChangeResourceEventListener listener)
Removes a resource listener.

Note:
The JConsole disables operations with unserializable parameters (such as ChangeResourceEventListener) for remote management.

Parameters:
listener - the listener to remove

fireChangeEvent

public void fireChangeEvent()
                     throws java.lang.Exception
Fires a resource change event.

Throws:
java.lang.Exception - on failure


Copyright © 2010 JSESoft. All Rights Reserved.