Tcl Application Initialization/Notification API Library Module

The Tcl application initialization/notification API library module has the file name appinit.tcl. This module has two primary uses. It is used by Future Lab GPL servers to signal other applications that the server initialization is in progress. This module is also used by any application that needs to store and retrieve it's application name outside of the application main module.

Here is a list of procedures in the this library module:

- appinit_start
- appinit_stop
- appinit_waitfor
- appinit_register_name
- appinit_get_name
- appinit_remove_name
- appinit_get_sname

# Module Dependencies

The following modules are required along with this module:

- fio.tcl
- logger.tcl
- logman.tcl

# Module Definition Files

This module requires the definition file:

- stdhead.tcl

# Module Procedures

## appinit_start

    Declaration  : proc appinit_start {sname}
    Parameters   :
          Name   : sname
          Type   : string
    Description  : service name

    Returns      : 1 upon success, 0 otherwise

This procedure will indicate that the application is starting up by creating a zero byte lock file. The service name should be a unique name to identify the application and is usually the socloc service name when dealing with a socket server.

## appinit_stop

    Declaration  : proc appinit_stop {sname}
    Parameters   :
          Name   : sname
          Type   : string
    Description  : service name

    Returns    : 1 upon success, 0 otherwise

This procedure will indicate that the application has completed its initialization by deleting the zero byte lock file. The service name parameter must be the same name used to call appinit_start.

## appinit_waitfor

    Declaration  : proc appinit_waitfor {sname min_timeout}
    Parameters   :
          Name   : sname
          Type   : string
    Description  : service name

          Name   : min_timeout
          Type   : positive integer
    Description  : number of minutes to wait

    Returns      : 1 if the lock file no longer exists, 0 otherwise

This procedure will check for a lock file using the service name and wait up to number of minutes to wait for the lock file to be removed.

## appinit_register_name

    Declaration  : proc appinit_register_name {apname}
    Parameters   :
          Name   : apname
          Type   : string
    Description  : application name

    Returns      : 1 upon success, 0 otherwise

This procedure will load the passed application name into the global appinit_apname.

## appinit_get_name

    Declaration  : proc appinit_get_name {}

    Returns      : application name

This procedure will obtain and return the application name which must already be defined by calling the function appinit_register_name.

## appinit_remove_name

    Declaration  : proc appinit_remove_name {}

    Returns    : 1 upon success, 0 otherwise

This procedure will wipe the current application name stored in appinit_apname.

## appinit_get_sname

    Declaration  : proc appinit_get_sname {oldname newname}
    Parameters   :
          Name   : oldname
          Type   : string
    Description  : input service name

          Name   : newname
          Type   : string
    Description  : output service name

    Returns      : 1 upon success, 0 otherwise

This procedure will translate the input service name. The lock file extension will be appended to the name. Procedure will load the translated name into the output service name.

Goto Top | Tcl Applications | Tcl Software Overview | Tcl Library Overview
| Future Lab Home | Contact Webmaster | Feedback

Copyright © 2005-2006 Future Lab, Last Updated Jul 01, 2006