Keel 2.1RC2

org.keel.services.script
Interface Script

All Known Subinterfaces:
OutputCapableScript
All Known Implementing Classes:
BSFScript, JellyScript

public interface Script

This is the interface for services that are able to execute some form of an interpreted scripting language. Java objects can be passed to the script from Keel services, and visa-versa.

Version:
$Revision: 1.2 $ $Date: 2003/07/03 15:49:32 $
Author:
Shash Chatterjee Created on Jun 14, 2003

Field Summary
static java.lang.String ROLE
          The Avalon role name for the Script service
 
Method Summary
 void execute(java.lang.String script)
          Run the script in the named file
 void expose(java.lang.Object o, java.lang.String name)
          Expose a Java object to the script context
 void expose(java.lang.Object o, java.lang.String name, java.lang.String scope)
          Expose a java object to the script context, with a scoped name
 void remove(java.lang.String name)
          Delete an object from the script context
 void remove(java.lang.String name, java.lang.String scope)
          Delete an object from the script context, with a scoped name
 java.lang.Object retrieve(java.lang.String name)
          Get an object from the script context
 java.lang.Object retrieve(java.lang.String name, java.lang.String scope)
          Get an object from the script context, with a scoped name
 

Field Detail

ROLE

public static final java.lang.String ROLE
The Avalon role name for the Script service

Method Detail

expose

public void expose(java.lang.Object o,
                   java.lang.String name)
            throws ScriptException
Expose a Java object to the script context

Parameters:
o - The object to expose
name - The name the object will be referred to by
Throws:
ScriptException - Error when the object cannot be exposed

expose

public void expose(java.lang.Object o,
                   java.lang.String name,
                   java.lang.String scope)
            throws ScriptException
Expose a java object to the script context, with a scoped name

Parameters:
o - The object to expose
name - The name the object will be referred to by
scope - The scope for the name
Throws:
ScriptException - Error when the object cannot be exposed

retrieve

public java.lang.Object retrieve(java.lang.String name)
                          throws ScriptException
Get an object from the script context

Parameters:
name - The name of the object to retrieve
Returns:
The retrieved object
Throws:
ScriptException - Error when the object cannot be retrieved

retrieve

public java.lang.Object retrieve(java.lang.String name,
                                 java.lang.String scope)
                          throws ScriptException
Get an object from the script context, with a scoped name

Parameters:
name - The name of the object to retrieve
scope - The scope for the name
Returns:
The retrieved object
Throws:
ScriptException - Error when the object cannot be retrieved

remove

public void remove(java.lang.String name)
            throws ScriptException
Delete an object from the script context

Parameters:
name - The name of the object to delete
Throws:
ScriptException - Error when the object cannot be deleted

remove

public void remove(java.lang.String name,
                   java.lang.String scope)
            throws ScriptException
Delete an object from the script context, with a scoped name

Parameters:
name - The name of the object to delete
scope - The scope for the name
Throws:
ScriptException - Error when the object cannot be deleted

execute

public void execute(java.lang.String script)
             throws ScriptException
Run the script in the named file

Parameters:
script - The file name of the script
Throws:
ScriptException - Error from the scripting engine

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.