Protomatter Application Server v1.0

Package com.protomatter.pas.init

Interfaces for the PAS startup/shutdown facilities.

See:
          Description

Interface Summary
PASShutdown Objects implementing this interface and listed in the configuration file for PAS are run when PAS is shutting down.
PASStartup Objects implementing this interface and listed in the configuration file for PAS are started when PAS is started.
 

Exception Summary
ShutdownException An exception generated while an implementation of the PASShutdown interface was shutting down.
StartupException An exception generated while an implementation of the PASStartup interface was starting.
 

Package com.protomatter.pas.init Description

Interfaces for the PAS startup/shutdown facilities.

Startup/Shutdown Classes

You can specify classes that should be loaded when PAS starts, and you can provide startup arguments to those classes. The same goes for classes to be run when PAS is shut down. The API for these classes is as follows:
    package com.protomatter.init;

    public interface PASStartup
    {
      public String startup(String name, Properties pasProps,
        Properties myProps, Context context)
        throws StartupException;
    }

    public interface PASShutdown
    {
      public String shutdown(String name, Properties pasProps,
        Properties myProps, Context context)
        throws ShutdownException;
    }
    
The behavior is identical for both. The argument "name" is the virtual name that the startup/shutdown class was given in the properties file for PAS. Virtual names are used so that you can have the same class run with multiple configurations.

These classes are defined in the PAS properties file as follows:

    pas.startupClass.NAME = classname
    pas.startupArgs.NAME  = key1=val1,key2=val2,key3=val3,...

    pas.shutdownClass.NAME = classname
    pas.shutdownArgs.NAME  = key1=val1,key2=val2,key3=val3,...
    
The variable "pasProps" is the entire PAS properties file, and the variable "myProps" is the key/value pairs specified as the startupArgs or shutdownArgs for the class. The "context" variable is a javax.naming.Context object that is connected to the PAS JNDI tree.

You can also specify the order of startup and shutdown classes if there's a need for ordering. To do this, simply put the following in your PAS properties file:

    pas.startupClass> = NAME1,NAME2,...,NAMEn,
    pas.shutdownClass  = NAME1,NAME2,...,NAMEn,
    

This specified an optional list of "virtual names" of services to start and/or stop in a given order. Other services not listed here, but specified using the pas.startupClass.NAME and pas.shutdownClass.NAME are run after any whose order is specified.


Protomatter Application Server v1.0
Copyright 1998-2002 Nate Sammons

Protomatter Application Server v1.0 http://protomatter.sourceforge.net/pas/1.0