Methods Summary |
---|
private static java.util.Set | checked(java.util.Set s)
return Collections.checkedSet(s, ObjectName.class);
|
private static java.lang.String[] | convertToRegex(java.lang.String[] wildExprs)
String[] regexExprs = null;
if ( wildExprs != null )
{
regexExprs = new String[ wildExprs.length ];
for( int i = 0; i < wildExprs.length; ++i )
{
final String expr = wildExprs[ i ];
final String regex = expr == null ?
null : RegexUtil.wildcardToJavaRegex( expr );
regexExprs[ i ] = regex;
}
}
return( regexExprs );
|
public final java.lang.String | getGroup()
return( AMX.GROUP_UTILITY );
|
private static synchronized java.lang.Class | interfaceForJ2EEType(java.lang.String j2eeType)Return the Class associated with a given type or null if none.
Class theClass = XTypesMapper.getInstance().getInterfaceForType( j2eeType );
if ( theClass == null )
{
theClass = J2EETypesMapper.getInstance().getInterfaceForType( j2eeType );
}
return( theClass );
|
private java.util.Set | matchWild(java.util.Set candidates, java.lang.String[] wildKeys, java.lang.String[] wildValues)
final String[] regexNames = convertToRegex( wildKeys );
final String[] regexValues = convertToRegex( wildValues );
final ObjectNameQueryImpl query = new ObjectNameQueryImpl();
final Set<ObjectName> resultSet = query.matchAll( candidates, regexNames, regexValues );
return( resultSet );
|
public java.util.Set | queryAllObjectNameSet()Return a Set containing all AMX ObjectNames.
final ObjectName pat = Util.newObjectNamePattern( getJMXDomain(), "" );
return( queryPatternObjectNameSet( pat ) );
|
private java.util.Set | queryInterfaceObjectNameSet(java.util.Set objectNames, java.lang.String interfaceName, java.lang.String attributeName)Match an interface classname against the value of an Attribute.
final Set<ObjectName> result = new HashSet<ObjectName>();
final MBeanServer server = getMBeanServer();
for( final ObjectName objectName : objectNames )
{
try
{
if ( server.getAttribute( objectName, attributeName ).equals( interfaceName ) )
{
result.add( objectName );
}
}
catch( JMException e )
{
// ignore
}
}
return checked(result);
|
public java.util.Set | queryInterfaceObjectNameSet(java.lang.String searchInterfaceName, java.util.Set candidates)
final Set<ObjectName> result = new HashSet<ObjectName>();
final Set<ObjectName> iter = candidates == null ?
queryAllObjectNameSet() : candidates;
final Class<?> searchInterface = ClassUtil.getClassFromName( searchInterfaceName );
final MBeanServer server = getMBeanServer();
for( final ObjectName objectName : iter )
{
try
{
final String interfaceName = (String)
server.getAttribute( objectName, AMXAttributes.ATTR_INTERFACE_NAME );
final Class c =
ClassUtil.getClassFromName( interfaceName );
if ( searchInterface.isAssignableFrom( c ) )
{
result.add( objectName );
}
}
catch( JMException e )
{
// ignore
}
}
return( checked(result) );
|
public java.util.Set | queryJ2EENameObjectNameSet(java.lang.String nameValue)Get all MBeans having the specified name.
final String prop = Util.makeNameProp( nameValue );
final Set<ObjectName> names = queryPropsObjectNameSet( getMBeanServer(),
getJMXDomain(), prop );
return( names );
|
public java.util.Set | queryJ2EETypeNameObjectNameSet(java.lang.String j2eeType, java.lang.String name)
final String props = Util.makeRequiredProps( j2eeType, name );
return queryPatternObjectNameSet( Util.newObjectNamePattern( getObjectName().getDomain(), props ) );
|
public java.lang.String[] | queryJ2EETypeNames(java.lang.String j2eeType)
final String prop = Util.makeJ2EETypeProp( j2eeType );
final Set<ObjectName> objectNameSet = queryPropsObjectNameSet( prop );
final ObjectName[] objectNames = JMXUtil.objectNameSetToArray( objectNameSet );
final String[] nameKeyValues =
JMXUtil.getKeyProperty( NAME_KEY, objectNames );
return( nameKeyValues );
|
public static java.util.Set | queryJ2EETypeObjectNameSet(javax.management.MBeanServerConnection conn, java.lang.String domainName, java.lang.String j2eeTypeValue)
final String prop = Util.makeJ2EETypeProp( j2eeTypeValue ) ;
final ObjectName pat = Util.newObjectNamePattern( domainName, prop );
final Set<ObjectName> names = queryPatternObjectNameSet( conn, pat );
return( checked(names) );
|
public java.util.Set | queryJ2EETypeObjectNameSet(java.lang.String j2eeTypeValue)
final String prop = Util.makeJ2EETypeProp( j2eeTypeValue ) ;
final ObjectName pat = Util.newObjectNamePattern( getJMXDomain(), prop );
final Set<ObjectName> names = queryPropsObjectNameSet( getMBeanServer(),
getJMXDomain(), prop );
return( names );
|
public java.util.Set | queryJ2EETypesObjectNameSet(java.util.Set j2eeTypes)
final Set<ObjectName> result = new HashSet<ObjectName>();
for( final String j2eeType : j2eeTypes )
{
result.addAll( queryJ2EETypeObjectNameSet( j2eeType ) );
}
return result;
|
public static java.util.Set | queryPatternObjectNameSet(javax.management.MBeanServerConnection conn, javax.management.ObjectName pattern)
final Set<ObjectName> names = JMXUtil.queryNames( conn, pattern, null );
return checked(names);
|
public static java.util.Set | queryPatternObjectNameSet(javax.management.MBeanServer server, javax.management.ObjectName pattern)
final Set<ObjectName> names = JMXUtil.queryNames( server, pattern, null );
return checked(names);
|
public java.util.Set | queryPatternObjectNameSet(javax.management.ObjectName pattern)
return( queryPatternObjectNameSet( getMBeanServer(), pattern ) );
|
public java.util.Set | queryPatternObjectNameSet(java.lang.String domain, java.lang.String props)
final String myDomain = getObjectName().getDomain();
final ObjectName pattern = Util.newObjectNamePattern(
domain == null ? myDomain : domain, props );
return( queryPatternObjectNameSet( getMBeanServer(), pattern ) );
|
public static java.util.Set | queryPropsObjectNameSet(javax.management.MBeanServerConnection conn, java.lang.String jmxDomainName, java.lang.String props)
final ObjectName pattern =
Util.newObjectNamePattern( jmxDomainName, props );
final Set<ObjectName> names = JMXUtil.queryNames( conn, pattern, null );
return( checked(names) );
|
public static java.util.Set | queryPropsObjectNameSet(javax.management.MBeanServer server, java.lang.String jmxDomainName, java.lang.String props)
final ObjectName pattern =
Util.newObjectNamePattern( jmxDomainName, props );
final Set<ObjectName> names = JMXUtil.queryNames( server, pattern, null );
return( checked(names) );
|
public java.util.Set | queryPropsObjectNameSet(java.lang.String props)
final String myDomain = getObjectName().getDomain();
final Set<ObjectName> names =
queryPropsObjectNameSet( getMBeanServer(), myDomain, props );
return( checked(names) );
|
public javax.management.ObjectName | querySingletonJ2EEType(java.lang.String j2eeTypeValue)Get the ObjectName of an MBean having the specified J2EEType. If
there is more than one such MBean, an IllegalArgumentException
is thrown. If no object is found, then null is returned.
final Set<ObjectName> names = queryJ2EETypeObjectNameSet( j2eeTypeValue );
if ( names.size() > 1 )
{
trace( "QueryMgrImpl.getJ2EETypeObjectName: expected 1, got " + names.size() );
throw new IllegalArgumentException( j2eeTypeValue );
}
final ObjectName objectName = names.size() == 0 ?
null :GSetUtil.getSingleton( names );
return( objectName );
|
public javax.management.ObjectName | querySingletonJ2EETypeObjectName(java.lang.String j2eeType)
return( querySingletonJ2EETypeObjectName( getMBeanServer(), getObjectName().getDomain(), j2eeType ) );
|
public static javax.management.ObjectName | querySingletonJ2EETypeObjectName(javax.management.MBeanServer server, java.lang.String domainName, java.lang.String j2eeTypeValue)
try
{
final ObjectName objectName =
querySingletonJ2EETypeObjectName(
(MBeanServerConnection)server,
domainName,
j2eeTypeValue );
return( objectName );
}
catch( IOException e )
{
assert( false );
throw new RuntimeException( e );
}
|
public static javax.management.ObjectName | querySingletonJ2EETypeObjectName(javax.management.MBeanServerConnection conn, java.lang.String domainName, java.lang.String j2eeTypeValue)
final Set<ObjectName> names =
queryJ2EETypeObjectNameSet( conn, domainName, j2eeTypeValue );
if ( names.size() != 1 )
{
throw new IllegalArgumentException(
"request was for a single Object name of type: " + j2eeTypeValue +
" but found several: " + SmartStringifier.toString( names ) );
}
final ObjectName objectName = (ObjectName)GSetUtil.getSingleton( names );
return( objectName );
|
public java.util.Set | queryWildObjectNameSet(java.lang.String[] wildKeys, java.lang.String[] wildValues)
final Set<ObjectName> candidates = queryAllObjectNameSet();
return( matchWild( candidates, wildKeys, wildValues ) );
|