FileDocCategorySizeDatePackage
AppServWSMgmtAdminLifeCycle.javaAPI DocGlassfish v2 API7781Fri May 04 22:24:42 BST 2007com.sun.enterprise.admin.wsmgmt.lifecycle

AppServWSMgmtAdminLifeCycle

public class AppServWSMgmtAdminLifeCycle extends com.sun.appserv.server.ServerLifecycleImpl
Lifecycle manager for web services management administration service.
author
Nazrul Islam
since
J2SE 5.0

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


           
      
        serverStatus = STATUS_NOT_STARTED;
    
Methods Summary
public voidonInitialization(com.sun.enterprise.server.ServerContext sc)
Server is initializing ws mgmt admin service and setting up the runtime environment.

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(
                "WS Mgmt Admin is already initialized");
        }
        DeploymentEventManager.addListener(new AppServDELImpl());

        // register dynamic reconfig listeners
        AdminEventListenerRegistry.addEventListener(
            WebServiceEndpointEvent.eventType, 
            new WebServiceEndpointEventListenerImpl());

        AdminEventListenerRegistry.addEventListener(
            TransformationRuleEvent.eventType, 
            new TransformationRuleEventListenerImpl());
        
        AdminEventListenerRegistry.addEventListener(
            RegistryLocationEvent.eventType, 
            new RegistryLocationEventListenerImpl());
        

        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

        serverStatus |= STATUS_READY;

        // registers the global listener with jwsdp runtime
        ListenerManager.getInstance().register();

    
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;
        
        // shuts down message trace
        MessageTraceMgr msgTraceMgr = MessageTraceMgr.getInstance();
        if ( msgTraceMgr != null) {
            msgTraceMgr.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

        serverStatus |= STATUS_STARTED;

        // initializes message trace
        MessageTraceMgr msgTraceMgr = MessageTraceMgr.getInstance();
        if ( msgTraceMgr != null) {
            msgTraceMgr.init();
        }
    
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

        serverStatus = STATUS_TERMINATED;