args[0] = name;
try {
Method getMethod = PrivilegedAccessHelper.getPublicMethod(MBeanServer.class,
"unregisterMBean", new Class[] {ObjectName.class}, false);
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
AccessController.doPrivileged(new PrivilegedMethodInvoker(getMethod, mBeanServerRuntime, args));
} else {
mBeanServerRuntime.unregisterMBean(name);
}
getAbstractSession().log(SessionLog.FINEST, SessionLog.SERVER, "jmx_unregistered_mbean", name, mBeanServerRuntime);
} catch(InstanceNotFoundException inf) {
getAbstractSession().log(SessionLog.WARNING, SessionLog.SERVER, "problem_unregistering_mbean", inf);
} catch (MBeanRegistrationException mbre) {
getAbstractSession().log(SessionLog.WARNING, SessionLog.SERVER, "problem_unregistering_mbean", mbre);
}
}
if (shouldRegisterRuntimeBean) {
try {
name = new ObjectName(JMX_REGISTRATION_PREFIX + "Session(" + sessionName + ")");
} catch (MalformedObjectNameException mne) {
getAbstractSession().log(SessionLog.WARNING, SessionLog.SERVER, "problem_unregistering_mbean", mne);
} catch (Exception exception) {
getAbstractSession().log(SessionLog.WARNING, SessionLog.SERVER, "problem_unregistering_mbean", exception);
}
getAbstractSession().log(SessionLog.FINEST, SessionLog.SERVER, "unregistering_mbean", name, mBeanServerRuntime);
Object[] args = new Object[1];
args[0] = name;
try {
Method getMethod = PrivilegedAccessHelper.getPublicMethod(MBeanServer.class,
"unregisterMBean", new Class[] {ObjectName.class}, false);
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
AccessController.doPrivileged(new PrivilegedMethodInvoker(getMethod, mBeanServerRuntime, args));
} else {
mBeanServerRuntime.unregisterMBean(name);
}
getAbstractSession().log(SessionLog.FINEST, SessionLog.SERVER, "jmx_unregistered_mbean", name, mBeanServerRuntime);
} catch(InstanceNotFoundException inf) {