Java Doc for StandardMBean.java in  » JMX » jfoxmx » javax » management » 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 » jfoxmx » javax.management 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.StandardMBean

All known Subclasses:   example.jmx.standard.Test1_2,
StandardMBean
public class StandardMBean implements DynamicMBean,MBeanRegistration(Code)

An MBean whose management interface is determined by reflection on a Java interface.

This class brings more flexibility to the notion of Management Interface in the use of Standard MBeans. Straightforward use of the patterns for Standard MBeans described in the JMX Specification means that there is a fixed relationship between the implementation class of an MBean and its management interface (i.e., if the implementation class is Thing, the management interface must be ThingMBean). This class makes it possible to keep the convenience of specifying the management interface with a Java interface, without requiring that there be any naming relationship between the implementation and interface classes.

By making a DynamicMBean out of an MBean, this class makes it possible to select any interface implemented by the MBean as its management interface, provided that it complies with JMX patterns (i.e., attributes defined by getter/setter etc...).

This class also provides hooks that make it possible to supply custom descriptions and names for the MBeanInfo returned by the DynamicMBean interface.

Using this class, an MBean can be created with any implementation class name Impl and with a management interface defined (as for current Standard MBeans) by any interface Intf, in one of two general ways:

  • Using the public constructor StandardMBean.StandardMBean(java.lang.Object,java.lang.Class)StandardMBean(impl,interface) :
     MBeanServer mbs;
     ...
     Impl impl = new Impl(...);
     StandardMBean mbean = new StandardMBean(impl, Intf.class);
     mbs.registerMBean(mbean, objectName);
     
  • Subclassing StandardMBean:
     public class Impl extends StandardMBean implements Intf {
     public Impl() {
     super(Intf.class);
     }
     // implement methods of Intf
     }
     [...]
     MBeanServer mbs;
     ....
     Impl impl = new Impl();
     mbs.registerMBean(impl, objectName);
     

In either case, the class Impl must implement the interface Intf.

Standard MBeans based on the naming relationship between implementation and interface classes are of course still available.


since:
   JMX 1.2
author:
   Young Yang



Constructor Summary
public  StandardMBean(Object implementation, Class mbeanInterface)
    

Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.


Parameters:
  implementation - The implementation of this MBean.
Parameters:
  mbeanInterface - The Management Interface exported by thisMBean's implementation.
protected  StandardMBean(Class mbeanInterface)
    

Make a DynamicMBean out of this, using the specified mbeanInterface class.

Call StandardMBean.StandardMBean(java.lang.Object,java.lang.Class)this(this,mbeanInterface) .


Method Summary
protected synchronized  voidcacheMBeanInfo(MBeanInfo info)
     Customization hook: cache the MBeanInfo built for this object.

Subclasses may redefine this method in order to implement their own caching policy.

public  ObjectgetAttribute(String attribute)
    
public  AttributeListgetAttributes(String[] attributes)
    
protected  MBeanInfogetCachedMBeanInfo()
     Customization hook: Return the MBeanInfo cached for this object.

Subclasses may redefine this method in order to implement their own caching policy.

protected  StringgetClassName(MBeanInfo info)
     Customization hook: Get the className that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom class name.
protected  MBeanConstructorInfo[]getConstructors(MBeanConstructorInfo[] ctors, Object impl)
     Customization hook: Get the MBeanConstructorInfo[] that will be used in the MBeanInfo returned by this MBean.
By default, this method returns null if the wrapped implementation is not this.
protected  StringgetDescription(MBeanInfo info)
     Customization hook: Get the description that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom MBean description.
protected  StringgetDescription(MBeanFeatureInfo info)
    

Customization hook: Get the description that will be used in the MBeanFeatureInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description.

protected  StringgetDescription(MBeanAttributeInfo info)
     Customization hook: Get the description that will be used in the MBeanAttributeInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description.

protected  StringgetDescription(MBeanConstructorInfo info)
     Customization hook: Get the description that will be used in the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns StandardMBean.getDescription(MBeanFeatureInfo)getDescription((MBeanFeatureInfo) info) .
Parameters:
  info - The default MBeanConstructorInfo derived by reflection.
protected  StringgetDescription(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)
     Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description.
protected  StringgetDescription(MBeanOperationInfo info)
     Customization hook: Get the description that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description.
protected  StringgetDescription(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)
     Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description.
protected  intgetImpact(MBeanOperationInfo info)
     Customization hook: Get the impact flag of the operation that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom impact flag.
public synchronized  ObjectgetImplementation()
     Get the implementation of this MBean.
public synchronized  ClassgetImplementationClass()
     Get the class of the implementation of this MBean.
public  MBeanInfogetMBeanInfo()
    
final public synchronized  ClassgetMBeanInterface()
     Get the Management Interface of this MBean.
public  MBeanMetaDatagetMetaData()
    
protected  MBeanNotificationInfo[]getNotifications(MBeanInfo info)
     Customization hook: Get the MBeanNotificationInfo[] that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom notifications.
Parameters:
  info - The default MBeanInfo derived by reflection.
protected  StringgetParameterName(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)
     Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name.
