Table of Contents

OIL2 Class Standard.CreateObjects

class Standard . CreateObjects {
        assoc   acl;
        oid     client;
        int32   dontDelete;
        any     extraEnvironment;
        int32   lineCount;
        oid     myOID;
        oid     readObj;
        array   releaseThreadList;
        int32   sawEOF;
        oid     sleepingThread;
        array   terminateThreadList;
inherits from Object;


The class CreateObjects provides a standard means for reading run command (usually known as rc) files. An object of this class is automatically created to process the boot script of a FARGOS/VISTA Object Management Environment daemon.



CreateObjects:create(any fileName, optional assoc extraEnvVars, optional assoc defaultACL, optional int32 dontAutoDelete)

Method Description

The first argument, fileName, is mandatory and specifies the source of the commands. It is passed to a ReadAndProcessFile object without modification, so it can be a file name specification or the object Id of an existing IOobject or allomorphic equivalent. The optional argument extraEnvVars can be used to provided additional environent variables for substitution during processing of the file. During the boot process, ancilliary data is provided expose command line argument not directly consumed by the core; these are exposed as ARGC and variables such as ARGV0, ARGV1, etc. An optional argument defaultACL can be passed to specify the access control list for the ReadAndProcessFile object; if not provided or specified as nil, the access control list is created by the makeDefaultACL() function. The access control list is also provided to ReadAndProcessFile for use, if necessary, in the creation of an IOobject.

By default, CreateObjects objects automatically deleted themselves when a file has been processed. The optional Boolean argument dontAutoDelete can override this behavior. This is typically used in conjunction with the method getLineTotal to perform synchronization.

When reading lines of data from the file, anything after a "#" character is treated as a comment. While it is traditional to have a comment standing alone on a line, this is not required. The thread context and process environment variables will be substituted for $VARNAME patterns. A common usage is illustrated below:

LoadOIL2File file:$VISTA_ROOT/oil2anf/clTest.o2o

A line that begins with exit will cause further processing to be halted.



Method Description

The getLineTotal method returns the number of lines processed. If end-of-file has not been reached at the time getLineTotal is invoked, then returning of a result is delayed until end-of-file. This provides a convenient mechanism for synchronization.

Return Value

An integer value indicating the number of lines read from the command file.