org.norther.tammi.manual.sample
Class DynamicCounter

java.lang.Object
  extended by org.norther.tammi.manual.sample.FibonacciCounter
      extended by org.norther.tammi.manual.sample.DynamicCounter
All Implemented Interfaces:
DynamicMBean

public class DynamicCounter
extends FibonacciCounter
implements DynamicMBean

DynamicCounter implements Counter dynamically. Note that this code is only instructional.

Version:
$Id: DynamicCounter.java,v 1.8 2009/09/28 15:08:20 cvsimp Exp $
Author:
Ilkka Priha

Constructor Summary
DynamicCounter()
          Default constructor.
 
Method Summary
 Object getAttribute(String name)
           
 AttributeList getAttributes(String[] names)
           
 MBeanInfo getMBeanInfo()
           
 Object invoke(String method, Object[] params, String[] signature)
           
 void setAttribute(Attribute attr)
           
 AttributeList setAttributes(AttributeList attrs)
           
 
Methods inherited from class org.norther.tammi.manual.sample.FibonacciCounter
count, getCounter, setCounter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicCounter

public DynamicCounter()
Default constructor.

Method Detail

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean

getAttribute

public Object getAttribute(String name)
                    throws AttributeNotFoundException,
                           ReflectionException,
                           MBeanException
Specified by:
getAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
ReflectionException
MBeanException

setAttribute

public void setAttribute(Attribute attr)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         ReflectionException,
                         MBeanException
Specified by:
setAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
InvalidAttributeValueException
ReflectionException
MBeanException

getAttributes

public AttributeList getAttributes(String[] names)
Specified by:
getAttributes in interface DynamicMBean

setAttributes

public AttributeList setAttributes(AttributeList attrs)
Specified by:
setAttributes in interface DynamicMBean

invoke

public Object invoke(String method,
                     Object[] params,
                     String[] signature)
              throws ReflectionException,
                     MBeanException
Specified by:
invoke in interface DynamicMBean
Throws:
ReflectionException
MBeanException


Copyright © 2004 The Norther Organization. All rights reserved.