protected  StringgetParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)
     Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name.
public  Objectinvoke(String actionName, Object params, String signature)
    
public  voidpostDeregister()
    
public  voidpostRegister(Boolean registrationDone)
    
public  voidpreDeregister()
    
public  ObjectNamepreRegister(MBeanServer server, ObjectName name)
    
public  voidsetAttribute(Attribute attribute)
    
public  AttributeListsetAttributes(AttributeList attributes)
    
public synchronized  voidsetImplementation(Object implementation)
    


Constructor Detail
StandardMBean
public StandardMBean(Object implementation, Class mbeanInterface) throws NotCompliantMBeanException(Code)

Make a DynamicMBean out of the object implementation, using the specified mbeanInterface class.


Parameters:
  implementation - The implementation of this MBean.
Parameters:
  mbeanInterface - The Management Interface exported by thisMBean's implementation. If null, then thisobject will use standard JMX design pattern to determinethe management interface associated with the givenimplementation.
exception:
  IllegalArgumentException - if the givenimplementation is null.
exception:
  NotCompliantMBeanException - if the mbeanInterfacedoes not follow JMX design patterns for Management Interfaces, orif the given implementation does not implement thespecified interface.



StandardMBean
protected StandardMBean(Class mbeanInterface) throws NotCompliantMBeanException(Code)

Make a DynamicMBean out of this, using the specified mbeanInterface class.

Call StandardMBean.StandardMBean(java.lang.Object,java.lang.Class)this(this,mbeanInterface) . This constructor is reserved to subclasses.


Parameters:
  mbeanInterface - The Management Interface exported by thisMBean.
exception:
  NotCompliantMBeanException - if the mbeanInterfacedoes not follow JMX design patterns for Management Interfaces, orif this does not implement the specified interface.




Method Detail
cacheMBeanInfo
protected synchronized void cacheMBeanInfo(MBeanInfo info)(Code)
Customization hook: cache the MBeanInfo built for this object.

Subclasses may redefine this method in order to implement their own caching policy. The default implementation stores info in this instance. A subclass can define other policies, such as not saving info (so it is reconstructed every time StandardMBean.getMBeanInfo() is called) or sharing a unique MBeanInfo object when several StandardMBean instances have equal MBeanInfo values.
Parameters:
  info - the new MBeanInfo to cache. Anypreviously cached value is discarded. This parameter may benull, in which case there is no new cached value.




getAttribute
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)



getAttributes
public AttributeList getAttributes(String[] attributes)(Code)



getCachedMBeanInfo
protected MBeanInfo getCachedMBeanInfo()(Code)
Customization hook: Return the MBeanInfo cached for this object.

Subclasses may redefine this method in order to implement their own caching policy. The default implementation stores one MBeanInfo object per instance. The cached MBeanInfo, or null if no MBeanInfo is cached.
See Also:   StandardMBean.cacheMBeanInfo(MBeanInfo)




getClassName
protected String getClassName(MBeanInfo info)(Code)
Customization hook: Get the className that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom class name. The default implementation returns MBeanInfo.getClassName info.getClassName() .
Parameters:
  info - The default MBeanInfo derived by reflection. the class name for the new MBeanInfo.



getConstructors
protected MBeanConstructorInfo[] getConstructors(MBeanConstructorInfo[] ctors, Object impl)(Code)
Customization hook: Get the MBeanConstructorInfo[] that will be used in the MBeanInfo returned by this MBean.
By default, this method returns null if the wrapped implementation is not this. Indeed, if the wrapped implementation is not this object itself, it will not be possible to recreate a wrapped implementation by calling the implementation constructors through MBeanServer.createMBean(...).
Otherwise, if the wrapped implementation is this, ctors is returned.
Subclasses may redefine this method in order to modify this behaviour, if needed.
Parameters:
  ctors - The default MBeanConstructorInfo[] derived by reflection.
Parameters:
  impl - The wrapped implementation. If null ispassed, the wrapped implementation is ignored andctors is returned. the MBeanConstructorInfo[] for the new MBeanInfo.



getDescription
protected String getDescription(MBeanInfo info)(Code)
Customization hook: Get the description that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom MBean description. The default implementation returns MBeanInfo.getDescription info.getDescription() .
Parameters:
  info - The default MBeanInfo derived by reflection. the description for the new MBeanInfo.



getDescription
protected String getDescription(MBeanFeatureInfo info)(Code)

Customization hook: Get the description that will be used in the MBeanFeatureInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description. The default implementation returns MBeanFeatureInfo.getDescriptioninfo.getDescription() .

This method is called by StandardMBean.getDescription(MBeanAttributeInfo) , StandardMBean.getDescription(MBeanOperationInfo) , StandardMBean.getDescription(MBeanConstructorInfo) .


Parameters:
  info - The default MBeanFeatureInfo derived by reflection. the description for the given MBeanFeatureInfo.



getDescription
protected String getDescription(MBeanAttributeInfo info)(Code)
Customization hook: Get the description that will be used in the MBeanAttributeInfo returned by this MBean.

