String inst = event.getInstanceName();
if (inst == null) {
String msg = localStrings.getString(
"admin.server.core.channel.impl.no_inst_name");
throw new AdminEventListenerException(msg);
}
RMIClient client = AdminChannel.getRMIClient(inst);
if (client == null) {
String msg = localStrings.getString(
"admin.server.core.channel.impl.no_rmi_client", inst);
throw new AdminEventListenerException(msg);
}
boolean resNeeded = client.isRestartNeeded();
if (event.getActionType() == DynamicReconfigEvent.ACTION_ENABLED) {
if (resNeeded == true) {
// can not set dynamic reconfig, throw exception
String msg = localStrings.getString(
"admin.server.core.channel.impl.restart_required", inst);
throw new AdminEventListenerException(msg);
}
} else if (event.getActionType() == DynamicReconfigEvent.ACTION_DISABLED) {
client.setRestartNeeded(true);
}