Keel 2.1RC2

org.keel.services.script.jelly
Class JellyScript

java.lang.Object
  extended byorg.keel.core.container.AbstractKeelServiceable
      extended byorg.keel.services.script.jelly.JellyScript
All Implemented Interfaces:
Configurable, Initializable, LogEnabled, OutputCapableScript, Script, Serviceable

public class JellyScript
extends AbstractKeelServiceable
implements Configurable, Initializable, LogEnabled, OutputCapableScript

This is an implementation of the Keel Script service, based on the Jakarta Jelly XML scripting package.

Version:
$Revision: 1.4 $ $Date: 2003/07/19 14:42:43 $
Author:
Schatterjee Created on Jun 14, 2003

Field Summary
private  Configuration config
           
private  JellyContext jelly
           
private  Logger logger
           
 
Fields inherited from class org.keel.core.container.AbstractKeelServiceable
 
Fields inherited from interface org.keel.services.script.OutputCapableScript
ROLE
 
Constructor Summary
JellyScript()
           
 
Method Summary
 void configure(Configuration configuration)
          Pass the Configuration to the Configurable class.
 void enableLogging(Logger logger)
          Provide component with a logger.
 void execute(java.lang.String script)
          Run the script in the named file
 void execute(java.lang.String script, java.io.Writer someWriter)
          Execute and put output generated by the script into provided Writer
 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 initialize()
          Initialize the component.
 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
 
Methods inherited from class org.keel.core.container.AbstractKeelServiceable
getService, getService, getService, getService, getServiceManager, getServiceSelector, releaseService, releaseServices, service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private Logger logger

config

private Configuration config

jelly

private JellyContext jelly
Constructor Detail

JellyScript

public JellyScript()
Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Description copied from interface: Configurable
Pass the Configuration to the Configurable class.

Specified by:
configure in interface Configurable
Parameters:
configuration - the class configurations. Must not be null.
Throws:
ConfigurationException - if an error occurs
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

enableLogging

public void enableLogging(Logger logger)
Description copied from interface: LogEnabled
Provide component with a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger. Must not be null.
See Also:
LogEnabled.enableLogging(org.apache.avalon.framework.logger.Logger)

initialize

public void initialize()
                throws java.lang.Exception
Description copied from interface: Initializable
Initialize the component. Initialization includes allocating any resources required throughout the component's lifecycle.

Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception - if an error occurs
See Also:
Initializable.initialize()

expose

public void expose(java.lang.Object o,
                   java.lang.String name)
Description copied from interface: Script
Expose a Java object to the script context

Specified by:
expose in interface Script
Parameters:
o - The object to expose
name - The name the object will be referred to by
See Also:
Script.expose(java.lang.Object, java.lang.String)

expose

public void expose(java.lang.Object o,
                   java.lang.String name,
                   java.lang.String scope)
Description copied from interface: Script
Expose a java object to the script context, with a scoped name

Specified by:
expose in interface Script
Parameters:
o - The object to expose
name - The name the object will be referred to by
scope - The scope for the name
See Also:
Script.expose(java.lang.Object, java.lang.String, java.lang.String)

retrieve

public java.lang.Object retrieve(java.lang.String name)
Description copied from interface: Script
Get an object from the script context

Specified by:
retrieve in interface Script
Parameters:
name - The name of the object to retrieve
Returns:
The retrieved object
See Also:
Script.retrieve(java.lang.String)

retrieve

public java.lang.Object retrieve(java.lang.String name,
                                 java.lang.String scope)
Description copied from interface: Script
Get an object from the script context, with a scoped name

Specified by:
retrieve in interface Script
Parameters:
name - The name of the object to retrieve
scope - The scope for the name
Returns:
The retrieved object
See Also:
Script.retrieve(java.lang.String, java.lang.String)

remove

public void remove(java.lang.String name)
Description copied from interface: Script
Delete an object from the script context

Specified by:
remove in interface Script
Parameters:
name - The name of the object to delete
See Also:
Script.remove(java.lang.String)

remove

public void remove(java.lang.String name,
                   java.lang.String scope)
Description copied from interface: Script
Delete an object from the script context, with a scoped name

Specified by:
remove in interface Script
Parameters:
name - The name of the object to delete
scope - The scope for the name
See Also:
Script.remove(java.lang.String, java.lang.String)

execute

public void execute(java.lang.String script)
             throws ScriptException
Description copied from interface: Script
Run the script in the named file

Specified by:
execute in interface Script
Parameters:
script - The file name of the script
Throws:
ScriptException - Error from the scripting engine
See Also:
Script.execute(java.lang.String)

execute

public void execute(java.lang.String script,
                    java.io.Writer someWriter)
             throws ScriptException
Description copied from interface: OutputCapableScript
Execute and put output generated by the script into provided Writer

Specified by:
execute in interface OutputCapableScript
Parameters:
script - The file name of the script
someWriter - Stream to put output into
Throws:
ScriptException - Errors from the scripting engine

Keel 2.1RC2

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