FileDocCategorySizeDatePackage
AdminServiceLifeCycle.javaAPI DocGlassfish v2 API6329Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.server.core

AdminServiceLifeCycle

public class AdminServiceLifeCycle extends com.sun.appserv.server.ServerLifecycleImpl
Lifecycle manager for admin service.

Fields Summary
public static final byte
STATUS_NOT_STARTED
Constant denoting the status of admin service not started
public static final byte
STATUS_SHUTDOWN
Constant denoting the status of admin service shutdown started
public static final byte
STATUS_INITED
Constant denoting the status of admin service initialized
public static final byte
STATUS_STARTED
Constant denoting the status of admin service started
public static final byte
STATUS_READY
Constant denoting the status of admin service ready
public static final byte
STATUS_TERMINATED
Constant denoting the status of admin service terminated
private byte
serverStatus
Constructors Summary
public AdminServiceLifeCycle()
Default constructor


           
      
        serverStatus = STATUS_NOT_STARTED;
    
Methods Summary
public voidonInitialization(com.sun.enterprise.server.ServerContext sc)
Server is initializing admin server and setting up the runtime environment. Prepare for the beginning of active use of the public methods of admin server. This method is called before any of the public methods of admin server are utilized.

param
sc ServerContext the server runtime context.
exception
IllegalStateException if this subsystem has already been started
exception
ServerLifecycleException if this subsystem detects a fatal error that prevents this subsystem from being used

        if ((serverStatus & STATUS_INITED) == STATUS_INITED) {
            throw new IllegalStateException("Admin Server already initialized");
        }
        AdminService srv = AdminService.createAdminService(sc);
        srv.init();
        serverStatus = STATUS_INITED;
    
public voidonReady(com.sun.enterprise.server.ServerContext sc)
Server has completed loading the services and is ready to serve requests.

param
sc ServerContext the server runtime context.
exception
ServerLifecycleException if this subsystem detects a fatal error that prevents this subsystem from being used

        AdminService.getAdminService().ready();
        serverStatus |= STATUS_READY;
    
public voidonShutdown()
Server is shutting down applications

exception
ServerLifecycleException if this subsystem detects a fatal error that prevents this subsystem from being used

        serverStatus |= STATUS_SHUTDOWN;
        AdminService.getAdminService().stop();
    
public voidonStartup(com.sun.enterprise.server.ServerContext sc)
Server is starting up applications

param
sc ServerContext the server runtime context.
exception
ServerLifecycleException if this subsystem detects a fatal error that prevents this subsystem from being used

        AdminService.getAdminService().start();
        serverStatus |= STATUS_STARTED;
    
public voidonTermination()
Server is terminating the subsystems and the runtime environment. Gracefully terminate the active use of the public methods of this subsystem. This method should be the last one called on a given instance of this subsystem.

exception
ServerLifecycleException if this subsystem detects a fatal error that prevents this subsystem from being used

        AdminService.getAdminService().destroy();
        serverStatus = STATUS_TERMINATED;