Top Fields Constructors Methods
org.glassfish.gmbal.impl

public Class MBeanImpl

extends NotificationBroadcasterSupport
implements FacetAccessor, GmbalMBean
Class Inheritance
All Implemented Interfaces
org.glassfish.gmbal.GmbalMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, org.glassfish.pfl.basic.facet.FacetAccessor
Imports
java.lang.reflect.Field, .Method, java.util.Arrays, .Collection, .Collections, .Map, .HashMap, .HashSet, .Set, javax.management.Attribute, .AttributeList, .InstanceAlreadyExistsException, .InstanceNotFoundException, .MBeanException, .InvalidAttributeValueException, .AttributeNotFoundException, .MBeanRegistrationException, .NotCompliantMBeanException, .ReflectionException, .MBeanInfo, .NotificationBroadcasterSupport, .MBeanNotificationInfo, .AttributeChangeNotification, .MBeanServer, .ObjectName, java.security.AccessController, .PrivilegedExceptionAction, .PrivilegedActionException, org.glassfish.external.amx.AMX, org.glassfish.gmbal.GmbalMBean, org.glassfish.pfl.basic.facet.FacetAccessor, .FacetAccessorImpl, org.glassfish.pfl.basic.logex.OperationTracer

Field Summary

Modifier and TypeField and Description
private static final MBeanNotificationInfo[]
private Map<String, Map<String, MBeanImpl>>
private FacetAccessor
facetAccessorDelegate

Code for dynamic inheritance support: use invoke with reflection to call dynamically inherited classes.

private String
private ObjectName
private MBeanImpl
private String
private boolean
private MBeanServer
private final MBeanSkeleton
private final Set<String>
private boolean
private Object
private final String

Constructor Summary

AccessConstructor and Description
public
MBeanImpl(final MBeanSkeleton skel, final Object obj, final MBeanServer server, final String type)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public <T> void
addFacet(T obj)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.addFacet.

Add a facet to the object.

public synchronized Map<String, Map<String, MBeanImpl>>
public synchronized boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public <T> T
facet(Class<T> cls)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.facet.

Access the Facet of Class T from the object.

public Collection<Object>
facets()

Implements org.glassfish.pfl.basic.facet.FacetAccessor.facets.

Return a list of all facets on this object.

public Object
get(Field field)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.get.

Fetch the value of the field from whichever facet contains the field.

public Object
getAttribute(String attribute)

Implements javax.management.DynamicMBean.getAttribute.

Obtain the value of a specific attribute of the Dynamic MBean.

public AttributeList
getAttributes(String[] attributes)

Implements javax.management.DynamicMBean.getAttributes.

Get the values of several attributes of the Dynamic MBean.

public MBeanInfo
getMBeanInfo()

Implements javax.management.DynamicMBean.getMBeanInfo.

Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.

public MBeanNotificationInfo[]
getNotificationInfo()

Overrides javax.management.NotificationBroadcasterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

public synchronized String
getParentPathPart(String rootParentPrefix)

public synchronized int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public Object
invoke(String actionName, Object[] params, String[] signature)

Implements javax.management.DynamicMBean.invoke.

Allows an action to be invoked on the Dynamic MBean.

public Object
invoke(Method method, Object... args)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.invoke.

Invoke method on the appropriate facet of this object, that is, on the facet corresponding to method.getDeclaringClass.

public synchronized String
name()

public synchronized void
name(String str)

public synchronized ObjectName
public synchronized void
public synchronized MBeanImpl
public synchronized void
parent(MBeanImpl entity)

public synchronized void
public synchronized void
public void
removeFacet(Class<?> cls)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.removeFacet.

Remove the facet (if any) of the given type.

private synchronized String
private void
public void
public void
setAttribute(Attribute attribute)

Implements javax.management.DynamicMBean.setAttribute.

Set the value of a specific attribute of the Dynamic MBean.

public AttributeList
setAttributes(AttributeList attributes)

Implements javax.management.DynamicMBean.setAttributes.

Sets the values of several attributes of the Dynamic MBean.

public MBeanSkeleton
public synchronized boolean
public synchronized void
suspended(boolean flag)

public Object
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
type()

public synchronized void
Inherited from javax.management.NotificationBroadcasterSupport:
addNotificationListenerhandleNotificationremoveNotificationListenerremoveNotificationListenersendNotification

Field Detail

ATTRIBUTE_CHANGE_NOTIFICATION_INFOback to summary
private static final MBeanNotificationInfo[] ATTRIBUTE_CHANGE_NOTIFICATION_INFO
childrenback to summary
private Map<String, Map<String, MBeanImpl>> children
facetAccessorDelegateback to summary
private FacetAccessor facetAccessorDelegate

Code for dynamic inheritance support: use invoke with reflection to call dynamically inherited classes.

nameback to summary
private String name
onameback to summary
private ObjectName oname
parentback to summary
private MBeanImpl parent
parentPathForObjectNameback to summary
private String parentPathForObjectName
registeredback to summary
private boolean registered
serverback to summary
private MBeanServer server
skelback to summary
private final MBeanSkeleton skel
subTypesback to summary
private final Set<String> subTypes
suspendedback to summary
private boolean suspended
targetback to summary
private Object target
typeback to summary
private final String type