Subclasses may redefine this method in order to supply their custom description. The default implementation returns StandardMBean.getDescription(MBeanFeatureInfo)getDescription((MBeanFeatureInfo) info) .
Parameters:
  info - The default MBeanAttributeInfo derived by reflection. the description for the given MBeanAttributeInfo.




getDescription
protected String getDescription(MBeanConstructorInfo info)(Code)
Customization hook: Get the description that will be used in the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns StandardMBean.getDescription(MBeanFeatureInfo)getDescription((MBeanFeatureInfo) info) .
Parameters:
  info - The default MBeanConstructorInfo derived by reflection. the description for the given MBeanConstructorInfo.



getDescription
protected String getDescription(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)(Code)
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns MBeanParameterInfo.getDescription param.getDescription() .
Parameters:
  ctor - The default MBeanConstructorInfo derived by reflection.
Parameters:
  param - The default MBeanParameterInfo derived by reflection.
Parameters:
  sequence - The sequence number of the parameter considered("0" for the first parameter, "1" for the second parameter,etc...). the description for the given MBeanParameterInfo.



getDescription
protected String getDescription(MBeanOperationInfo info)(Code)
Customization hook: Get the description that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns StandardMBean.getDescription(MBeanFeatureInfo)getDescription((MBeanFeatureInfo) info) .
Parameters:
  info - The default MBeanOperationInfo derived by reflection. the description for the given MBeanOperationInfo.



getDescription
protected String getDescription(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)(Code)
Customization hook: Get the description that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom description. The default implementation returns MBeanParameterInfo.getDescription param.getDescription() .
Parameters:
  op - The default MBeanOperationInfo derived by reflection.
Parameters:
  param - The default MBeanParameterInfo derived by reflection.
Parameters:
  sequence - The sequence number of the parameter considered("0" for the first parameter, "1" for the second parameter,etc...). the description for the given MBeanParameterInfo.



getImpact
protected int getImpact(MBeanOperationInfo info)(Code)
Customization hook: Get the impact flag of the operation that will be used in the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom impact flag. The default implementation returns MBeanOperationInfo.getImpact info.getImpact() .
Parameters:
  info - The default MBeanOperationInfo derived by reflection. the impact flag for the given MBeanOperationInfo.



getImplementation
public synchronized Object getImplementation()(Code)
Get the implementation of this MBean. The implementation of this MBean.
See Also:   StandardMBean.setImplementation



getImplementationClass
public synchronized Class getImplementationClass()(Code)
Get the class of the implementation of this MBean. The class of the implementation of this MBean.



getMBeanInfo
public MBeanInfo getMBeanInfo()(Code)



getMBeanInterface
final public synchronized Class getMBeanInterface()(Code)
Get the Management Interface of this MBean. The management interface of this MBean.



getMetaData
public MBeanMetaData getMetaData()(Code)



getNotifications
protected MBeanNotificationInfo[] getNotifications(MBeanInfo info)(Code)
Customization hook: Get the MBeanNotificationInfo[] that will be used in the MBeanInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom notifications.
Parameters:
  info - The default MBeanInfo derived by reflection. the MBeanNotificationInfo[] for the new MBeanInfo.



getParameterName
protected String getParameterName(MBeanConstructorInfo ctor, MBeanParameterInfo param, int sequence)(Code)
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanConstructorInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name. The default implementation returns MBeanParameterInfo.getName param.getNameSpace() .
Parameters:
  ctor - The default MBeanConstructorInfo derived by reflection.
Parameters:
  param - The default MBeanParameterInfo derived by reflection.
Parameters:
  sequence - The sequence number of the parameter considered("0" for the first parameter, "1" for the second parameter,etc...). the name for the given MBeanParameterInfo.



getParameterName
protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int sequence)(Code)
Customization hook: Get the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
Subclasses may redefine this method in order to supply their custom parameter name. The default implementation returns MBeanParameterInfo.getName param.getNameSpace() .
Parameters:
  op - The default MBeanOperationInfo derived by reflection.
Parameters:
  param - The default MBeanParameterInfo derived by reflection.
Parameters:
  sequence - The sequence number of the parameter considered("0" for the first parameter, "1" for the second parameter,etc...). the name to use for the given MBeanParameterInfo.



invoke
public Object invoke(String actionName, Object params, String signature) throws MBeanException, ReflectionException(Code)



postDeregister
public void postDeregister()(Code)



postRegister
public void postRegister(Boolean registrationDone)(Code)



preDeregister
public void preDeregister() throws Exception(Code)



preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)



setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException(Code)



setAttributes
public AttributeList setAttributes(AttributeList attributes)(Code)



setImplementation
public synchronized void setImplementation(Object implementation) throws NotCompliantMBeanException(Code)

Replace the implementation object wrapped in this object.


Parameters:
  implementation - The new implementation of this MBean.The implementation object must implement the MBeaninterface that was supplied when thisStandardMBean was constructed.
exception:
  IllegalArgumentException - if the givenimplementation is null.
exception:
  NotCompliantMBeanException - if the givenimplementation does not implement the MBeaninterface that was supplied at construction.
See Also:   StandardMBean.getImplementation



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.