AIS Middleware API

 

Overview

Lambda Information Server, LambdaRemote, and Analytic Information Server are Hosting Clients for the Analytic Information Server database engine. Analytic Information Server is an in process ActiveX container server. Analytic Information Server always runs on the same machine and in the same process as its application client. LambdaRemote is an out of process ActiveX container server. LambdaRemote always runs in a different process, and possibly a different machine, from its application client. Each client launches a unique copy of LambdaRemote. LambdaShared is an out of process ActiveX container server. LambdaShared always runs in a different process, and possibly a different machine, from its application client. Each client shares a single copy of LambdaShared.

Lambda Information Server/LambdaRemote/LambdaShared fully supports a reflexive ActiveX container interface. Analytic Information Server database engine objects are automatically exported to the application client as ActiveX objects. ActiveX objects, passed by the application client, are automatically imported to the Analytic Information Server database engine as internal Analytic Information Server objects.

Note: The Analytic Information Server/LambdaRemote/LambdaShared class interface is identical. The only difference is whether the programmer wishes in process or out of process execution.

EngineInterface Class

The public class for accessing the Analytic Information Server database engine, via the Analytic Information Server ActiveX component, is named: EngineInterface.

 

Note:                                  

The THREAD id's used by the EngineInterface Class are NOT the same as host operating system threads. OS threads include a multi-threading timer interrupt service, a machine operations          stack, and machine temporary storage; while EngineInterface class THREAD id's include a Analytic Information Server engine operations stack, a Analytic Information Server engine garbage collection stack, and Lambda Information Server engine thread temporary storage. For each OS thread allocated, the EngineInterface Class allocates a matching Analytic Information Server THREAD id.

OpenContext

VARIANT OpenContext(VARIANT contextName, VARIANT memoryBytes,

VARIANT maxThreads);

COM Method

The OpenContext method establishes a link with the Analytic Information Server engine and opens a Analytic Information Server engine context with the specified name.

 

Arguments

 

VARIANT  contextName

The name of the context to open.

VARIANT  memoryBytes

The number of bytes to allocate for the context memory work space (from 3 meg to 400 meg).

VARIANT  maxThreads

The maximum number of Analytic Information Server engine thread structures for this context.

Result

 

return(VARIANT)

The contextID for the context just created. If an error occurs, this will be a negative number as an error code.

CloseContext

VARIANT CloseContext(VARIANT contextID);

COM Method

The CloseContext method destroys the link with the Analytic Information Server engine and closes the Analytic Information Server engine context with the specified name.

 

Arguments

 

VARIANT  contextID

The ID of the context to close.

Result

 

return(VARIANT)

If an error occurs, this will be a negative number as an error code.

AEvals

VARIANT AEvals(VARIANT scriptString);

COM Method

The AEvals method passes a script string to the Analytic Information Server engine for evaluation (asynchronous).  No context ID, thread ID, or call back object are passed to this method, because the method makes a number of assumptions. First, the AEvals method assumes that the context ID is that associated with the "default" context. Second, the AEvals method always creates a new back ground OS thread and allocates a new back ground EngineInterface thread ID. Third, no call back object is passed because the AEvals method assumes that the programmer, to communicate with the asynchronous back ground task, will use the polling interface methods supplied with the EngineInterface class.

If the "default" context has not be opened when the AEvals method is invoked, the AEvals method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

VARIANT  scriptString

The Lisp script string to be evaluated.

Result

 

return(VARIANT)

If the back ground thread was initiated successfully, returns -1; otherwise, returns a string error message.

Eval

VARIANT Eval(VARIANT contextID, VARIANT threadID, VARIANT callBackObject,

VARIANT scriptString);

COM Method

The Eval method passes a script string to the Analytic Information Server engine for evaluation (synchronous).  The Eval method evaluates the script string synchronously using the existing OS thread, in the EngineInterface context ID specified, using the EngineInterface thread ID specified, and with the call back object specified.

If the context ID argument is empty, the Eval method uses the context ID associated with the "default" context. If the "default" context has not be opened when the Eval method is invoked with an empty context ID, the Eval method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the Eval opens a new temporary EngineInterface thread ID.

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  callBackObject

The COM call back object (see callBackObject [virtual] class).

VARIANT  scriptString

The Lisp script string to be evaluated.

Result

 

return(VARIANT)

The result of evaluation with Analytic Information Server engine objects returned as LambdaInterface class objects.

EvalAMP

VARIANT EvalAMP(VARIANT speachActString, VARIANT sessionID, VARIANT httpHeader);

