Methods Summary |
---|
public java.lang.Object | findElement(javax.management.ObjectName objectName)
Object match = null;
match= findElement_8_0(objectName);
if(match!=null)
return match;
//Now try the old 7.0 namespace
// which's still alive
String type = ObjectNameHelper.getType(objectName);
String instanceName = ObjectNameHelper.getServerInstanceName(objectName);
if (type != null)
{
if (type.equals(ObjectNames.kController))
{
match = new ServerController();
}
else if (type.equals(ObjectNames.kGenericConfigurator))
{
match = new GenericConfigurator();
}
else if (type.equals(ObjectNames.kServerInstance))
{
match = findServerInstance(instanceName);
if(match==null)
throw new InstanceNotFoundException(objectName.toString());
}
else if (type.equals(ObjectNames.kDeployment))
{
match = findServerInstance(instanceName);
if(match==null)
throw new InstanceNotFoundException(objectName.toString());
}
else
{
/* Ordinary Config Mbean - use ConfigMBeanNaming */
match = findGenericConfigBean(objectName, instanceName);
}
}
else
{
/* unknown type */
_logger.log(Level.FINE, "mbean.config.admin.unknown_mbean_type", objectName.toString() );
}
return ( match );
|
private java.lang.Object | findElement_8_0(javax.management.ObjectName objectName)
try
{
MBeanRegistry registry = MBeanRegistryFactory.getAdminMBeanRegistry();
return (Object)registry.findMBeanRegistryEntry(objectName);
}
catch(Exception e)
{
return null;
}
|
private java.lang.Object | findGenericConfigBean(javax.management.ObjectName objectName, java.lang.String instanceName)
/* Ordinary Config Mbean - use ConfigMBeanNaming */
Object bean = null;
ConfigMBeanNamingInfo mbeanInfo = null;
try
{
mbeanInfo = new ConfigMBeanNamingInfo(objectName);
}
catch (MBeanConfigException mce)
{
_logger.log(Level.FINE, "mbean.config.admin.naming_not_found",
new Object[]{objectName.toString(), mce.getLocalizedMessage()} );
}
if(mbeanInfo!=null)
{
String xPath = mbeanInfo.getXPath();
try
{
ConfigContext ctx = getConfigContext(instanceName);
bean = ConfigBeansFactory.getConfigBeanByXPath(ctx, xPath);
}
catch(Exception e)
{
_logger.log(Level.FINE, "mbean.config.admin.config_bean_not_found",
new Object[]{xPath, e.getLocalizedMessage()} );
}
}
return bean;
|
private java.lang.Object | findServerInstance(java.lang.String instanceName)
ServerManager sm = ServerManager.instance();
Server serverInstance = null;
/* boolean isAdminServer = instanceName.equals(
ServerManager.ADMINSERVER_ID); */
if (! sm.instanceExists(instanceName) /*&& !isAdminServer*/)
{
return null;
}
try
{
ConfigContext cc = getConfigContext(instanceName);
serverInstance = ServerBeansFactory.getServerBean(cc);
}
catch(Exception e)
{
e.printStackTrace(); //no harm in squelching
}
return ( serverInstance );
|
private com.sun.enterprise.config.ConfigContext | getConfigContext(java.lang.String instanceName)
if (mAdminContext != null) {
return mAdminContext.getAdminConfigContext();
} else {
String backupServerXmlPath = new InstanceEnvironment(instanceName).getBackupConfigFilePath();
return (ConfigFactory.createConfigContext(backupServerXmlPath) );
}
|
public void | setAdminContext(com.sun.enterprise.admin.AdminContext ctx)
mAdminContext = ctx;
|