Constructor Detail

MBeanImplback to summary
public MBeanImpl(final MBeanSkeleton skel, final Object obj, final MBeanServer server, final String type)

Method Detail

addChildback to summary
public synchronized void addChild(MBeanImpl child)
addFacetback to summary
public <T> void addFacet(T obj)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.addFacet.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.addFacet.

Add a facet to the object. The type T must not already be available as a facet.

childrenback to summary
public synchronized Map<String, Map<String, MBeanImpl>> children()
equalsback to summary
public synchronized boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
facetback to summary
public <T> T facet(Class<T> cls)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.facet.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.facet.

Access the Facet of Class T from the object.

facetsback to summary
public Collection<Object> facets()

Implements org.glassfish.pfl.basic.facet.FacetAccessor.facets.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.facets.

Return a list of all facets on this object.

getback to summary
public Object get(Field field)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.get.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.get.

Fetch the value of the field from whichever facet contains the field. Read-only because that's all that the intended application needs.

getAttributeback to summary
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException

Implements javax.management.DynamicMBean.getAttribute.

Doc from javax.management.DynamicMBean.getAttribute.

Obtain the value of a specific attribute of the Dynamic MBean.

Exceptions
AttributeNotFoundException:
if specified attribute does not exist or cannot be retrieved
MBeanException:
Wraps a java.lang.Exception thrown by the MBean's getter.
ReflectionException:
Wraps a java.lang.Exception thrown while trying to invoke the getter.
getAttributesback to summary
public AttributeList getAttributes(String[] attributes)

Implements javax.management.DynamicMBean.getAttributes.

Doc from javax.management.DynamicMBean.getAttributes.

Get the values of several attributes of the Dynamic MBean.

getMBeanInfoback to summary
public MBeanInfo getMBeanInfo()

Implements javax.management.DynamicMBean.getMBeanInfo.

Doc from javax.management.DynamicMBean.getMBeanInfo.

Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.

getNotificationInfoback to summary
public MBeanNotificationInfo[] getNotificationInfo()

Overrides javax.management.NotificationBroadcasterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Doc from javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.

Annotations
@Override
getParentPathPartback to summary
public synchronized String getParentPathPart(String rootParentPrefix)
hashCodeback to summary
public synchronized int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
invokeback to summary
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException

Implements javax.management.DynamicMBean.invoke.

Doc from javax.management.DynamicMBean.invoke.

Allows an action to be invoked on the Dynamic MBean.

Exceptions
MBeanException:
Wraps a java.lang.Exception thrown by the MBean's invoked method.
ReflectionException:
Wraps a java.lang.Exception thrown while trying to invoke the method
invokeback to summary
public Object invoke(Method method, Object... args)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.invoke.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.invoke.

Invoke method on the appropriate facet of this object, that is, on the facet corresponding to method.getDeclaringClass.

nameback to summary
public synchronized String name()
nameback to summary
public synchronized void name(String str)
objectNameback to summary
public synchronized ObjectName objectName()
objectNameback to summary
public synchronized void objectName(ObjectName oname)
parentback to summary
public synchronized MBeanImpl parent()
parentback to summary
public synchronized void parent(MBeanImpl entity)
registerback to summary
public synchronized void register() throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
removeChildback to summary
public synchronized void removeChild(MBeanImpl child)
removeFacetback to summary
public void removeFacet(Class<?> cls)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.removeFacet.

Doc from org.glassfish.pfl.basic.facet.FacetAccessor.removeFacet.

Remove the facet (if any) of the given type.

restNameback to summary
private synchronized String restName()
restNameHelperback to summary
private void restNameHelper(StringBuilder sb)
setback to summary
public void set(Field field, Object value)

Implements org.glassfish.pfl.basic.facet.FacetAccessor.set.

setAttributeback to summary
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException

Implements javax.management.DynamicMBean.setAttribute.

Doc from javax.management.DynamicMBean.setAttribute.

Set the value of a specific attribute of the Dynamic MBean.

Exceptions
AttributeNotFoundException:
if specified attribute does not exist or cannot be retrieved
InvalidAttributeValueException:
if value specified is not valid for the attribute
MBeanException:
Wraps a java.lang.Exception thrown by the MBean's setter.
ReflectionException:
Wraps a java.lang.Exception thrown while trying to invoke the MBean's setter.
setAttributesback to summary
public AttributeList setAttributes(AttributeList attributes)

Implements javax.management.DynamicMBean.setAttributes.

Doc from javax.management.DynamicMBean.setAttributes.

Sets the values of several attributes of the Dynamic MBean.

skeletonback to summary
public MBeanSkeleton skeleton()
suspendedback to summary
public synchronized boolean suspended()
suspendedback to summary
public synchronized void suspended(boolean flag)
targetback to summary
public Object target()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
typeback to summary
public String type()
unregisterback to summary
public synchronized void unregister() throws InstanceNotFoundException, MBeanRegistrationException