COM Method

The EvalAMP method passes a speech act string to the Analytic Information Server engine for evaluation (see the Lambda Message Protocol document).  No context ID, thread ID, or call back object are passed to this method, because the method makes a number of assumptions. First, the EvalAMP method assumes that the context ID is that associated with the "default" context. Second, the EvalAMP method always uses the existing OS thread and allocates a new temporary EngineInterface thread ID. Third, no call back object is passed because the EvalAMP method assumes that the programmer will not communicate with the synchronous task until it is complete.

If the "default" context has not be opened when the EvalAMP method is invoked, the EvalAMP method will open the "default" context with a memory space of 32 megabytes and one thread. Except in the case where the speech act string contains initialization commands.

 

Arguments

 

VARIANT  speachActString

The speech act string to be evaluated.

VARIANT  sessionID

The application session ID.

VARIANT  httpHeader

The application http header.

Result

 

return(VARIANT)

The result of evaluating the speachActString with Analytic Information Server engine objects returned as LambdaInterface class objects.

Evals

VARIANT Evals(VARIANT contextID, VARIANT threadID, VARIANT callBackObject,

VARIANT scriptString);

COM Method

The Evals method passes a script string to the Analytic Information Server engine for evaluation (synchronous).  The Evals method evaluates the script string synchronously using the existing OS thread, in the EngineInterface context ID specified, using the EngineInterface thread ID specified, and with the call back object specified.

If the context ID argument is empty, the Evals method uses the context ID associated with the "default" context. If the "default" context has not be opened when the Evals method is invoked with an empty context ID, the Evals method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the Evals opens a new temporary EngineInterface thread ID.

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  callBackObject

The COM call back object (see callBackObject [virtual] class).

VARIANT  scriptString

The Lisp script string to be evaluated.

Result

 

return(VARIANT)

The result of evaluation with Analytic Information Server engine objects returned as ascii string object references.

ErrorTrace

VARIANT ErrorTrace(VARIANT contextID, VARIANT threadID, VARIANT toggleSwitch);

COM Method

The ErrorTrace method sets, and returns the Analytic Information Server engine error trace on/off switch. 

If the context ID argument is empty, the ErrorTrace method uses the context ID associated with the "default" context. If the "default" context has not be opened when the ErrorTrace method is invoked with an empty context ID, the ErrorTrace method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the ErrorTrace method uses the thread ID associated with the back ground thread (opened by the AEvals method).

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  toggleSwitch

The error trace toggle switch (0 = off, 1 = on).

Result

 

return(VARIANT)

The resulting state of the error trace switch (0 = off, 1 = on).

GetConsoleLog

VARIANT GetConsoleLog();

COM Method

The GetConsoleLog method returns the contents of the console writeln log written during an AEvals method evaluation or an empty result if the AEvals method has not written to the console writeln log.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the GetConsoleLog method is invoked, the GetConsoleLog method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

Result

 

return(VARIANT)

The contents of the console writeln log written during an AEvals method evaluation.

GetDebugLog

VARIANT GetDebugLog();

COM Method

The GetDebugLog method returns the contents of the debugger dialog log written during an AEvals method evaluation or an empty result if the AEvals method has not written to the debugger dialog log.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the GetDebugLog method is invoked, the GetDebugLog method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

Result

 

return(VARIANT)

The contents of the debugger dialog log written during an AEvals method evaluation.

GetHttpTransferLog

VARIANT GetHttpTransferLog();

COM Method

The GetHttpTransferLog method returns the contents of the http transfer log written during an AEvals method evaluation or an empty result if the AEvals method has not written to the http transfer log.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the GetHttpTransferLog method is invoked, the GetDebugLog method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

Result

 

return(VARIANT)

The contents of the http transfer log written during an AEvals method evaluation.

GetResult

VARIANT GetResult();

COM Method

The GetResult method returns the results of an AEvals method evaluation or an empty result if the AEvals method has not completed. The IsEngineBusy method can also be used to test for AEvals method completion before invoking the GetResult method.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the GetResult method is invoked, the GetResult method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

Result

 

return(VARIANT)

The result of AEvals method evaluation with Analytic Information Server engine objects returned as ascii string object references.

GetValue

VARIANT GetValue(VARIANT contextID, VARIANT threadID, VARIANT symbolName);

COM Method

The GetValue method returns the contents of the specified global symbol name and exports any Analytic Information Server internal objects as ActiveX objects of class LambdaInterface

If the context ID argument is empty, the GetValue method uses the context ID associated with the "default" context. If the "default" context has not be opened when the GetValue method is invoked with an empty context ID, the GetValue method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the GetValue method uses the thread ID associated with the back ground thread (opened by the AEvals method).

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  symbolName

The name of the Analytic Information Server global variable whose contents are to be returned.

Result

 

return(VARIANT)

The contents of the specified global variable with Analytic Information Server engine objects returned as LambdaInterface class objects.

InstructionTrace

VARIANT InstructionTrace(VARIANT contextID, VARIANT threadID, VARIANT toggleSwitch);

COM Method

The InstructionTrace method sets, and returns the Analytic Information Server engine instruction trace on/off switch.

If the context ID argument is empty, the InstructionTrace method uses the context ID associated with the "default" context. If the "default" context has not be opened when the InstructionTrace method is invoked with an empty context ID, the InstructionTrace method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the InstructionTrace method uses the thread ID associated with the background thread (opened by the AEvals method).

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  toggleSwitch

The instruction trace toggle switch (0 = off, 1 = on).

Result

 

return(VARIANT)

The resulting state of the instruction trace switch (0 = off, 1 = on)..

InterruptNow

VARIANT InterruptNow(VARIANT contextID, VARIANT threadID);

COM Method

The InterruptNow method turns on the Analytic Information Server engine interrupt now switch.

If the context ID argument is empty, the InterruptNow method uses the context ID associated with the "default" context. If the "default" context has not be opened when the InterruptNow method is invoked with an empty context ID, the InterruptNow method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the InterruptNow method uses the thread ID associated with the background thread (opened by the AEvals method).

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

Result

 

return(VARIANT)

Always returns 1.

IsEngineBusy

VARIANT IsEngineBusy(VARIANT contextID, VARIANT threadID);

COM Method

The IsEngineBusy method returns the busy state of the EngineInterface context ID and thread ID specified.

If the context ID argument is empty, the IsEngineBusy method uses the context ID associated with the "default" context. If the "default" context has not be opened when the IsEngineBusy method is invoked with an empty context ID, the IsEngineBusy method will return 0 (idle).

If the thread ID argument is empty, the IsEngineBusy method uses the thread ID associated with the back ground thread (opened by the AEvals method).

 

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

Result

 

return(VARIANT)

The resulting busy state of the context ID and thread ID specified (0 = idle, 1 = busy).

SetDebugResponse

VARIANT SetDebugResponse(VARIANT resultValue);

COM Method

The SetDebugResponse method returns the user response to the debugger dialog log written during an AEvals method evaluation.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the SetDebugResponse method is invoked, the SetDebugResponse method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

VARIANT  userResponse

The user response after seeing the contents of the debugger dialog log written during an AEvals method evaluation.

Result

 

return(VARIANT)

Always returns 0.

SetHttpTransferResults

VARIANT SetHttpTransferResults(VARIANT httpResult);

COM Method

The SetHttpTransferResults method returns the results of the http transfer log request, written during an AEvals method evaluation.

No context ID, thread ID, or call back object are passed to this method, because the method always refers to the context ID and thread ID associated with the AEvals method.

If the "default" context has not be opened when the GetHttpTransferResults method is invoked, the GetHttpTransferResults method will open the "default" context with a memory space of 32 megabytes.

 

Arguments

 

VARIANT  httpResult

The http result after responding to contents of the http transfer log written during an AEvals method evaluation.

Result

 

return(VARIANT)

Always returns 0.

SetValue

VARIANT SetValue(VARIANT contextID, VARIANT threadID, VARIANT symbolName,

VARIANT newValue);

COM Method

The SetValue method sets the contents of the specified global symbol name to the specified new value and imports any application client ActiveX objects as internal Analytic Information Server objects of type HostObject.

If the context ID argument is empty, the SetValue method uses the context ID associated with the "default" context. If the "default" context has not be opened when the SetValue method is invoked with an empty context ID, the SetValue method will open the "default" context with a memory space of 32 megabytes.

If the thread ID argument is empty, the SetValue method uses the thread ID associated with the back ground thread (opened by the AEvals method).

 

Arguments

 

VARIANT  contextID

The ID of the context to be used.

VARIANT  threadID

The ID of the thread to be used.

VARIANT  symbolName

The name of the Analytic Information Server global variable whose contents are to be set.

VARIANT  newValue

The new value.

Result

 

return(VARIANT)

The contents of the specified global variable with Analytic Information Server engine objects returned as LambdaInterface class objects.