Kbase P102861: How to create a connect procedure for AppServer 8.x
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/6/2005 |
|
Status: Unverified
GOAL:
How to create a connect procedure for AppServer 8.x
GOAL:
How to use Appserver's -con startup parameter.
FACT(s) (Environment):
Progress 8.x
FIX:
An AppServer Connect Procedure can be specified with the (-con) startup parameter on the application broker like this:
_proapsv -S <Appserver service name > -N TCP -con <Connect procedure name>
The connect procedure will run as a persistent procedure, by a newly created application server, as part of the connect process that is initiated when a requesting application executes the CONNECT() method on a server handle.
You can use this procedure to authenticate a requesting application's request for a connection, or to perform any other initialization steps that you want executed each time an application server is created on an as needed startup basis, or when the requesting application initiates an explicit connection request via the CONNECT() Method on the server handle when the prestart option is used. For example, you might use it to connect to a database or to other application servers.
The AppServer Connect procedure startup parameter is optional. If you specify it, then the AppServer Connect procedure requires three character input parameters. The following is an example of how you can define these input parameters.
DEFINE INPUT PARAMETER user_id AS CHARACTER.
DEFINE INPUT PARAMETER password AS CHARACTER.
DEFINE INPUT PARAMETER app_server_info AS CHARACTER.
When the AppServer Connect procedure is run, the values of these three parameters will be the same as the corresponding parameters specified via the CONNECT() method. If a value is not specified for a parameter to the CONNECT() method, the AppServer Connect procedure receives the unknown value (?) for that parameter.
PROGRESS does not examine the values passed from the CONNECT() method to an AppServer Connect procedure. The name of each character input parameter might suggest the content you define for it. For example, the user_id can contain username information, the password can contain password information, and the app_server_info can contain other user-defined information needed by the AppServer Connect procedure to complete a connection. However, the requirement to specify a particular value for the CONNECT() method is based only on the implementation of your AppServer Connect procedure. After examining the values provided to the AppServer Connect procedure, you can reject the connection request from the requesting application by terminating the procedure with the RETURN ERROR statement.