Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.modules
Class SModule

java.lang.Object
  |
  +--com.pdmfc.tea.modules.SModule
Direct Known Subclasses:
SModuleCore, SModuleHtml, SModuleIO, SModuleLang, SModuleList, SModuleMath, SModuleRegexp, SModuleString, SModuleTdbc, SModuleTos, SModuleXml

public class SModule
extends java.lang.Object

Provides basic functionality common to most implementations of modules.


Constructor Summary
SModule()
           
 
Method Summary
protected  void addJavaFunction(java.lang.String functionName, java.lang.String methodName)
          Registers a Tea function implemented as a method of this SModule instance.
 void end()
          Signals that the package will no longer be used.
 void init(STeaRuntime context)
          Populates the context with commands and variables.
 void start()
          Signals that the package will be used shortly after.
 void stop()
          Signals that the package will not be used until a call to the start() method is made again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SModule

public SModule()
Method Detail

init

public void init(STeaRuntime context)
          throws STeaException
Populates the context with commands and variables. If this method is redefined in a derived class then the implementation in the derived class is always expected to call this implementation.
Parameters:
context - Reference to the STeaRuntime object to be populated.

end

public void end()
Signals that the package will no longer be used. That means that the commands that may have been created inside the SContext passed to the init() method will not be used again. Resources allocated to the commands may be freed. This implementation does nothing.

start

public void start()
Signals that the package will be used shortly after. This implementaion does nothing.

stop

public void stop()
Signals that the package will not be used until a call to the start() method is made again. This implementation does nothing.

addJavaFunction

protected void addJavaFunction(java.lang.String functionName,
                               java.lang.String methodName)
Registers a Tea function implemented as a method of this SModule instance. Calls to this method must be performed before the call to the init(STeaRuntime) method. That means that this method is tipically called from within the derived class constructor.
Parameters:
functionName - The name of the Tea function to create.
methodName - The name of the Java method in the derived class that will be called when the Tea function gets executed.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.