Java Doc for BaseModelMBean.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » tomcat » util » modeler » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.tomcat.util.modeler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tomcat.util.modeler.BaseModelMBean

All known Subclasses:   org.apache.catalina.mbeans.StandardHostMBean,  org.apache.catalina.mbeans.StandardServiceMBean,  org.apache.catalina.mbeans.ContextResourceLinkMBean,  org.apache.catalina.mbeans.ContextEnvironmentMBean,  org.apache.catalina.mbeans.MemoryUserDatabaseMBean,  org.apache.catalina.mbeans.NamingResourcesMBean,  org.apache.catalina.mbeans.GroupMBean,  org.apache.catalina.mbeans.DefaultContextMBean,  org.apache.catalina.mbeans.StandardContextMBean,  org.apache.catalina.mbeans.StandardServerMBean,  org.apache.catalina.mbeans.StandardEngineMBean,  org.apache.catalina.mbeans.ClassNameMBean,  org.apache.catalina.mbeans.MBeanFactory,  org.apache.catalina.mbeans.UserMBean,  org.apache.catalina.mbeans.ContextResourceMBean,  org.apache.catalina.mbeans.RoleMBean,
BaseModelMBean
public class BaseModelMBean implements DynamicMBean,MBeanRegistration,ModelMBeanNotificationBroadcaster(Code)

Basic implementation of the DynamicMBean interface, which supports the minimal requirements of the interface contract.

This can be used directly to wrap an existing java bean, or inside an mlet or anywhere an MBean would be used. Limitations:

  • Only managed resources of type objectReference are supportd.
  • Caching of attribute values and operation results is not supported. All calls to invoke() are immediately executed.
  • Persistence of MBean attributes and operations is not supported.
  • All classes referenced as attribute types, operation parameters, or operation return values must be one of the following:
    • One of the Java primitive types (boolean, byte, char, double, float, integer, long, short). Corresponding value will be wrapped in the appropriate wrapper class automatically.
    • Operations that return no value should declare a return type of void.
  • Attribute caching is not supported

author:
   Craig R. McClanahan
author:
   Costin Manolache

Inner Class :static class MethodKey

Field Summary
final static  Object[]NO_ARGS_PARAM
    
final static  Class[]NO_ARGS_PARAM_SIG
    
protected  BaseNotificationBroadcasterattributeBroadcaster
     Notification broadcaster for attribute changes.
protected  BaseNotificationBroadcastergeneralBroadcaster
     Notification broadcaster for general notifications.
protected  ManagedBeanmanagedBean
     Metadata for the mbean instance.
protected  ObjectNameoname
    
protected  Objectresource
     The managed resource this MBean is associated with (if any).
protected  StringresourceType
    

Constructor Summary
protected  BaseModelMBean()
     Construct a ModelMBean with default ModelMBeanInfo information.

Method Summary
public  voidaddAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback)
     Add an attribute change notification event listener to this MBean.
public  voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
     Add a notification event listener to this MBean.
public  ObjectgetAttribute(String name)
     Obtain and return the value of a specific attribute of this MBean.
static  ClassgetAttributeClass(String signature)
    
public  AttributeListgetAttributes(String names)
     Obtain and return the values of several attributes of this MBean.
public  StringgetClassName()
    
public  ObjectNamegetJmxName()
    
public  MBeanInfogetMBeanInfo()
     Return the MBeanInfo object for this MBean.
public  ObjectgetManagedResource()
     Get the instance handle of the object against which we execute all methods in this ModelMBean management interface.
public  StringgetModelerType()
     Set the type of the mbean.
public  MBeanNotificationInfo[]getNotificationInfo()
     Return an MBeanNotificationInfo object describing the notifications sent by this MBean.
public  StringgetObjectName()
    
public  Objectinvoke(String name, Object params, String signature)
     Invoke a particular method on this MBean, and return any returned value.
public  voidpostDeregister()
    
public  voidpostRegister(Boolean registrationDone)
    
public  voidpreDeregister()
    
public  ObjectNamepreRegister(MBeanServer server, ObjectName name)
    
public  voidremoveAttributeChangeNotificationListener(NotificationListener listener, String name)
     Remove an attribute change notification event listener from this MBean.
public  voidremoveAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback)
     Remove an attribute change notification event listener from this MBean.
public  voidremoveNotificationListener(NotificationListener listener)
     Remove a notification event listener from this MBean.
public  voidremoveNotificationListener(NotificationListener listener, Object handback)
     Remove a notification event listener from this MBean.
public  voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
     Remove a notification event listener from this MBean.
public  voidsendAttributeChangeNotification(AttributeChangeNotification notification)
     Send an AttributeChangeNotification to all registered listeners.
public  voidsendAttributeChangeNotification(Attribute oldValue, Attribute newValue)
     Send an AttributeChangeNotification to all registered listeners.
