ObjectName loaderObjectName = null;
try
{
// can't import it because it's this code is in client API.
// We want this feature to work only if the requisite classes are present,
// but we can't include them.
//
final Class loaderClass = Class.forName( LOADER_CLASSNAME );
final Constructor constructor =
loaderClass.getConstructor( LOADER_CONSTRUCTOR_SIG );
final Object loader = constructor.newInstance( mServer, mDomainXML );
final String domain = AMX.JMX_DOMAIN + "-support";
loaderObjectName = Util.newObjectName( domain, Util.makeNameProp( NAME ) );
loaderObjectName =
mServer.registerMBean( loader, loaderObjectName ).getObjectName();
}
catch(Throwable t)
{
t.printStackTrace();
throw new RuntimeException( t );
}
return loaderObjectName;