Methods Summary |
---|
public static com.sun.enterprise.admin.AdminContext | getAdminContext()
return adminContext;
|
public static synchronized MBeanRegistry | getAdminMBeanRegistry()
if(adminRegistry != null)
return adminRegistry;
try {
//Dont need to load the static MBeans for non DAS instances
if ((adminContext != null) &&
(!ServerHelper.isDAS(adminContext.getRuntimeConfigContext(),
adminContext.getServerName())))
{
//Return an empty MBeanRegistry
adminRegistry = new MBeanRegistry();
return adminRegistry;
}
URL url = null;
if(adminContext!=null)
url = adminContext.getAdminMBeanRegistryURL();
if(url==null)
url = MBeanRegistry.class.getResource("/admin-mbeans-descriptors.xml"); //standard for pe
InputStream stream = url.openStream();
adminRegistry = new MBeanRegistry();
adminRegistry.loadMBeanRegistry(stream);
stream.close();
//printMBeanREgistry
try {
String fileName = System.getProperty("adminmbeanregistry.printfile");
if(fileName!=null)
{
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
out.println("MBean REGISTRY (in XPath value order)");
adminRegistry.sortRegistryEntries(MBeanRegistry.SORT_BY_XPATH);
out.print(adminRegistry.toFormatString());
out.println("\n\n\nMBean REGISTRY (in Type value order)");
adminRegistry.sortRegistryEntries(MBeanRegistry.SORT_BY_NAME);
out.print(adminRegistry.toFormatString());
out.close();
}
}
catch (Throwable t)
{}
return adminRegistry;
} catch (Throwable t) {
_sLogger.log(Level.WARNING, "core.registryfactory_adminregistry_not_found",
t);
}
return null;
|
public static MBeanRegistry | getMBeanRegistry(java.lang.String fileName)
return getMBeanRegistry(fileName, true);
|
public static synchronized MBeanRegistry | getMBeanRegistry(java.lang.String fileName, boolean bIntrospectMBeans)
try {
FileInputStream stream = new FileInputStream(fileName);
MBeanRegistry myRegistry = new MBeanRegistry();
myRegistry.loadMBeanRegistry((InputStream)stream, bIntrospectMBeans);
stream.close();
return myRegistry;
} catch (Throwable t) {
_sLogger.log(Level.WARNING, "core.registryfactory_registry_not_found",
t);
}
return null;
|
public static synchronized MBeanRegistry | getOfflineAdminMBeanRegistry()
MBeanRegistry myRegistry;
URL url = null;
url = MBeanRegistry.class.getResource("/admin-mbeans-descriptors-ee.xml"); //standard for ee
InputStream stream = null;
try {
stream = url.openStream();
} catch (Exception e)
{
}
if (stream==null)
{
url = MBeanRegistry.class.getResource("/admin-mbeans-descriptors.xml"); //standard for pe
stream = url.openStream();
}
if (stream==null)
return null;
myRegistry = new MBeanRegistry();
myRegistry.loadMBeanRegistry(stream, false);
stream.close();
return myRegistry;
|
public static synchronized MBeanRegistry | getRuntimeMBeanRegistry()
if(runtimeRegistry != null)
return runtimeRegistry;
try {
URL url = null;
if(adminContext!=null)
url = adminContext.getRuntimeMBeanRegistryURL();
if(url==null)
url = MBeanRegistry.class.getResource("/runtime-mbeans-descriptors.xml"); //standard for pe
InputStream stream = url.openStream();
runtimeRegistry = new MBeanRegistry();
runtimeRegistry.loadMBeanRegistry(stream);
stream.close();
return runtimeRegistry;
} catch (Throwable t) {
_sLogger.log(Level.WARNING, "core.registryfactory_adminregistry_not_found",
t);
}
return null;
|
public static void | setAdminContext(com.sun.enterprise.admin.AdminContext ctx)
adminContext = ctx;
|
public static synchronized void | setAdminMBeanRegistry(MBeanRegistry registry) //for tester purposes
adminRegistry = registry;
|