Java Doc for AbstractDynamicMBean.java in  » JMX » mx4j » mx4j » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » mx4j » mx4j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   mx4j.AbstractDynamicMBean

All known Subclasses:   mx4j.examples.mbeans.legacy.DynamicLegacyService,  mx4j.examples.mbeans.dynamic.DynamicService,
AbstractDynamicMBean
abstract public class AbstractDynamicMBean implements DynamicMBean(Code)
Utility class that allow the user to easily write DynamicMBeans.
By extending this class, the developer does not have to implement the methods of the DynamicMBean interface, but has instead to provide only the metadata (by overriding few methods) and the implementation (by implementing the methods) of the MBean itself.
The methods to override that provides metadata information are usually the following:
  • createMBeanAttributeInfo, if the MBeans has manageable attributes
  • createMBeanOperationInfo, if the MBeans has manageable operations
  • createMBeanNotificationInfo, if the MBeans has manageable notifications
  • createMBeanConstructorInfo, if the MBeans has manageable constructors
  • getMBeanDescription
For example, the following MBean only has one manageable attribute:
 public class SimpleDynamic extends AbstractDynamicMBean
 {
 protected MBeanAttributeInfo[] createMBeanAttributeInfo()
 {
 return new MBeanAttributeInfo[]
 {
 new MBeanAttributeInfo("Name", String.class.getName(), "The name", true, true, false)
 };
 }
 

protected String getMBeanDescription() { return "A simple DynamicMBean"; }

public String getName() { ... }

public void setName(String name) { ... } }

It is responsibility of the developer to specify the metadata and implement the methods specified by the metadata, that will be invoked via reflection by the AbstractDynamicMBean class. For this reason, the methods belonging to the MBean implementation (in the case above getName() and setName(...)) must be public.
version:
   $Revision: 1.7 $



Constructor Summary
protected  AbstractDynamicMBean()
     Only subclasses can create a new instance of an AbstractDynamicMBean.

Method Summary
protected  MBeanAttributeInfo[]createMBeanAttributeInfo()
     To be overridden to return metadata information about manageable attributes.
protected  MBeanConstructorInfo[]createMBeanConstructorInfo()
     To be overridden to return metadata information about manageable constructors.
protected  MBeanInfocreateMBeanInfo()
     Creates the MBeanInfo for this instance, calling in succession factory methods that the user can override.
protected  MBeanNotificationInfo[]createMBeanNotificationInfo()
     To be overridden to return metadata information about manageable notifications.
protected  MBeanOperationInfo[]createMBeanOperationInfo()
     To be overridden to return metadata information about manageable operations.
protected  MethodfindMethod(Class cls, String name, Class[] params)
     Returns the (public) method with the given name and signature on the given class.
public  ObjectgetAttribute(String attribute)
     Returns the value of the manageable attribute, as specified by the DynamicMBean interface.
public  AttributeListgetAttributes(String[] attributes)
     Returns the manageable attributes, as specified by the DynamicMBean interface.
protected  StringgetMBeanClassName()
     To be overridden to return metadata information about the class name of this MBean; by default returns this class' name.
protected  StringgetMBeanDescription()
     To be overridden to return metadata information about the description of this MBean.
public synchronized  MBeanInfogetMBeanInfo()
     Returns the MBeaInfo, as specified by the DynamicMBean interface; the default implementation caches the value returned by AbstractDynamicMBean.createMBeanInfo (that is thus called only once).
protected synchronized  ObjectgetResource()
    
public  Objectinvoke(String method, Object[] arguments, String[] params)
    
protected  Objectinvoke(String name, Class[] params, Object[] args)
    
protected  Objectinvoke(Object resource, String name, Class[] params, Object[] args)
     Looks up the method to call on given resource and invokes it.
protected  ObjectinvokeMethod(Method method, Object resource, Object[] args)
     Invokes the given method on the given resource object with the given arguments.
public  voidsetAttribute(Attribute attribute)
     Sets the value of the manageable attribute, as specified by the DynamicMBean interface.
public  AttributeListsetAttributes(AttributeList attributes)
     Sets the manageable attributes, as specified by the DynamicMBean interface.
protected synchronized  voidsetMBeanInfo(MBeanInfo info)
     Sets the MBeanInfo object cached by this instance.
public synchronized  voidsetResource(Object resource)
     Specifies the resource object on which invoke attribute's getters, attribute's setters and operation's methods.


Constructor Detail
AbstractDynamicMBean
protected AbstractDynamicMBean()(Code)
Only subclasses can create a new instance of an AbstractDynamicMBean.
See Also:   AbstractDynamicMBean.createMBeanConstructorInfo




