FileDocCategorySizeDatePackage
AMXLifecycleModule.javaAPI DocGlassfish v2 API4997Fri May 04 22:23:40 BST 2007com.sun.enterprise.management.support

AMXLifecycleModule

public final class AMXLifecycleModule extends Object implements com.sun.appserv.server.LifecycleListener

Fields Summary
private final String
NEWLINE
Constructors Summary
public AMXLifecycleModule()

	    NEWLINE = System.getProperty( "line.separator" );
	
Methods Summary
private voiddumpInfo(int eventType, com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    final String msg    = "AMXLifecycleModule: " + eventType + NEWLINE +
	        "InstallRoot: " + context.getInstallRoot() + NEWLINE +
	        "InstanceName: " + context.getInstanceName() + NEWLINE +
	        "CmdLineArgs: " + StringUtil.toString( " ", (Object[])context.getCmdLineArgs() ) + NEWLINE +
	        "Properties: " + NEWLINE +
	        MapUtil.toString( props, NEWLINE ) + NEWLINE;
	    
	    context.log( msg );
	        
	
public voidhandleEvent(com.sun.appserv.server.LifecycleEvent event)

        final int  type  = event.getEventType();
        
        final Properties    props   = (Properties)event.getData();
        final LifecycleEventContext context = event.getLifecycleEventContext();
        
        dumpInfo( type, context, props );
        
        if ( type == INIT_EVENT )
        {
            init( context, props );
        }
        else if ( type == STARTUP_EVENT )
        {
            startup( context, props );
        }
        else if ( type == READY_EVENT )
        {
            ready( context, props );
        }
        else if ( type == SHUTDOWN_EVENT )
        {
            shutdown( context, props );
        }
        else if ( type == TERMINATION_EVENT )
        {
            terminate( context, props );
        }
        else
        {
            throw new IllegalArgumentException( "eventType: " + type );
        }
    
private voidinit(com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    context.log( "AMXLifecycleModule: init" );
	
private voidready(com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    context.log( "AMXLifecycleModule: ready" );
	
private voidshutdown(com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    context.log( "AMXLifecycleModule: shutdown" );
	
private voidstartup(com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    context.log( "AMXLifecycleModule: startup" );
	
private voidterminate(com.sun.appserv.server.LifecycleEventContext context, java.util.Properties props)

	    context.log( "AMXLifecycleModule: terminate" );