try
{
AdminContext adminContext = MBeanRegistryFactory.getAdminContext();
String instanceName = adminContext.getServerName();
int action = bEnabled?DynamicReconfigEvent.ACTION_ENABLED:DynamicReconfigEvent.ACTION_DISABLED;
DynamicReconfigEvent event = new DynamicReconfigEvent(instanceName, action);
String configName = (String)getAttribute(ServerTags.NAME);
event.setTargetDestination(configName);
EventContext.addEvent(event);
}
catch (Exception e)
{
e.printStackTrace();