Building Distributed
Applications
Using the Progress AppServer
Startup and Shutdown Procedures
Startup and Shutdown procedures encapsulate logic that executes during the startup and shutdown of an AppServer. In effect, the logic in these procedures executes in each Application Server process as it starts up and shuts down. Functionality that might go in a Startup or Shutdown procedure includes connecting or disconnecting databases, loading or storing the contents of temporary tables, and instantiating or deleting certain local persistent procedures.
Startup Procedure
A Startup procedure executes as an Application Server process starts up. You can specify the name of an AppServer Startup procedure using the Progress Explorer GUI or by setting the
srvrStartupProc
property in the AppServer properties file (ubroker.properties
).The Startup procedure takes a character string as an input parameter, for example:
You can set the value for this parameter in the properties file using the
srvrStartupProcParam
property, and you can set it to any arbitrary value. If you do not specify a value for this property, the parameter is set to the unknown value (?) when the Application Server process executes the Startup procedure.The Startup procedure is automatically executed as a persistent procedure within each Application Server process when the Application Server process first starts. The persistent procedure is automatically deleted just before the process terminates. If you do not need the context established by the Startup procedure, you can delete the persistent procedure within an Application Server process context by executing the DELETE PROCEDURE (or DELETE OBJECT) statement using the appropriate procedure handle.
If the Startup procedure completes with no error, the AppServer starts up successfully. If the Startup procedure completes with an error return value (RETURN ERROR statement), AppServer startup fails and the Application Server process is terminated.
Shutdown Procedure
A Shutdown procedure executes just before the Application Server process is shut down. A Shutdown procedure takes no parameters. You can specify the name of an AppServer Shutdown procedure using the Progress Explorer GUI or by setting the
srvrShutdownProc
property in the AppServer properties file (ubroker.properties
).Unlike the Startup procedure, the Shutdown procedure is run as a non-persistent procedure, and any errors propagated by the Shutdown procedure are simply ignored. The Application Server process terminates immediately after the Shutdown procedure executes.
Usage Requirements
You can specify Startup and Shutdown procedures for a state-aware or stateless AppServer. You cannot specify Startup and Shutdown procedures for a state-reset AppServer.
Note that both the Startup and Shutdown procedures are optional. There is no requirement to specify either or both of them. Additionally, the content of these procedures is completely application specific, and the AppServer architecture places no constraints on it. Any 4GL logic that is valid within an Application Server process is valid for these procedures.
NOTE: In Progress Version 8, you used the Connect procedure to program all startup activities on an Application Server process. With the introduction of reusable and stateless servers much of the logic that you might have put into the Connect procedure for the Version 8 AppServer is now more appropriate for the Startup procedure. Similarly, much of the logic in a Version 8 Disconnect procedure might be more appropriate for the Shutdown procedure.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |