FileDocCategorySizeDatePackage
DynamicReconfigEventListenerImpl.javaAPI DocGlassfish v2 API4103Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.server.core.channel

DynamicReconfigEventListenerImpl

public class DynamicReconfigEventListenerImpl extends Object implements com.sun.enterprise.admin.event.DynamicReconfigEventListener
This is implemenation of DynamicReconfigEvent listener
author
Satish Viswanatham

Fields Summary
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
Methods Summary
public voidprocessEvent(com.sun.enterprise.admin.event.DynamicReconfigEvent event)


    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);
    }