org.glassfish.gmbal.impl
Class MBeanImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.glassfish.gmbal.impl.MBeanImpl
All Implemented Interfaces:
DynamicMBean, NotificationBroadcaster, NotificationEmitter, FacetAccessor, GmbalMBean

public class MBeanImpl
extends NotificationBroadcasterSupport
implements FacetAccessor, GmbalMBean


Constructor Summary
MBeanImpl(MBeanSkeleton skel, Object obj, MBeanServer server, String type)
           
 
Method Summary
 void addChild(MBeanImpl child)
           
<T> void
addFacet(T obj)
          Add a facet to the object.
 Map<String,Map<String,MBeanImpl>> children()
           
 boolean equals(Object obj)
           
<T> T
facet(Class<T> cls, boolean debug)
          Access the Facet of Class T from the object.
 Collection<Object> facets()
          Return a list of all facets on this object.
 Object get(Field field, boolean debug)
          Fetch the value of the field from whichever facet contains the field.
 Object getAttribute(String attribute)
           
 AttributeList getAttributes(String[] attributes)
           
 MBeanInfo getMBeanInfo()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 String getParentPathPart(String rootParentPrefix)
           
 int hashCode()
           
 Object invoke(Method method, boolean debug, Object... args)
          Invoke method on the appropriate facet of this object, that is, on the facet corresponding to method.getDeclaringClass.
 Object invoke(String actionName, Object[] params, String[] signature)
           
 String name()
           
 void name(String str)
           
 ObjectName objectName()
           
 void objectName(ObjectName oname)
           
 MBeanImpl parent()
           
 void parent(MBeanImpl entity)
           
 void register()
           
 void removeChild(MBeanImpl child)
           
 void removeFacet(Class<?> cls)
          Remove the facet (if any) of the given type.
 void set(Field field, Object value, boolean debug)
           
 void setAttribute(Attribute attribute)
           
 AttributeList setAttributes(AttributeList attributes)
           
 MBeanSkeleton skeleton()
           
 boolean suspended()
           
 void suspended(boolean flag)
           
 Object target()
           
 String toString()
           
 String type()
           
 void unregister()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, removeNotificationListener
 

Constructor Detail

MBeanImpl

public MBeanImpl(MBeanSkeleton skel,
                 Object obj,
                 MBeanServer server,
                 String type)
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

skeleton

public MBeanSkeleton skeleton()

type

public String type()

target

public Object target()

name

public String name()

name

public void name(String str)

objectName

public ObjectName objectName()

objectName

public void objectName(ObjectName oname)

parent

public MBeanImpl parent()

parent

public void parent(MBeanImpl entity)

children

public Map<String,Map<String,MBeanImpl>> children()

addChild

public void addChild(MBeanImpl child)

removeChild

public void removeChild(MBeanImpl child)

getParentPathPart

public String getParentPathPart(String rootParentPrefix)

suspended

public boolean suspended()

suspended

public void suspended(boolean flag)

register

public void register()
              throws InstanceAlreadyExistsException,
                     MBeanRegistrationException,
                     NotCompliantMBeanException
Throws:
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException

unregister

public void unregister()
                throws InstanceNotFoundException,
                       MBeanRegistrationException
Throws:
InstanceNotFoundException
MBeanRegistrationException

getAttribute

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

setAttribute

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

getAttributes

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

setAttributes

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

invoke

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

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class NotificationBroadcasterSupport

getMBeanInfo

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

facet

public <T> T facet(Class<T> cls,
                   boolean debug)
Description copied from interface: FacetAccessor
Access the Facet of Class T from the object.

Specified by:
facet in interface FacetAccessor
Type Parameters:
T - The Type (as a Class) of the Facet.
Parameters:
cls - The class of the facet.
Returns:
Instance of cls for this facet. Null if no such facet is available.

addFacet

public <T> void addFacet(T obj)
Description copied from interface: FacetAccessor
Add a facet to the object. The type T must not already be available as a facet.

Specified by:
addFacet in interface FacetAccessor

removeFacet

public void removeFacet(Class<?> cls)
Description copied from interface: FacetAccessor
Remove the facet (if any) of the given type.

Specified by:
removeFacet in interface FacetAccessor
Parameters:
cls - The class of the facet to remove.

invoke

public Object invoke(Method method,
                     boolean debug,
                     Object... args)
Description copied from interface: FacetAccessor
Invoke method on the appropriate facet of this object, that is, on the facet corresponding to method.getDeclaringClass.

Specified by:
invoke in interface FacetAccessor
Parameters:
method - The method to invoke.
args - Arguments to the method.
Returns:
restult of the invoke call.

facets

public Collection<Object> facets()
Description copied from interface: FacetAccessor
Return a list of all facets on this object.

Specified by:
facets in interface FacetAccessor
Returns:
Collection of all facets.

get

public Object get(Field field,
                  boolean debug)
Description copied from interface: FacetAccessor
Fetch the value of the field from whichever facet contains the field. Read-only because that's all that the intended application needs.

Specified by:
get in interface FacetAccessor
Parameters:
field - The field to access
debug - True if debugging trace output is desired
Returns:
The value of the field

set

public void set(Field field,
                Object value,
                boolean debug)
Specified by:
set in interface FacetAccessor


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.