FileDocCategorySizeDatePackage
RRPersistenceHelper.javaAPI DocGlassfish v2 API5695Fri May 04 22:33:36 BST 2007com.sun.enterprise.admin.event

RRPersistenceHelper

public class RRPersistenceHelper extends Object
Restart event Helper - class providing support for informing server(s) to set its(their) restart required state to true or false.
author:
Satish Viswanatham

Fields Summary
private static final Logger
_logger
Constructors Summary
public RRPersistenceHelper()

    
      
    
Methods Summary
public voidsetRestartRequired(java.lang.String inst, boolean restart)
Set the restart required status in the given instance name

param
inst Local server instance name
param
restart boolen value for restart required flag


        try {
            RMIClient client = AdminChannel.getRMIClient(inst);
            if (client == null) {
                _logger.log(Level.INFO, "event.rmi_client_not_found");
            } else {
                client.setRestartNeeded(restart); 
            }
        } catch (Throwable t) {
            _logger.log(Level.INFO,
                "event.exception_during_restart_reset", t);
        }
    
public voidsetRestartRequired(boolean restart)
Set the restart required status in the current instance. Server Runtime MBean calls this method to set the restart required state from DAS.

param
restart boolen value for restart required flag

        String inst =  null;
        ServerContext svrCtx = ApplicationServer.getServerContext();
        if (svrCtx !=null) {
            inst = svrCtx.getInstanceName();
        }
        setRestartRequired(inst, restart);
    
public voidsetRestartRequiredForServer(com.sun.enterprise.admin.event.AdminEvent event, com.sun.enterprise.admin.event.AdminEventResult result)
Set the restart required status in the given instance name if the result code is not success

param
evt Admin Event that is being sent
param
result Result of the Admin Event


        if (AdminService.getAdminService() == null) {
            // This instance does not have admin service return null
            return;
        }

        String resCode = null;
        // the follows tests this is server or DAS
        try {
            if (result != null) {
                resCode = result.getResultCode();
            }
            if ((resCode == null) || 
                (!resCode.equals(AdminEventResult.SUCCESS)) ){

                if (event != null) {
                    setRestartRequired( event.getInstanceName(), true);
                }
            }
        } catch (Throwable t) {
           _logger.log(Level.INFO, "event.exception_during_restart_reset",t);
        }