org.apache.cocoon.components.xscript
Class XScriptManagerImpl

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.components.xscript.XScriptManagerImpl
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.framework.thread.ThreadSafe, XScriptManager

public class XScriptManagerImpl
extends org.apache.avalon.framework.logger.AbstractLoggable
implements XScriptManager, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.framework.thread.ThreadSafe

The actual implementation of the XScriptManager interface.

Since:
August 4, 2001
Version:
CVS $Id: XScriptManagerImpl.java,v 1.6 2002/02/22 07:00:15 cziegeler Exp $
Author:
Ovidiu Predescu

Field Summary
protected  org.apache.avalon.framework.component.ComponentManager manager
          The ComponentManager instance.
 
Fields inherited from interface org.apache.cocoon.components.xscript.XScriptManager
ALL_SCOPES, GLOBAL_SCOPE, PAGE_SCOPE, ROLE, SESSION_SCOPE, XSCRIPT_NS
 
Constructor Summary
XScriptManagerImpl()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
           
 XScriptObject get(java.lang.String name, int scope, java.lang.String context)
          Obtains the object value of the name variable in scope.
 XScriptObject getFirst(java.lang.String name, java.lang.String sessionContext, java.lang.String pageContext)
          Search for the first occurence of the variable name.
 void parameterize(org.apache.avalon.framework.parameters.Parameters params)
           
 void put(java.lang.String name, XScriptObject value, int scope, java.lang.String context)
          Defines or overwrites the value of variable name in scope.
 void register(XScriptObject object)
           
 void remove(java.lang.String name, int scope, java.lang.String context)
          Removes a variable previously declared in scope within context.
 void removeFirst(java.lang.String name, java.lang.String sessionContext, java.lang.String pageContext)
          Remove the first appearance of name in the all the currently accessible scopes.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected org.apache.avalon.framework.component.ComponentManager manager
The ComponentManager instance.
Constructor Detail

XScriptManagerImpl

public XScriptManagerImpl()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

register

public void register(XScriptObject object)

parameterize

public void parameterize(org.apache.avalon.framework.parameters.Parameters params)
                  throws org.apache.avalon.framework.parameters.ParameterException
Specified by:
parameterize in interface org.apache.avalon.framework.parameters.Parameterizable

get

public XScriptObject get(java.lang.String name,
                         int scope,
                         java.lang.String context)
                  throws java.lang.IllegalArgumentException
Description copied from interface: XScriptManager
Obtains the object value of the name variable in scope. The context parameter is interpreted differently depending on the value of scope, as follows:
Specified by:
get in interface XScriptManager
Following copied from interface: org.apache.cocoon.components.xscript.XScriptManager
Parameters:
name - a String value
scope - an int value
context - a String value whose interpretation depends on scope
Returns:
a XScriptObject value

getFirst

public XScriptObject getFirst(java.lang.String name,
                              java.lang.String sessionContext,
                              java.lang.String pageContext)
                       throws java.lang.IllegalArgumentException
Description copied from interface: XScriptManager
Search for the first occurence of the variable name.

The search happens first in the session scope identified by sessionContext. If no variable is found here, the search continues in the page scope identified by pageContext. If no variable is found here, it's finally searched in the global scope.

The XScriptObject value of the variable is returned if a variable is found in one of the scopes, otherwise an exception is thrown.

Specified by:
getFirst in interface XScriptManager
Following copied from interface: org.apache.cocoon.components.xscript.XScriptManager
Parameters:
name - a String value
sessionContext - a String value
pageContext - a String value
Returns:
a XScriptObject value
Throws:
java.lang.IllegalArgumentException - if an error occurs

put

public void put(java.lang.String name,
                XScriptObject value,
                int scope,
                java.lang.String context)
Description copied from interface: XScriptManager
Defines or overwrites the value of variable name in scope. The context argument is interpreted as described in XScriptManager.get(String, int, String).
Specified by:
put in interface XScriptManager
Following copied from interface: org.apache.cocoon.components.xscript.XScriptManager
Parameters:
name - a String value
value - a XScriptObject value
scope - an int value
context - a String value whose interpretation depends on scope

remove

public void remove(java.lang.String name,
                   int scope,
                   java.lang.String context)
            throws java.lang.IllegalArgumentException
Description copied from interface: XScriptManager
Removes a variable previously declared in scope within context. Such a variable could be declared using the XScriptManager.put(String, XScriptObject, int, String) method.
Specified by:
remove in interface XScriptManager
Following copied from interface: org.apache.cocoon.components.xscript.XScriptManager
Parameters:
name - a String value
scope - an int value
context - a String value

removeFirst

public void removeFirst(java.lang.String name,
                        java.lang.String sessionContext,
                        java.lang.String pageContext)
                 throws java.lang.IllegalArgumentException
Description copied from interface: XScriptManager
Remove the first appearance of name in the all the currently accessible scopes. The search happens as described in XScriptManager.getFirst(String,String,String).
Specified by:
removeFirst in interface XScriptManager
Following copied from interface: org.apache.cocoon.components.xscript.XScriptManager
Parameters:
name - a String value
sessionContext - a String value
pageContext - a String value
Throws:
java.lang.IllegalArgumentException - if an error occurs


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.