This function provides linkage to server IMODs. It also provides services to the server IMODs themselves, permitting easy implementation of the server IMOD conventions.
Form 1:
x = $SERVER(REQUEST,service,[arg],[control])
Form 2:
$SERVER(action,service,imod,[desc])
Form 3:
$SERVER(command,service,[option])
Form 4:
$SERVER(INTERNAL,[service],subcmd,[reqimid,reqstk],[retstk],[string])
Parameters
Result string from the server IMOD.
Queues a request for execution by a server IMOD.
Name of the service to be invoked.
Argument string to be passed to the server IMOD. The content of this string depends on the service being requested.
A control option. Specify:
Returns control after the request is processed.
Queues the request and returns control immediately to the requestor.
Action to be taken. Specify:
Defines or redefines a new server IMOD to the system.
Deletes an existing server IMOD definition. Deleting an operating server IMOD does not affect it in any way, except that its existence becomes unknown to the system for any future requests or commands.
Name of the IMOD that is invoked to start the named server.
Description of the service. This description is made available for reports and displays.
Command to be issued to the server IMOD. This can be one of the predefined server commands that are listed in "Server Commands" or another command that the server specifically supports.
Modifiers that affect how the server IMOD executes a command. The options are listed with the server commands in the following section.
Indicates that the request deals with the internal operation of a server IMOD. The INTERNAL requests are only made from within a server IMOD and provide a convenient mechanism for providing standard services.
Tailors the INTERNAL service by the specification of subcommands that are listed in "INTERNAL Subcommands".
IMOD ID of the IMOD task that originated a request.
Stack number, where results of a request are returned.
Stack number that contains stack records to return.
Default: Current stack
String of data to be returned to the requesting IMOD task.
In addition to REQUEST, DEFINE and DELETE, a series of commands have been defined for operating server IMODs:
Cancels the server IMOD. Avoid this command because the current request (and all queued requests) is abandoned and the requesting IMODs are not notified.
Cancels the current server IMOD and starts a new server. The queued requests are transferred to the new server.
Transfers all queued requests to the current stack of the IMOD task issuing the command.
Returns information about all currently defined servers on the stack. The first character of each stack record serves as a delimiter character. The returned fields, in order, are Service, IMOD name, IMOD task ID (if running), and Description.
Continues to permit requests to be queued, but does not permit processing of any requests from the queue.
Prevents acceptance of any further requests for queuing. Processing of queued requests is deferred.
Fails each request in the current request stack and notifies any waiting requestors of the failure.
Prevents queuing of more requests, but permits processing of any queued requests.
Deletes all unprocessed requests. Processing is not performed and the requestors are not notified.
Cancels the effects of any outstanding HOLD, PAUSE, or QUIESCE.
Starts the named service. Any specified options are passed to the server IMOD in the argument string, following the service name.
Returns the status of a particular server IMOD on the stack. The returned information is formatted for display purposes.
Performs a QUIESCE function and then a TERMINATE function when all queued requests have been completed.
Terminates processing immediately. Ignores any unprocessed requests.
Returns the current status of the server as the result. Values are UNDEFINED, STOPPED, STOPPING, PAUSED, HOLDING, QUIESCED, and AVAILABLE.
The INTERNAL service is used only from within a server IMOD. It permits the easy implementation of server IMOD conventions and standardized coding. The following lists each available subcommand and any modifiers that are appropriate. For a detailed explanation and examples of writing server IMODs, see the server IMOD administrating topics.
Intercepts all COMMAND functions and handles them without the knowledge of the server. The interception and execution are performed whenever the WAIT subcommand is issued. The effect of AUTO can be canceled with the NOAUTO subcommand.
Posts a request as complete and returns the results to the requesting IMOD. This option requires specification of reqimod and reqstk. You can use string to return a result string.
Prevents the processing of any additional requests. Requests continue to be queued. Commands continue to be processed.
Cancels a previously issued AUTO subcommand.
Prevents queuing of more requests. Processing of any queued requests is deferred.
Fails each request in the current request stack and notifies waiting requestors. If string is specified, it is returned as the result. If omitted, the results are: FAILED: REQUEST PURGED.
Prevents further requests from being queued. The WAIT subcommand returns commands and queued requests.
Deletes all entries from the request stack. Processing is not performed and waiting requestors are not notified. Use extreme care when using this option.
Cancels the effects of any outstanding HOLD, PAUSE, or QUIESCE.
Performs all functions necessary to establish a server IMOD. Invoke this service once when the server IMOD task is first started.
Terminates processing immediately. Any unprocessed requests are ignored and discarded.
Waits for a command or request to be entered. The returned value is REQUEST (indicating that a request has been received), COMMAND (if a command is processed), TERMINATE (if immediate termination is to occur), or FAIL: text (if a failure has occurred).
For more information and examples of coding and using server IMODs, see server IMOD administrating topics.
The $SERVER() function returns various result strings, depending on the request. All requests can return a result in the form: FAIL: text, where text is descriptive of the condition causing the failure.
In lieu of specific results, the string SUCCESS is returned to the caller.
Copyright © 2014 CA Technologies.
All rights reserved.
|
|