Method Detail
createMBeanAttributeInfo
protected MBeanAttributeInfo[] createMBeanAttributeInfo()(Code)
To be overridden to return metadata information about manageable attributes.



createMBeanConstructorInfo
protected MBeanConstructorInfo[] createMBeanConstructorInfo()(Code)
To be overridden to return metadata information about manageable constructors.



createMBeanInfo
protected MBeanInfo createMBeanInfo()(Code)
Creates the MBeanInfo for this instance, calling in succession factory methods that the user can override. Information to create MBeanInfo are taken calling the following methods:



createMBeanNotificationInfo
protected MBeanNotificationInfo[] createMBeanNotificationInfo()(Code)
To be overridden to return metadata information about manageable notifications.



createMBeanOperationInfo
protected MBeanOperationInfo[] createMBeanOperationInfo()(Code)
To be overridden to return metadata information about manageable operations.



findMethod
protected Method findMethod(Class cls, String name, Class[] params) throws NoSuchMethodException(Code)
Returns the (public) method with the given name and signature on the given class.
Override to return non-public methods, or to map methods to other classes, or to map methods with different signatures
See Also:   AbstractDynamicMBean.invoke(String,Class[],Object[])
See Also:   AbstractDynamicMBean.invokeMethod



getAttribute
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)
Returns the value of the manageable attribute, as specified by the DynamicMBean interface.
See Also:   AbstractDynamicMBean.createMBeanAttributeInfo



getAttributes
public AttributeList getAttributes(String[] attributes)(Code)
Returns the manageable attributes, as specified by the DynamicMBean interface.



getMBeanClassName
protected String getMBeanClassName()(Code)
To be overridden to return metadata information about the class name of this MBean; by default returns this class' name.



getMBeanDescription
protected String getMBeanDescription()(Code)
To be overridden to return metadata information about the description of this MBean.



getMBeanInfo
public synchronized MBeanInfo getMBeanInfo()(Code)
Returns the MBeaInfo, as specified by the DynamicMBean interface; the default implementation caches the value returned by AbstractDynamicMBean.createMBeanInfo (that is thus called only once).
See Also:   AbstractDynamicMBean.createMBeanInfo
See Also:   AbstractDynamicMBean.setMBeanInfo



getResource
protected synchronized Object getResource()(Code)
Returns the resource object on which invoke attribute's getters, attribute's setters and operation's methods
See Also:   AbstractDynamicMBean.setResource



invoke
public Object invoke(String method, Object[] arguments, String[] params) throws MBeanException, ReflectionException(Code)
Returns the value of the manageable operation as specified by the DynamicMBean interface
See Also:   AbstractDynamicMBean.createMBeanOperationInfo



invoke
protected Object invoke(String name, Class[] params, Object[] args) throws InvalidAttributeValueException, MBeanException, ReflectionException(Code)
AbstractDynamicMBean.invoke(Object,String,Class[],Object[])AbstractDynamicMBean.setResource



invoke
protected Object invoke(Object resource, String name, Class[] params, Object[] args) throws InvalidAttributeValueException, MBeanException, ReflectionException(Code)
Looks up the method to call on given resource and invokes it. The default implementation requires that the methods that implement attribute and operation behavior on the resource object are public, but it is possible to override this behavior, and call also private methods.
See Also:   AbstractDynamicMBean.findMethod
See Also:   AbstractDynamicMBean.invokeMethod



invokeMethod
protected Object invokeMethod(Method method, Object resource, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException(Code)
Invokes the given method on the given resource object with the given arguments.
Override to map methods to other objects, or to map methods with different arguments
See Also:   AbstractDynamicMBean.invoke(String,Class[],Object[])
See Also:   AbstractDynamicMBean.findMethod



setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException(Code)
Sets the value of the manageable attribute, as specified by the DynamicMBean interface.
See Also:   AbstractDynamicMBean.createMBeanAttributeInfo



setAttributes
public AttributeList setAttributes(AttributeList attributes)(Code)
Sets the manageable attributes, as specified by the DynamicMBean interface.



setMBeanInfo
protected synchronized void setMBeanInfo(MBeanInfo info)(Code)
Sets the MBeanInfo object cached by this instance.
The given MBeanInfo is not cloned.
See Also:   AbstractDynamicMBean.getMBeanInfo



setResource
public synchronized void setResource(Object resource)(Code)
Specifies the resource object on which invoke attribute's getters, attribute's setters and operation's methods.
See Also:   AbstractDynamicMBean.getResource



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.