Methods Summary |
---|
private void | _refresh()
checkHADBAvailable();
|
private void | checkHADBAvailable()
final boolean available = mServer.isRegistered(
com.sun.enterprise.admin.common.ObjectNames.getHADBConfigObjectName() );
mFeatures.put( HADB_CONFIG_FEATURE, Boolean.valueOf( available ) );
|
public java.lang.String[] | getFeatureNames()
return( (String[])FEATURE_NAMES.clone() );
|
public final java.lang.String | getGroup()
return( AMX.GROUP_UTILITY );
|
private javax.management.ObjectName | getOldServersMBeanObjectName()Get the ObjectName of the "type=servers" MBean, which only exists in the DAS.
// if we find the old "servers" MBean, it should only be running in the DAS.
final ObjectName pattern =
Util.newObjectName( "com.sun.appserv", "category=config,type=servers" );
final Set<ObjectName> serversSet = JMXUtil.queryNames( mServer, pattern, null );
final ObjectName objectName = serversSet.size() == 0 ?
null : (ObjectName)GSetUtil.getSingleton( serversSet );
return( objectName );
|
public java.util.Map | getPerformanceMillis()Return a Map keyed by an arbitrary String denoting some feature. The value
is the time in milliseconds. Code should not rely on the keys as they are subject to
changes, additions, or removal at any time, except as otherwise documented.
Even documented items should be used only for informational purposes,
such as assessing performance.
// ensure that we return a copy which is a HashMap, not some other variant of Map
final HashMap<String,Long> result = new HashMap<String,Long>();
result.putAll( SystemInfoData.getInstance().getPerformanceMillis() );
return result;
|
private boolean | isRunningInDomainAdminServer()
return( getOldServersMBeanObjectName() != null );
|
private void | refresh()
final long REFRESH_MILLIS = 5 * 1000; // 5 seconds
final long elapsed = System.currentTimeMillis() - LAST_REFRESH;
if ( elapsed > REFRESH_MILLIS )
{
_refresh();
}
|
private final boolean | supportsClusters()
final ObjectName serversObjectName = getOldServersMBeanObjectName();
boolean supportsClusters = false;
if ( serversObjectName != null )
{
// see if the 'servers' MBean supports listing unclustered instances
try
{
final MBeanInfo info = mServer.getMBeanInfo( serversObjectName );
final String operationName = "listUnclusteredServerInstancesAsString";
final Set operations = JMXUtil.findInfoByName( info.getOperations(), operationName );
supportsClusters = operations.size() != 0;
}
catch( JMException e )
{
// should never happen...
throw new RuntimeException( "problem with 'servers' MBean: " + serversObjectName, e );
}
}
else
{
// presumably, we're in another instance, which implies multiple instances.
// assume this also means clustering is possible
supportsClusters = true;
}
return( supportsClusters );
|
public boolean | supportsFeature(java.lang.String key)
boolean supports = false;
Boolean result = mFeatures.get( key );
if ( result == null )
{
result = Boolean.FALSE;
}
return( result.booleanValue() );
|