Java EE 5 SDK

com.sun.appserv.management.util.jmx
Class MBeanServerConnection_Hook

java.lang.Object
  extended by com.sun.appserv.management.util.jmx.MBeanServerConnection_Hook
All Implemented Interfaces:
MBeanServerConnection
Direct Known Subclasses:
MBeanServerConnection_Debug, MBeanServerConnection_Pattern, MBeanServerConnection_Perf

public class MBeanServerConnection_Hook
extends Object
implements MBeanServerConnection

This class wraps an MBeanServerConnection and provides hooks on each method call via its Hook interface. Typical used would be for a subclass to


Nested Class Summary
static interface MBeanServerConnection_Hook.Hook
          Prior to a method being called, preHook() is called; the 2 variants correspond to either no arguments or 1 or more arguments.
static class MBeanServerConnection_Hook.HookImpl
           
 
Field Summary
static String ADD_NOTIFICATION_LISTENER
           
static String CREATE_MBEAN
           
static String GET_ATTRIBUTE
           
static String GET_ATTRIBUTES
           
static String GET_DEFAULT_DOMAIN
           
static String GET_DOMAINS
           
static String GET_MBEAN_COUNT
           
static String GET_MBEAN_INFO
           
static String GET_OBJECT_INSTANCE
           
static String INVOKE
           
static String IS_INSTANCE_OF
           
static String IS_REGISTERED
           
static String QUERY_MBEANS
           
static String QUERY_NAMES
           
static String REGISTER_MBEAN
           
static String REMOVE_NOTIFICATION_LISTENER
           
static String SET_ATTRIBUTE
           
static String SET_ATTRIBUTES
           
