Methods Summary |
---|
private void | checkAlreadyLoaded()
if ( mServer.isRegistered( ObjectNames.getControllerObjectName() ) )
{
throw new IllegalArgumentException();
}
|
private javax.management.ObjectInstance | createAndRegister(java.lang.String className, javax.management.ObjectName objectName)
final Class mbeanClass = Class.forName( className );
final Object mbeanImpl = mbeanClass.newInstance();
final ObjectInstance mbeanInstance = this.registerMBean( mbeanImpl, objectName );
return( mbeanInstance );
|
protected void | doRun()
checkAlreadyLoaded();
initialize();
|
private void | initialize()Initializes the MBeanServer. This method registers the System MBeans.
The System MBeans are assumed to have default constructor.
try {
final ObjectName controllerObjectName = ObjectNames.getControllerObjectName();
final ObjectName configObjectName = ObjectNames.getGenericConfiguratorObjectName();
final ObjectName[] objectNames = { controllerObjectName, configObjectName };
final String controllerClassName =
"com.sun.enterprise.admin.server.core.mbean.config.ServerController";
final String configClassName =
"com.sun.enterprise.admin.server.core.mbean.config.GenericConfigurator";
final String[] clNames = {controllerClassName, configClassName};
for (int i = 0 ; i < clNames.length ; i++) {
createAndRegister( clNames[i], objectNames[ i ] );
}
registerDottedNameSupport();
registerConfigMBeans();
}
catch (Exception e) {
sLogger.log(Level.WARNING, "Error in initialize", e);
throw new InitException(e.getMessage(), e );
}
|
private void | registerConfigMBeans()OLD, possibly invalid comments below
NOTE: I am using runtime configcontext to instantiate configmbeans
FIXME: The current implementation does not load all the mbeans
while creating elements. Hence, some mbeans may never be
loaded. This needs to be fixed.
FIXME: Eventual plan is to move this method to AdminService where
it is initialized once and there is no need to call again.
This method does not throw any exception and is best-effort.
final long start = System.currentTimeMillis();
final MBeanRegistry mr = MBeanRegistryFactory.getAdminMBeanRegistry();
final ConfigContext configContext = mAdminContext.getAdminConfigContext();
final String jmxDomainName = ApplicationServer.getServerContext().getDefaultDomainName();
mr.instantiateAndRegisterAllConfigMBeans(
configContext,
jmxDomainName);
final long elapsed = System.currentTimeMillis() - start;
FeatureAvailability.getInstance().registerFeature( FeatureAvailability.COM_SUN_APPSERV_CONFIG_MBEANS_FEATURE, mServer );
|
private void | registerDottedNameSupport()
final Class initerClass = Class.forName( DottedMBeansIniterClassName );
// invoke new DottedNamesMBeanIniter( MBeanServer m )
final Class [] signature = new Class [] { MBeanServer.class };
final java.lang.reflect.Constructor constructor = initerClass.getConstructor( signature );
constructor.newInstance( new Object [] { mServer } );
// done--it will have done its job
|
public javax.management.ObjectInstance | registerMBean(java.lang.Object object, javax.management.ObjectName objectName)
return mServer.registerMBean(object, objectName);
|
protected void | startLoading(boolean synchronous)
checkAlreadyLoaded();
if ( synchronous )
{
run();
}
else
{
new Thread( this ).start();
}
|