public  voidsendNotification(Notification notification)
     Send a Notification to all registered listeners as a jmx.modelmbean.general notification.
public  voidsendNotification(String message)
     Send a Notification which contains the specified string as a jmx.modelmbean.generic notification.
public  voidsetAttribute(Attribute attribute)
     Set the value of a specific attribute of this MBean.
public  AttributeListsetAttributes(AttributeList attributes)
     Set the values of several attributes of this MBean.
public  voidsetManagedBean(ManagedBean managedBean)
    
public  voidsetManagedResource(Object resource, String type)
     Set the instance handle of the object against which we will execute all methods in this ModelMBean management interface. This method will detect and call "setModelMbean" method.
public  StringtoString()
    

Field Detail
NO_ARGS_PARAM
final static Object[] NO_ARGS_PARAM(Code)



NO_ARGS_PARAM_SIG
final static Class[] NO_ARGS_PARAM_SIG(Code)



attributeBroadcaster
protected BaseNotificationBroadcaster attributeBroadcaster(Code)
Notification broadcaster for attribute changes.



generalBroadcaster
protected BaseNotificationBroadcaster generalBroadcaster(Code)
Notification broadcaster for general notifications.



managedBean
protected ManagedBean managedBean(Code)
Metadata for the mbean instance.



oname
protected ObjectName oname(Code)



resource
protected Object resource(Code)
The managed resource this MBean is associated with (if any).



resourceType
protected String resourceType(Code)




Constructor Detail
BaseModelMBean
protected BaseModelMBean() throws MBeanException, RuntimeOperationsException(Code)
Construct a ModelMBean with default ModelMBeanInfo information.
exception:
  MBeanException - if the initializer of an objectthrows an exception
exception:
  RuntimeOperationsException - if an IllegalArgumentExceptionoccurs




Method Detail
addAttributeChangeNotificationListener
public void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback) throws IllegalArgumentException(Code)
Add an attribute change notification event listener to this MBean.
Parameters:
  listener - Listener that will receive event notifications
Parameters:
  name - Name of the attribute of interest, or nullto indicate interest in all attributes
Parameters:
  handback - Handback object to be sent along with eventnotifications
exception:
  IllegalArgumentException - if the listener parameter is null



addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException(Code)
Add a notification event listener to this MBean.
Parameters:
  listener - Listener that will receive event notifications
Parameters:
  filter - Filter object used to filter event notificationsactually delivered, or null for no filtering
Parameters:
  handback - Handback object to be sent along with eventnotifications
exception:
  IllegalArgumentException - if the listener parameter is null



getAttribute
public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)
Obtain and return the value of a specific attribute of this MBean.
Parameters:
  name - Name of the requested attribute
exception:
  AttributeNotFoundException - if this attribute is notsupported by this MBean
exception:
  MBeanException - if the initializer of an objectthrows an exception
exception:
  ReflectionException - if a Java reflection exceptionoccurs when invoking the getter



getAttributeClass
static Class getAttributeClass(String signature) throws ReflectionException(Code)



getAttributes
public AttributeList getAttributes(String names)(Code)
Obtain and return the values of several attributes of this MBean.
Parameters:
  names - Names of the requested attributes



getClassName
public String getClassName()(Code)



getJmxName
public ObjectName getJmxName()(Code)



getMBeanInfo
public MBeanInfo getMBeanInfo()(Code)
Return the MBeanInfo object for this MBean.



getManagedResource
public Object getManagedResource() throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException, RuntimeOperationsException(Code)
Get the instance handle of the object against which we execute all methods in this ModelMBean management interface.
exception:
  InstanceNotFoundException - if the managed resource objectcannot be found
exception:
  MBeanException - if the initializer of the object throwsan exception
exception:
  RuntimeOperationsException - if the managed resource or theresource type is null or invalid



getModelerType
public String getModelerType()(Code)
Set the type of the mbean. This is used as a key to locate the description in the Registry.



getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()(Code)
Return an MBeanNotificationInfo object describing the notifications sent by this MBean.



getObjectName
public String getObjectName()(Code)



invoke
public Object invoke(String name, Object params, String signature) throws MBeanException, ReflectionException(Code)
Invoke a particular method on this MBean, and return any returned value.

IMPLEMENTATION NOTE - This implementation will attempt to invoke this method on the MBean itself, or (if not available) on the managed resource object associated with this MBean.


Parameters:
  name - Name of the operation to be invoked
Parameters:
  params - Array containing the method parameters of this operation
Parameters:
  signature - Array containing the class names representingthe signature of this operation
exception:
  MBeanException - if the initializer of an objectthrows an exception
exception:
  ReflectioNException - if a Java reflection exceptionoccurs when invoking a method



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)
Is the specified ModelMBeanInfo instance valid?

IMPLEMENTATION NOTE - This implementation does not check anything, but this method can be overridden as required.


Parameters:
  info - The ModelMBeanInfo object to check



removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws ListenerNotFoundException(Code)
Remove an attribute change notification event listener from this MBean.
Parameters:
  listener - The listener to be removed
Parameters:
  name - The attribute name for which no more events are required
exception:
  ListenerNotFoundException - if this listener is notregistered in the MBean



removeAttributeChangeNotificationListener
public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws ListenerNotFoundException(Code)
Remove an attribute change notification event listener from this MBean.
Parameters:
  listener - The listener to be removed
Parameters:
  attributeName - The attribute name for which no more events are required
Parameters:
  handback - Handback object to be sent along with eventnotifications
exception:
  ListenerNotFoundException - if this listener is notregistered in the MBean



removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)
Remove a notification event listener from this MBean.
Parameters:
  listener - The listener to be removed (any and all registrationsfor this listener will be eliminated)
exception:
  ListenerNotFoundException - if this listener is notregistered in the MBean



removeNotificationListener
public void removeNotificationListener(NotificationListener listener, Object handback) throws ListenerNotFoundException(Code)
Remove a notification event listener from this MBean.
Parameters:
  listener - The listener to be removed (any and all registrationsfor this listener will be eliminated)
Parameters:
  handback - Handback object to be sent along with eventnotifications
exception:
  ListenerNotFoundException - if this listener is notregistered in the MBean



removeNotificationListener
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)
Remove a notification event listener from this MBean.
Parameters:
  listener - The listener to be removed (any and all registrationsfor this listener will be eliminated)
Parameters:
  filter - Filter object used to filter event notificationsactually delivered, or null for no filtering
Parameters:
  handback - Handback object to be sent along with eventnotifications
exception:
  ListenerNotFoundException - if this listener is notregistered in the MBean



sendAttributeChangeNotification
public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException, RuntimeOperationsException(Code)
Send an AttributeChangeNotification to all registered listeners.
Parameters:
  notification - The AttributeChangeNotificationthat will be passed
exception:
  MBeanException - if an object initializer throws anexception
exception:
  RuntimeOperationsException - wraps IllegalArgumentExceptionwhen the specified notification is null or invalid



sendAttributeChangeNotification
public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException(Code)
Send an AttributeChangeNotification to all registered listeners.
Parameters:
  oldValue - The original value of the Attribute
Parameters:
  newValue - The new value of the Attribute
exception:
  MBeanException - if an object initializer throws anexception
exception:
  RuntimeOperationsException - wraps IllegalArgumentExceptionwhen the specified notification is null or invalid



sendNotification
public void sendNotification(Notification notification) throws MBeanException, RuntimeOperationsException(Code)
Send a Notification to all registered listeners as a jmx.modelmbean.general notification.
Parameters:
  notification - The Notification that will be passed
exception:
  MBeanException - if an object initializer throws anexception
exception:
  RuntimeOperationsException - wraps IllegalArgumentExceptionwhen the specified notification is null or invalid



sendNotification
public void sendNotification(String message) throws MBeanException, RuntimeOperationsException(Code)
Send a Notification which contains the specified string as a jmx.modelmbean.generic notification.
Parameters:
  message - The message string to be passed
exception:
  MBeanException - if an object initializer throws anexception
exception:
  RuntimeOperationsException - wraps IllegalArgumentExceptionwhen the specified notification is null or invalid



setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)
Set the value of a specific attribute of this MBean.
Parameters:
  attribute - The identification of the attribute to be setand the new value
exception:
  AttributeNotFoundException - if this attribute is notsupported by this MBean
exception:
  MBeanException - if the initializer of an objectthrows an exception
exception:
  ReflectionException - if a Java reflection exceptionoccurs when invoking the getter



setAttributes
public AttributeList setAttributes(AttributeList attributes)(Code)
Set the values of several attributes of this MBean.
Parameters:
  attributes - THe names and values to be set The list of attributes that were set and their new values



setManagedBean
public void setManagedBean(ManagedBean managedBean)(Code)



setManagedResource
public void setManagedResource(Object resource, String type) throws InstanceNotFoundException, MBeanException, RuntimeOperationsException(Code)
Set the instance handle of the object against which we will execute all methods in this ModelMBean management interface. This method will detect and call "setModelMbean" method. A resource can implement this method to get a reference to the model mbean. The reference can be used to send notification and access the registry. The caller can provide the mbean instance or the object name to the resource, if needed.
Parameters:
  resource - The resource object to be managed
Parameters:
  type - The type of reference for the managed resource("ObjectReference", "Handle", "IOR", "EJBHandle", or"RMIReference")
exception:
  InstanceNotFoundException - if the managed resource objectcannot be found
exception:
  InvalidTargetObjectTypeException - if this ModelMBean isasked to handle a reference type it cannot deal with
exception:
  MBeanException - if the initializer of the object throwsan exception
exception:
  RuntimeOperationsException - if the managed resource or theresource type is null or invalid



toString
public String toString()(Code)



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.