net.sf.sasl.aop
Class AbstractPlaceholderScriptUsingAspect

java.lang.Object
  extended by net.sf.sasl.aop.AbstractRootAspect
      extended by net.sf.sasl.aop.AbstractPlaceholderScriptUsingAspect
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.core.PriorityOrdered
Direct Known Subclasses:
GenericLogAspect, ThresholdMethodExecutionTimeWarnAspect

public abstract class AbstractPlaceholderScriptUsingAspect
extends AbstractRootAspect

Could be used as super class for all aspects which offer placeholder script support for formatting text, messages, etc.

Since:
0.0.2 (sasl-common-aspect-library)
Author:
Philipp Förmer

Field Summary
protected  IPlaceholderResolverSymbolTable placeholderSymbolTable
          List of placeholder resolvers which will be passed to the placeholder script resolver interpreter.
 
Fields inherited from class net.sf.sasl.aop.AbstractRootAspect
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AbstractPlaceholderScriptUsingAspect()
           
 
Method Summary
 IPlaceholderResolverSymbolTable getPlaceholderSymbolTable()
           
protected  String runInterpreter(ScriptNode script, TargetMethodExecutionPhase executionPhase, org.aopalliance.intercept.MethodInvocation invocation, Object returnValue, Throwable occuredException, Map<String,Object> environmentVariables)
          Creates a placeholder script interpreter environment and runs the interpreter for the given placeholder script and returns the interpreted output of the script.
 void setPlaceholderResolverList(List<IPlaceholderResolver> placeholderResolverList)
          Sets the list of placeholder resolvers which will be used by this aspect by interpreting placeholder scripts.
 
Methods inherited from class net.sf.sasl.aop.AbstractRootAspect
getLogger, getOrder, setLogger, setLoggerByName, setOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

placeholderSymbolTable

protected IPlaceholderResolverSymbolTable placeholderSymbolTable
List of placeholder resolvers which will be passed to the placeholder script resolver interpreter.

Since:
0.0.2 (sasl-common-aspect-library)
Constructor Detail

AbstractPlaceholderScriptUsingAspect

public AbstractPlaceholderScriptUsingAspect()
Method Detail

getPlaceholderSymbolTable

public IPlaceholderResolverSymbolTable getPlaceholderSymbolTable()
Returns:
non null.
Since:
0.0.2 (sasl-common-aspect-library)
See Also:
setPlaceholderResolverList(List)

setPlaceholderResolverList

public void setPlaceholderResolverList(List<IPlaceholderResolver> placeholderResolverList)
                                throws IllegalArgumentException
Sets the list of placeholder resolvers which will be used by this aspect by interpreting placeholder scripts. The default setted placeholder resolvers are the built in resolvers.

Parameters:
placeholderResolverList - non null.
Throws:
IllegalArgumentException - if placeholderResolverList is null.
Since:
0.0.2 (sasl-common-aspect-library)
See Also:
net.sf.sasl.aop.common.grammar.placeholder.resolver

runInterpreter

protected String runInterpreter(ScriptNode script,
                                TargetMethodExecutionPhase executionPhase,
                                org.aopalliance.intercept.MethodInvocation invocation,
                                Object returnValue,
                                Throwable occuredException,
                                Map<String,Object> environmentVariables)
                         throws InterpreterException
Creates a placeholder script interpreter environment and runs the interpreter for the given placeholder script and returns the interpreted output of the script.

Parameters:
script - non null placeholder script to get interpreted.
executionPhase - non null execution phase.
invocation - non null.
returnValue - null or non null return value of the target method invocation.
occuredException - null or non null occured exception during the target method invocation.
environmentVariables - null or non null map of additional interpreter environment variables.
Returns:
non null interpreted script output.
Throws:
InterpreterException - if any interpreter exception occurs.
Since:
0.0.2 (sasl-common-aspect-library)


Copyright © 2010. All Rights Reserved.