org.apache.cocoon.components.flow.javascript.fom
Class JavaScriptAspectWeaver

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.components.flow.javascript.fom.JavaScriptAspectWeaver
All Implemented Interfaces:
LogEnabled, Serviceable

public class JavaScriptAspectWeaver
extends AbstractLogEnabled
implements Serviceable

The JavaScriptAspectWeaver provides functionality to intercept JavaScript functions

Known restrictions, to be implemented, open questions:

Since:
Sept, 2003
Version:
CVS $Id: JavaScriptAspectWeaver.java 56992 2004-11-09 03:22:45Z cziegeler $
Author:
Reinhard Poetz

Constructor Summary
JavaScriptAspectWeaver()
           
 
Method Summary
protected  void addInterceptorGroup(String source)
          Add a group of interceptor tokens to the AspectWeaver.
 boolean areScriptsApplied()
           
protected  void clearInterceptorGroups()
          Reset the variable containing all interceptions
 Reader getInterceptedScriptAsReader()
          Get the intercepted base script (all interceptions found in cocoon.apply(..) are added to the script.
static char[] readSourceIntoCharArray(InputStream is)
          Convert an input stream into an array of char
 void service(ServiceManager manager)
           
 void setBaseScript(Source source)
          Set the base script (the script which is scanned for applied intercepting scripts) and if scripts are applied those are scanned the code is added to interceptorGroups
 void setSerializeResultScriptParam(boolean serialize)
          Should the JavaScriptAspectWeaver write the result script into separate file in the same directory as the basescript?
 void setStopExecutionFunctionsConf(Configuration conf)
          Provide configuration (part of the Interpreter configuration)
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptAspectWeaver

public JavaScriptAspectWeaver()
Method Detail

setBaseScript

public void setBaseScript(Source source)
                   throws Exception
Set the base script (the script which is scanned for applied intercepting scripts) and if scripts are applied those are scanned the code is added to interceptorGroups

Throws:
Exception

getInterceptedScriptAsReader

public Reader getInterceptedScriptAsReader()
                                    throws Exception
Get the intercepted base script (all interceptions found in cocoon.apply(..) are added to the script.

Throws:
Exception

addInterceptorGroup

protected void addInterceptorGroup(String source)
                            throws Exception
Add a group of interceptor tokens to the AspectWeaver. Note that the order is important if more interceptions match. (The first applied script is added first, ...)

Throws:
Exception

setSerializeResultScriptParam

public void setSerializeResultScriptParam(boolean serialize)
Should the JavaScriptAspectWeaver write the result script into separate file in the same directory as the basescript?


setStopExecutionFunctionsConf

public void setStopExecutionFunctionsConf(Configuration conf)
                                   throws ConfigurationException
Provide configuration (part of the Interpreter configuration)

Throws:
ConfigurationException

clearInterceptorGroups

protected void clearInterceptorGroups()
Reset the variable containing all interceptions


readSourceIntoCharArray

public static char[] readSourceIntoCharArray(InputStream is)
                                      throws IOException
Convert an input stream into an array of char

Throws:
IOException

areScriptsApplied

public boolean areScriptsApplied()

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.