org.eclipse.xtend.backend.aop.internal
Class AdviceContextImpl

java.lang.Object
  extended by org.eclipse.xtend.backend.aop.internal.AdviceContextImpl
All Implemented Interfaces:
AdviceContext

public final class AdviceContextImpl
extends java.lang.Object
implements AdviceContext

This class represents all currently registered advice. It is designed to efficiently handle dynamically registered advice, e.g. for the scope of an invocation.
In order to allow aggressive caching, it is immutable and creates a copy when additional advice is registered. This design decision assumes that registering new advice is very infrequent compared to the invocation of functions.

Author:
Arno Haase (http://www.haase-consulting.com), André Arnold

Constructor Summary
AdviceContextImpl()
           
 
Method Summary
 AdviceContextImpl copyWithAdvice(AroundAdvice advice)
           
 AdvisedFunction getAdvice(QualifiedName functionName, Function f)
          returns the advice to be applied to this function, starting with the outermost advice, i.e.
 java.util.Map<Triplet<Function,AroundAdvice,java.util.List<?>>,ObjectWrapper> getResultCache()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdviceContextImpl

public AdviceContextImpl()
Method Detail

copyWithAdvice

public AdviceContextImpl copyWithAdvice(AroundAdvice advice)
Specified by:
copyWithAdvice in interface AdviceContext

getAdvice

public AdvisedFunction getAdvice(QualifiedName functionName,
                                 Function f)
returns the advice to be applied to this function, starting with the outermost advice, i.e. the advice that is to wrapped around all other advice applicable to a given function.

Specified by:
getAdvice in interface AdviceContext

getResultCache

public java.util.Map<Triplet<Function,AroundAdvice,java.util.List<?>>,ObjectWrapper> getResultCache()
Specified by:
getResultCache in interface AdviceContext