|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.appserv.management.util.jmx.JMXUtil
public final class JMXUtil
Field Summary | |
---|---|
static String |
GET
|
static String |
IS
|
static String |
MBEAN_SERVER_DELEGATE
|
static String |
MBEAN_SERVER_ID_ATTRIBUTE_NAME
|
static String |
SET
|
static String |
WILD_ALL
The wilcard property at the end of an ObjectName which indicates that all properties should be matched. |
static String |
WILD_PROP
The wilcard property at the end of an ObjectName which indicates that it's an ObjectName pattern. |
Method Summary | ||
---|---|---|
static MBeanInfo |
addNotificationInfos(MBeanInfo origInfo,
MBeanNotificationInfo[] notifs)
Add MBeanNotificationInfo into the MBeanInfo. |
|
static Map<String,MBeanAttributeInfo> |
attributeInfosToMap(MBeanAttributeInfo[] attrInfos)
Convert an MBeanAttributeInfo[] to a Map where the keys are the Attribute names, and the values are MBeanAttributeInfo. |
|
static Map<String,Attribute> |
attributeListToAttributeMap(AttributeList attrs)
Convert an AttributeList to a Map where the keys are the Attribute names, and the values are Attribute. |
|
static Map<String,String> |
attributeListToStringMap(AttributeList attrs)
Convert an AttributeList to a Map where the keys are the Attribute names, and the values are the Attribute values. |
|
static Map<String,Object> |
attributeListToValueMap(AttributeList attrs)
Convert an AttributeList to a Map where the keys are the Attribute names, and the values are the Attribute values. |
|
static Notification |
cloneNotification(Notification in,
Object source)
|
|
static String |
concatenateProps(String props1,
String props2)
|
|
static String |
concatenateProps(String props1,
String props2,
String props3)
|
|
static boolean |
domainMatches(String defaultDomain,
ObjectName pattern,
ObjectName candidate)
|
|
static MBeanAttributeInfo[] |
filterAttributeInfos(MBeanAttributeInfo[] infos,
AttributeFilter filter)
|
|
static Set<ObjectName> |
findByProperty(Set<ObjectName> objectNames,
String propertyKey,
String propertyValue)
Find all ObjectName(s) that contains the associated key and value |
|
static Set<MBeanFeatureInfo> |
findInfoByName(MBeanFeatureInfo[] infos,
String name)
Find a feature by name (attribute name, operation name, etc) and return all matches. |
|
static String |
findKey(Set<String> candidateKeys,
ObjectName objectName)
Find the first key that is present in the ObjectName |
|
static int |
findMBeanOperationInfo(MBeanInfo info,
String methodName,
String[] parameterTypes)
Find the index within the MBeanOperationInfo[] of the specified method with the specified parameter types. |
|
static MBeanOperationInfo |
findOperation(MBeanOperationInfo[] operations,
String operationName,
String[] types)
|
|
static MBeanOperationInfo[] |
findOperations(MBeanOperationInfo[] operations,
String operationName)
|
|
static ArrayList<MBeanAttributeInfo> |
generateAttributeInfos(Collection<Method> methodSet,
boolean read,
boolean write)
|
|
static MBeanAttributeInfo[] |
generateMBeanAttributeInfos(Collection<Method> getterSetters,
Collection<Method> getters,
Collection<Method> setters)
|
|
static MBeanOperationInfo[] |
generateMBeanOperationInfos(Collection<Method> methodSet)
|
|
static MBeanParameterInfo[] |
generateSignature(Class[] sig)
|
|
static String[] |
getAllAttributeNames(MBeanServerConnection conn,
ObjectName objectName)
|
|
static MBeanAttributeInfo[] |
getAttributeInfos(MBeanServerConnection conn,
ObjectName objectName)
|
|
static String |
getAttributeName(Method method)
|
|
static String[] |
getAttributeNames(MBeanAttributeInfo[] infos)
Get a String[] of Attribute names. |
|
static AttributeList |
getAttributesRobust(MBeanServerConnection conn,
ObjectName objectName,
String[] attrNames,
Set<String> problemNames)
Get the Attributes using getAttributes() if possible, but if exceptions are encountered, attempt to get them one-by-one. |
|
static String[] |
getKeyProperty(String key,
ObjectName[] objectNames)
|
|
static String[] |
getKeyProperty(String key,
Set<ObjectName> objectNameSet)
|
|
static Set<String> |
getKeyPropertySet(String key,
Set<ObjectName> objectNameSet)
|
|
static MBeanAttributeInfo |
getMBeanAttributeInfo(MBeanAttributeInfo[] infos,
String attrName)
|
|
static MBeanAttributeInfo |
getMBeanAttributeInfo(MBeanInfo mbeanInfo,
String attrName)
|
|
static ObjectName |
getMBeanServerDelegateObjectName()
|
|
static String |
getMBeanServerID(MBeanServerConnection conn)
|
|
static String |
getProp(ObjectName objectName,
String key)
|
|
static String |
getProps(ObjectName objectName,
Set<String> propKeys)
|
|
static String |
getProps(ObjectName objectName,
Set<String> propKeys,
boolean ignoreMissing)
|
|
static String[] |
getSignature(MBeanParameterInfo[] infos)
|
|
static
|
getUserDataMapString_Serializable(Notification notif)
Get a Map from the user data field of a Notification. |
|
static MBeanInfo |
interfaceToMBeanInfo(Class theInterface)
|
|
static boolean |
isGetAttribute(Method m)
|
|
static boolean |
isGetAttributes(Method m)
|
|
static boolean |
isGetter(MBeanOperationInfo info)
|
|
static boolean |
isGetter(Method method)
Return true if the method is of the form isXyz() or getXyz() (no parameters) |
|
static boolean |
isIs(Method method)
|
|
static boolean |
isIsOrGetter(Method method)
Return true if the method is of the form isXyz() or getXyz() (no parameters) |
|
static boolean |
isSetAttribute(Method m)
|
|
static boolean |
isSetAttributes(Method m)
|
|
static boolean |
isSetter(Method method)
|
|
static void |
listenToMBeanServerDelegate(MBeanServerConnection conn,
NotificationListener listener,
NotificationFilter filter,
Object handback)
|
|
static String |
makeProp(String name,
String value)
|
|
static AttributeList |
mapToAttributeList(Map<String,Object> m)
Convert an Map to an Attribute list where the keys are the Attribute names, and the values are objects. |
|
static String |
mapToProps(Map<String,String> propsMap)
|
|
static boolean |
matchesPattern(String defaultDomain,
ObjectName pattern,
ObjectName candidate)
|
|
static MBeanAttributeInfo[] |
mergeMBeanAttributeInfos(MBeanAttributeInfo[] infos1,
MBeanAttributeInfo[] infos2)
Merge two MBeanAttributeInfo[]. |
|
static MBeanConstructorInfo[] |
mergeMBeanConstructorInfos(MBeanConstructorInfo[] infos1,
MBeanConstructorInfo[] infos2)
Merge two MBeanOperationInfo[]. |
|
static MBeanInfo |
mergeMBeanInfos(MBeanInfo info1,
MBeanInfo info2)
Merge two MBeanInfo. |
|
static MBeanNotificationInfo[] |
mergeMBeanNotificationInfos(MBeanNotificationInfo[] infos1,
MBeanNotificationInfo[] infos2)
Merge two MBeanNotificationInfo[]. |
|
static MBeanOperationInfo[] |
mergeMBeanOperationInfos(MBeanOperationInfo[] infos1,
MBeanOperationInfo[] infos2)
Merge two MBeanOperationInfo[]. |
|
static MBeanInfo |
newMBeanInfo(MBeanInfo origMBeanInfo,
MBeanAttributeInfo[] newAttrInfos)
Make a new MBeanInfo from an existing one, substituting MBeanAttributeInfo[] |
|
static MBeanInfo |
newMBeanInfo(MBeanInfo origMBeanInfo,
MBeanOperationInfo[] newOps)
Make a new MBeanInfo from an existing one, substituting MBeanOperationInfo[] |
|
static ObjectName |
newObjectName(ObjectName objectName,
String props)
|
|
static ObjectName |
newObjectName(String name)
Create a new ObjectName, caller is guaranteeing that the name is well-formed (a RuntimeException will be thrown if not). |
|
static ObjectName |
newObjectName(String domain,
String props)
|
|
static ObjectName |
newObjectNamePattern(String domain,
Map<String,String> props)
Build an ObjectName pattern. |
|
static ObjectName |
newObjectNamePattern(String domain,
String props)
Build an ObjectName pattern. |
|
static ObjectName[] |
objectNameSetToArray(Set<ObjectName> objectNameSet)
Convert a Set of ObjectName into an array |
|
static List<String> |
objectNamesToStrings(Collection<ObjectName> objectNames)
Convert ObjectName into a Set of String. |
|
static String[] |
objectNamesToStrings(ObjectName[] objectNames)
Convert a Set of ObjectName into a Set of String |
|
static Set<ObjectName> |
queryNames(MBeanServerConnection conn,
ObjectName pattern,
QueryExp exp)
The sole purpose of this method is to move compiler warnings here, thus eliminating them from other call sites. |
|
static Set<ObjectName> |
queryNames(MBeanServer server,
ObjectName pattern,
QueryExp exp)
The sole purpose of this method is to move compiler warnings here, thus eliminating them from other call sites. |
|
static MBeanInfo |
removeAttributes(MBeanInfo origInfo,
String[] attributeNames)
|
|
static ObjectName |
removeProperty(ObjectName objectName,
String key)
|
|
static ObjectName |
setKeyProperty(ObjectName objectName,
String key,
String value)
Change or add a key property in an ObjectName. |
|
static String |
toString(ObjectName objectName)
|
|
static void |
unregisterAll(MBeanServerConnection conn)
|
|
static void |
unregisterAll(MBeanServerConnection conn,
Set<ObjectName> allNames)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MBEAN_SERVER_DELEGATE
public static final String MBEAN_SERVER_ID_ATTRIBUTE_NAME
public static final String WILD_PROP
public static final String WILD_ALL
public static final String GET
public static final String SET
public static final String IS
Method Detail |
---|
public static ObjectName getMBeanServerDelegateObjectName()
public static void listenToMBeanServerDelegate(MBeanServerConnection conn, NotificationListener listener, NotificationFilter filter, Object handback) throws IOException, InstanceNotFoundException
IOException
InstanceNotFoundException
public static String getMBeanServerID(MBeanServerConnection conn) throws IOException, ReflectionException, InstanceNotFoundException, AttributeNotFoundException, MBeanException
IOException
ReflectionException
InstanceNotFoundException
AttributeNotFoundException
MBeanException
public static ObjectName newObjectName(String name)
Do not call this method if there is not 100% certainty of a well-formed name.
public static ObjectName newObjectName(ObjectName objectName, String props)
public static ObjectName newObjectName(String domain, String props)
public static ObjectName newObjectNamePattern(String domain, String props)
domain
- the JMX domainprops
- properties of the ObjectNamepublic static ObjectName newObjectNamePattern(String domain, Map<String,String> props)
domain
- the JMX domainprops
- properties of the ObjectNamepublic static String mapToProps(Map<String,String> propsMap)
public static ObjectName removeProperty(ObjectName objectName, String key)
public static String makeProp(String name, String value)
public static String concatenateProps(String props1, String props2)
public static String concatenateProps(String props1, String props2, String props3)
public static ObjectName[] objectNameSetToArray(Set<ObjectName> objectNameSet)
objectNameSet
- a Set of ObjectName
public static String[] getKeyProperty(String key, ObjectName[] objectNames)
key
- the property name, within the ObjectNameobjectNames
-
public static String getProp(ObjectName objectName, String key)
objectName
- key
-
public static String getProps(ObjectName objectName, Set<String> propKeys)
public static String getProps(ObjectName objectName, Set<String> propKeys, boolean ignoreMissing)
public static String[] getKeyProperty(String key, Set<ObjectName> objectNameSet)
key
- the property name, within the ObjectNameobjectNameSet
-
public static Set<String> getKeyPropertySet(String key, Set<ObjectName> objectNameSet)
key
- the property name, within the ObjectNameobjectNameSet
-
public static String findKey(Set<String> candidateKeys, ObjectName objectName)
candidateKeys
- objectName
-
public static Set<ObjectName> findByProperty(Set<ObjectName> objectNames, String propertyKey, String propertyValue)
objectNames
- propertyKey
- propertyValue
-
public static ObjectName setKeyProperty(ObjectName objectName, String key, String value)
public static void unregisterAll(MBeanServerConnection conn, Set<ObjectName> allNames) throws IOException, MalformedObjectNameException, MBeanRegistrationException
IOException
MalformedObjectNameException
MBeanRegistrationException
public static void unregisterAll(MBeanServerConnection conn) throws IOException, MalformedObjectNameException, MBeanRegistrationException
IOException
MalformedObjectNameException
MBeanRegistrationException
public static String[] getAllAttributeNames(MBeanServerConnection conn, ObjectName objectName) throws IOException, ReflectionException, IntrospectionException, InstanceNotFoundException
IOException
ReflectionException
IntrospectionException
InstanceNotFoundException
public static MBeanAttributeInfo[] filterAttributeInfos(MBeanAttributeInfo[] infos, AttributeFilter filter)
public static String[] getAttributeNames(MBeanAttributeInfo[] infos)
infos
- array of infospublic static MBeanAttributeInfo getMBeanAttributeInfo(MBeanAttributeInfo[] infos, String attrName)
infos
- array of infosattrName
- public static MBeanAttributeInfo getMBeanAttributeInfo(MBeanInfo mbeanInfo, String attrName)
mbeanInfo
- attrName
- public static MBeanAttributeInfo[] getAttributeInfos(MBeanServerConnection conn, ObjectName objectName) throws IOException, ReflectionException, IntrospectionException, InstanceNotFoundException
conn
- objectName
-
IOException
ReflectionException
IntrospectionException
InstanceNotFoundException
public static Map<String,Attribute> attributeListToAttributeMap(AttributeList attrs)
attrs
- the AttributeListpublic static Map<String,Object> attributeListToValueMap(AttributeList attrs)
attrs
- the AttributeListpublic static Map<String,String> attributeListToStringMap(AttributeList attrs)
attrs
- the AttributeListpublic static Map<String,MBeanAttributeInfo> attributeInfosToMap(MBeanAttributeInfo[] attrInfos)
attrInfos
- the AttributeListpublic static MBeanInfo removeAttributes(MBeanInfo origInfo, String[] attributeNames)
public static Set<MBeanFeatureInfo> findInfoByName(MBeanFeatureInfo[] infos, String name)
infos
- infosname
- name
public static AttributeList mapToAttributeList(Map<String,Object> m)
m
- public static List<String> objectNamesToStrings(Collection<ObjectName> objectNames)
public static String[] objectNamesToStrings(ObjectName[] objectNames)
public static AttributeList getAttributesRobust(MBeanServerConnection conn, ObjectName objectName, String[] attrNames, Set<String> problemNames) throws InstanceNotFoundException, IOException
conn
- the connecitonobjectName
- name of the object to accessattrNames
- attribute namesproblemNames
- optional Set to which problem names will be added.
InstanceNotFoundException
IOException
public static boolean isIs(Method method)
public static boolean isGetter(Method method)
public static boolean isGetter(MBeanOperationInfo info)
public static MBeanOperationInfo[] findOperations(MBeanOperationInfo[] operations, String operationName)
public static MBeanOperationInfo findOperation(MBeanOperationInfo[] operations, String operationName, String[] types)
public static boolean isIsOrGetter(Method method)
public static String getAttributeName(Method method)
public static boolean isSetter(Method method)
public static boolean isGetAttribute(Method m)
public static boolean isGetAttributes(Method m)
public static boolean isSetAttribute(Method m)
public static boolean isSetAttributes(Method m)
public static ArrayList<MBeanAttributeInfo> generateAttributeInfos(Collection<Method> methodSet, boolean read, boolean write)
public static MBeanAttributeInfo[] generateMBeanAttributeInfos(Collection<Method> getterSetters, Collection<Method> getters, Collection<Method> setters)
public static String[] getSignature(MBeanParameterInfo[] infos)
public static MBeanParameterInfo[] generateSignature(Class[] sig)
public static MBeanOperationInfo[] generateMBeanOperationInfos(Collection<Method> methodSet)
public static MBeanInfo interfaceToMBeanInfo(Class theInterface)
public static MBeanAttributeInfo[] mergeMBeanAttributeInfos(MBeanAttributeInfo[] infos1, MBeanAttributeInfo[] infos2)
infos1
- infos2
- public static MBeanNotificationInfo[] mergeMBeanNotificationInfos(MBeanNotificationInfo[] infos1, MBeanNotificationInfo[] infos2)
infos1
- infos2
- public static MBeanInfo addNotificationInfos(MBeanInfo origInfo, MBeanNotificationInfo[] notifs)
origInfo
- notifs
- public static MBeanOperationInfo[] mergeMBeanOperationInfos(MBeanOperationInfo[] infos1, MBeanOperationInfo[] infos2)
infos1
- infos2
- public static MBeanConstructorInfo[] mergeMBeanConstructorInfos(MBeanConstructorInfo[] infos1, MBeanConstructorInfo[] infos2)
infos1
- infos2
- public static MBeanInfo mergeMBeanInfos(MBeanInfo info1, MBeanInfo info2)
info1
- info2
- public static MBeanInfo newMBeanInfo(MBeanInfo origMBeanInfo, MBeanAttributeInfo[] newAttrInfos)
origMBeanInfo
- newAttrInfos
- public static MBeanInfo newMBeanInfo(MBeanInfo origMBeanInfo, MBeanOperationInfo[] newOps)
origMBeanInfo
- newOps
- public static int findMBeanOperationInfo(MBeanInfo info, String methodName, String[] parameterTypes)
parameterTypes
is null, then the
first operation whose name matches is returned.
info
- methodName
- parameterTypes
-
public static boolean domainMatches(String defaultDomain, ObjectName pattern, ObjectName candidate)
public static boolean matchesPattern(String defaultDomain, ObjectName pattern, ObjectName candidate)
public static String toString(ObjectName objectName)
public static Notification cloneNotification(Notification in, Object source)
public static Set<ObjectName> queryNames(MBeanServerConnection conn, ObjectName pattern, QueryExp exp) throws IOException
IOException
public static Set<ObjectName> queryNames(MBeanServer server, ObjectName pattern, QueryExp exp)
public static final <T extends Serializable> Map<String,T> getUserDataMapString_Serializable(Notification notif)
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.