|
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.base.Util
public final class Util
Utility routines pertinent to the MBean API.
Method Summary | ||
---|---|---|
static AMX |
asAMX(Object o)
A safe way to cast to AMX. |
|
static String |
concatenateProps(String props1,
String props2)
|
|
static String |
concatenateProps(String props1,
String props2,
String props3)
|
|
static
|
createNameMap(Set<T> amxs)
Create a Map keyed by the value of the AMX.NAME_KEY with value the AMX item. |
|
static Map<String,ObjectName> |
createObjectNameMap(Set<ObjectName> objectNames)
Create a Map keyed by the value of the AMX.NAME_KEY with value the ObjectName. |
|
static Map<String,Serializable> |
getAMXNotificationData(Notification notif)
All Notifications emitted by AMX MBeans which are not standard types defined by JMX place a Map into the userData field of the Notification. |
|
static Serializable |
getAMXNotificationValue(Notification notif,
String key)
Use of generic type form taking Class |
|
static
|
getAMXNotificationValue(Notification notif,
String key,
Class<T> theClass)
Retrieve a particular value associated with the specified key from an AMX Notification. |
|
static Extra |
getExtra(AMX proxy)
Get extra information about this AMX . |
|
static String |
getFullTypeProps(ObjectName objectName,
String fullType)
Get properties corresponding to the FullType of this ObjectName. |
|
static String |
getJ2EEType(ObjectName objectName)
|
|
static String |
getName(ObjectName objectName)
Get the value of the AMX.NAME_KEY property within the ObjectName or AMX.NO_NAME if not present. |
|
static Set<String> |
getNames(Set<? extends AMX> amxs)
Extract the names from all ObjectNames. |
|
static String[] |
getNamesArray(Set<ObjectName> objectNames)
Extract the names from all ObjectNames. |
|
static Set<String> |
getNamesSet(Set<ObjectName> objectNames)
Extract the names from all ObjectNames. |
|
static ObjectName |
getObjectName(Map<String,ObjectName> candidates,
String name)
Get an ObjectName from a Map of ObjectName where the values are keyed by name. |
|
static
|
getObjectName(T proxy)
Get the ObjectName targeted by this AMX . |
|
static Set<String> |
getPatternKeys(String fullType)
Get all keys required for an ObjectName pattern which uniquely identifies the MBean. |
|
static String |
getSelfProp(ObjectName objectName)
Extract the j2eeType and name properties and return it as a single property j2eeType=name |
|
static String[] |
getTypeArray(String fullType)
Get the FullType as a String[], last element being the j2eeType. |
|
static String |
makeJ2EETypeProp(String value)
Make an ObjectName property of the form j2eeType=value. |
|
static String |
makeNameProp(String value)
Make an ObjectName property of the form name=value. |
|
static String |
makeProp(String name,
String value)
Make an ObjectName property of the form name=value. |
|
static String |
makeRequiredProps(String j2eeType,
String name)
|
|
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)
Build an ObjectName. |
|
static ObjectName |
newObjectNamePattern(ObjectName objectName)
Build an ObjectName pattern. |
|
static ObjectName |
newObjectNamePattern(String domain,
String props)
Build an ObjectName pattern. |
|
static void |
sleep(long millis)
|
|
static ObjectName[] |
toObjectNames(AMX[] amx)
|
|
static Map<String,ObjectName> |
toObjectNames(Map<String,? extends AMX> amxMap)
|
|
static Set<ObjectName> |
toObjectNames(Set<? extends AMX> amxs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ObjectName newObjectName(String name)
name
- public static ObjectName newObjectName(String domain, String props)
domain
- the JMX domainprops
- properties of the ObjectNamepublic static ObjectName newObjectNamePattern(String domain, String props)
domain
- the JMX domainprops
- properties of the ObjectNamepublic static ObjectName newObjectNamePattern(ObjectName objectName)
objectName
- public static String makeProp(String name, String value)
name
- value
- public static String makeJ2EETypeProp(String value)
value
- public static String makeNameProp(String value)
value
- public static String makeRequiredProps(String j2eeType, String name)
j2eeType
- name
- public static String getSelfProp(ObjectName objectName)
objectName
- public static String getFullTypeProps(ObjectName objectName, String fullType)
objectName
- fullType
-
public static String getName(ObjectName objectName)
public static String getJ2EEType(ObjectName objectName)
public static String[] getTypeArray(String fullType)
fullType
- as returned from AMX.getFullType()
public static Set<String> getPatternKeys(String fullType)
public static String concatenateProps(String props1, String props2)
public static String concatenateProps(String props1, String props2, String props3)
public static Set<ObjectName> toObjectNames(Set<? extends AMX> amxs)
public static Map<String,ObjectName> toObjectNames(Map<String,? extends AMX> amxMap)
public static ObjectName[] toObjectNames(AMX[] amx)
public static Set<String> getNames(Set<? extends AMX> amxs)
AMX
). Note that if two or more ObjectNames
share the same name, the resulting Set will be of smaller size() than
the original.
public static Set<String> getNamesSet(Set<ObjectName> objectNames)
AMX
). Note that if two or more ObjectNames
share the same name, the resulting Set will be of smaller size() than
the original.
public static String[] getNamesArray(Set<ObjectName> objectNames)
public static final Map<String,ObjectName> createObjectNameMap(Set<ObjectName> objectNames)
objectNames
- Set of ObjectNamepublic static <T extends AMX> Map<String,T> createNameMap(Set<T> amxs)
amxs
- Set of AMXpublic static Extra getExtra(AMX proxy)
AMX
.
'Extra' is not an MBean Attribute; it exists only in the AMX
.
proxy
- an AMXpublic static <T extends AMX> ObjectName getObjectName(T proxy)
AMX
.
proxy
- an AMXpublic static ObjectName getObjectName(Map<String,ObjectName> candidates, String name)
candidates
- name
-
IllegalArgumentException
- if not foundpublic static Map<String,Serializable> getAMXNotificationData(Notification notif)
public static Serializable getAMXNotificationValue(Notification notif, String key)
public static <T extends Serializable> T getAMXNotificationValue(Notification notif, String key, Class<T> theClass)
getAMXNotificationData(javax.management.Notification)
public static void sleep(long millis)
public static AMX asAMX(Object o)
|
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.