static String UNREGISTER_MBEAN
           
 
Constructor Summary
MBeanServerConnection_Hook(MBeanServerConnection conn)
           
 
Method Summary
 void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
           
 void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
           
 ObjectInstance createMBean(String className, ObjectName name)
           
 ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
           
 Object getAttribute(ObjectName name, String attribute)
           
 AttributeList getAttributes(ObjectName name, String[] attributes)
           
 String getDefaultDomain()
           
 String[] getDomains()
           
 Integer getMBeanCount()
           
 MBeanInfo getMBeanInfo(ObjectName name)
           
 ObjectInstance getObjectInstance(ObjectName name)
           
 Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
           
 boolean isInstanceOf(ObjectName name, String className)
           
 boolean isRegistered(ObjectName name)
           
 Set<ObjectName> queryMBeans(ObjectName name, QueryExp query)
           
 Set<ObjectName> queryNames(ObjectName name, QueryExp query)
           
 void removeNotificationListener(ObjectName name, NotificationListener listener)
           
 void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
           
 void removeNotificationListener(ObjectName name, ObjectName listener)
           
 void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
           
 void setAttribute(ObjectName name, Attribute attribute)
           
 AttributeList setAttributes(ObjectName name, AttributeList attributes)
           
 void unregisterMBean(ObjectName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_MBEAN

public static final String CREATE_MBEAN
See Also:
Constant Field Values

UNREGISTER_MBEAN

public static final String UNREGISTER_MBEAN
See Also:
Constant Field Values

REGISTER_MBEAN

public static final String REGISTER_MBEAN
See Also:
Constant Field Values

GET_OBJECT_INSTANCE

public static final String GET_OBJECT_INSTANCE
See Also:
Constant Field Values

QUERY_MBEANS

public static final String QUERY_MBEANS
See Also:
Constant Field Values

QUERY_NAMES

public static final String QUERY_NAMES
See Also:
Constant Field Values

GET_DOMAINS

public static final String GET_DOMAINS
See Also:
Constant Field Values

IS_REGISTERED

public static final String IS_REGISTERED
See Also:
Constant Field Values

GET_MBEAN_COUNT

public static final String GET_MBEAN_COUNT
See Also:
Constant Field Values

GET_ATTRIBUTE

public static final String GET_ATTRIBUTE
See Also:
Constant Field Values

GET_ATTRIBUTES

public static final String GET_ATTRIBUTES
See Also:
Constant Field Values

SET_ATTRIBUTE

public static final String SET_ATTRIBUTE
See Also:
Constant Field Values

SET_ATTRIBUTES

public static final String SET_ATTRIBUTES
See Also:
Constant Field Values

INVOKE

public static final String INVOKE
See Also:
Constant Field Values

GET_DEFAULT_DOMAIN

public static final String GET_DEFAULT_DOMAIN
See Also:
Constant Field Values

ADD_NOTIFICATION_LISTENER

public static final String ADD_NOTIFICATION_LISTENER
See Also:
Constant Field Values

REMOVE_NOTIFICATION_LISTENER

public static final String REMOVE_NOTIFICATION_LISTENER
See Also:
Constant Field Values

GET_MBEAN_INFO

public static final String GET_MBEAN_INFO
See Also:
Constant Field Values

IS_INSTANCE_OF

public static final String IS_INSTANCE_OF
See Also:
Constant Field Values
Constructor Detail

MBeanServerConnection_Hook

public MBeanServerConnection_Hook(MBeanServerConnection conn)
Method Detail

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  IOException
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
IOException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException,
                                  IOException
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
IOException

unregisterMBean

public void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException,
                            IOException
Specified by:
unregisterMBean in interface MBeanServerConnection
Throws:
InstanceNotFoundException
MBeanRegistrationException
IOException

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException,
                                        IOException
Specified by:
getObjectInstance in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IOException

queryMBeans

public Set<ObjectName> queryMBeans(ObjectName name,
                                   QueryExp query)
                            throws IOException
Specified by:
queryMBeans in interface MBeanServerConnection
Throws:
IOException

queryNames

public Set<ObjectName> queryNames(ObjectName name,
                                  QueryExp query)
                           throws IOException
Specified by:
queryNames in interface MBeanServerConnection
Throws:
IOException

isRegistered

public boolean isRegistered(ObjectName name)
                     throws IOException
Specified by:
isRegistered in interface MBeanServerConnection
Throws:
IOException

getMBeanCount

public Integer getMBeanCount()
                      throws IOException
Specified by:
getMBeanCount in interface MBeanServerConnection
Throws:
IOException

getAttribute

public Object getAttribute(ObjectName name,
                           String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException,
                           IOException
Specified by:
getAttribute in interface MBeanServerConnection
Throws:
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
IOException

getAttributes

public AttributeList getAttributes(ObjectName name,
                                   String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException
Specified by:
getAttributes in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ReflectionException
IOException

setAttribute

public void setAttribute(ObjectName name,
                         Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException,
                         IOException
Specified by:
setAttribute in interface MBeanServerConnection
Throws:
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
IOException

setAttributes

public AttributeList setAttributes(ObjectName name,
                                   AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   IOException
Specified by:
setAttributes in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ReflectionException
IOException

invoke

public Object invoke(ObjectName name,
                     String operationName,
                     Object[] params,
                     String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     IOException
Specified by:
invoke in interface MBeanServerConnection
Throws:
InstanceNotFoundException
MBeanException
ReflectionException
IOException

getDefaultDomain

public String getDefaultDomain()
                        throws IOException
Specified by:
getDefaultDomain in interface MBeanServerConnection
Throws:
IOException

getDomains

public String[] getDomains()
                    throws IOException
Specified by:
getDomains in interface MBeanServerConnection
Throws:
IOException

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws InstanceNotFoundException,
                                    IOException
Specified by:
addNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IOException

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    ObjectName listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws InstanceNotFoundException,
                                    IOException
Specified by:
addNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException
IOException

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException,
                              IOException
Specified by:
getMBeanInfo in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IntrospectionException
ReflectionException
IOException

isInstanceOf

public boolean isInstanceOf(ObjectName name,
                            String className)
                     throws InstanceNotFoundException,
                            IOException
Specified by:
isInstanceOf in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IOException

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.