Methods Summary |
---|
private javax.management.MBeanServerConnection | getMBeanServerConnection(javax.servlet.ServletConfig cfg)
//first get through reflection.
String factoryClass = cfg.getInitParameter(DefaultConfiguration.MBEANSERVER_FACTORY_PROPERTY_NAME);
// final MBeanServerConnection mbsc = introspectMBS();
final MBeanServerConnection mbsc = introspectMBS(factoryClass);
/* END -- S1WS_MOD */
if (mbsc != null) {
return mbsc;
}
final java.util.ArrayList servers = MBeanServerFactory.findMBeanServer(null);
final MBeanServer systemMBS = (MBeanServer)servers.get(0);
return ((MBeanServerConnection)systemMBS);
|
public com.sun.enterprise.admin.jmx.remote.server.notification.ServerNotificationManager | getNotificationManager()
return notifyMgr;
|
public javax.management.remote.message.MBeanServerResponseMessage | handle(javax.management.remote.message.MBeanServerRequestMessage request0)
assert (request0.getParams().length >= 1) : "Invalid Object Array"; //has to have at least one elem
MBeanServerResponseMessage response = null;
final Version cv = (Version)request0.getParams()[0];
logger.finer("Client Version = " + cv.toString());
if (! isCompatible(cv)) {
response = incompatibleVersionMessage(request0);
return ( response );
}
//should come here iff the version is compatible.
final MBeanServerRequestMessage request = removeVersion(request0);
boolean handled = false;
final Iterator iter = callers.iterator();
while (iter.hasNext()) {
final MBeanServerConnectionMethodCaller caller =
(MBeanServerConnectionMethodCaller)iter.next();
if (caller.canCall(request)) {
response = caller.call(request);
handled = true;
break;
}
}
assert handled : "The request is not handled -- catastrophe";
return ( response );
|
private javax.management.remote.message.MBeanServerResponseMessage | incompatibleVersionMessage(javax.management.remote.message.MBeanServerRequestMessage r)
//should come in this method only in case of incompatible versions
final int id = r.getMethodId();
final boolean isException = true;
final Version cv = (Version)r.getParams()[0];
Exception e = null;
assert (! isCompatible(cv)) : "No message for compatible versions";
if (! matcher.majorCompatible(cv, sv)) {
e = majorVersionIncompatible(cv, sv);
}
else if (! matcher.minorCompatible(cv, sv)) {
e = minorVersionIncompatible(cv, sv);
}
else if (! matcher.upgradeCompatible(cv, sv)) {
e = upgradeIncompatible(cv, sv);
}
assert (e != null) : "Either minor/major version or upgrade data have to fail the match";
return ( new MBeanServerResponseMessage(id, e, isException) );
|
private javax.management.MBeanServerConnection | introspectMBS(java.lang.String factoryClass)Returns the instance of S1AS MBeanServer. This information could well
come from deployment descriptor, but for now I am hardcoding it -- 08/04/03.
Returns a null if none could be found.
/* END -- S1WS_MOD */
MBeanServerConnection mbsc = null;
/* BEGIN -- S1WS_MOD */
//final String FACTORY_CLASS = "com.sun.enterprise.admin.common.MBeanServerFactory";
String FACTORY_CLASS = factoryClass;
if (factoryClass == null || factoryClass.trim().length() == 0)
FACTORY_CLASS = System.getProperty(DefaultConfiguration.MBEANSERVER_FACTORY_PROPERTY_NAME);
/* END -- S1WS_MOD */
final String FACTORY_METHOD = "getMBeanServer";
/* BEGIN -- S1WS_MOD */
if (FACTORY_CLASS == null || FACTORY_CLASS.trim().length() == 0)
return null;
/* END -- S1WS_MOD */
try {
logger.finer("Introspecting the MBeanServerConnection");
final Class c = Class.forName(FACTORY_CLASS); //loaded by the same CL
final Method m = c.getMethod(FACTORY_METHOD, null);
final Object r = m.invoke(c, null);
assert (r instanceof MBeanServer) : "Reflection does not return the correct type";
mbsc = (MBeanServerConnection)r;
logger.finer("Introspected the MBeanServerConnection successfully!!");
}
catch (Throwable t) {
logger.throwing(this.getClass().getName(), "introspectMBS", t);
}
return ( mbsc );
|
private boolean | isCompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version cv)
return ( matcher.match(cv, sv) );
|
private java.lang.Exception | majorVersionIncompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version cv, com.sun.enterprise.admin.jmx.remote.protocol.Version sv)
//i18n
final StringBuffer sb = new StringBuffer();
sb.append("The major versions don't match: ").
append("Client Major Version = " + cv.getMajorVersion()).
append("Server Major Version = " + sv.getMajorVersion()).
append(" Upgrade the software accordingly");
return ( new RuntimeException(sb.toString()) );
|
private java.lang.Exception | minorVersionIncompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version cv, com.sun.enterprise.admin.jmx.remote.protocol.Version sv)
//i18n
final StringBuffer sb = new StringBuffer();
sb.append("The minor versions don't match: ").
append("Client Minor Version = " + cv.getMinorVersion()).
append("Server Minor Version = " + sv.getMinorVersion()).
append(" Upgrade the software accordingly");
return ( new RuntimeException(sb.toString()) );
|
private javax.management.remote.message.MBeanServerRequestMessage | removeVersion(javax.management.remote.message.MBeanServerRequestMessage from)
final int id = from.getMethodId();
final Subject s = from.getDelegationSubject();
final Shifter sh = new Shifter(from.getParams());
sh.shiftLeft();
final Object[] np = sh.state();
return ( new MBeanServerRequestMessage(id, np, s) );
|
private java.lang.Exception | upgradeIncompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version cv, com.sun.enterprise.admin.jmx.remote.protocol.Version sv)
//i18n
final StringBuffer sb = new StringBuffer();
sb.append("The upgrade data in versions does not match: ").
append("Client Upgrade Data = " + cv.toString()).
append("Server Upgrade Data = " + sv.toString()).
append(" Upgrade the software accordingly");
return ( new RuntimeException(sb.toString()) );
|