MethodAdvice beginRenderAdvice = new MethodAdvice() {
public void advise(MethodInvocation invocation) {
invocation.proceed();
final InterceptorStatusToken statusTokenVal = secChecker.checkBefore(confAttrHolder);
final ComponentResources componentResources = invocation.getInstanceContext().get(ComponentResources.class);
componentResources.storeRenderVariable(STATUS_TOKEN, statusTokenVal);
}
};
beginRenderMethod.addAdvice(beginRenderAdvice);
// ---------------- END TRANSFORMATION ------------------------
PlasticMethod cleanupRenderMethod = plasticClass.introduceMethod(TransformConstants.CLEANUP_RENDER_DESCRIPTION);
MethodAdvice cleanupRenderAdvice = new MethodAdvice() {
public void advise(MethodInvocation invocation) {
invocation.proceed();
final ComponentResources componentResources = invocation.getInstanceContext().get(ComponentResources.class);
final InterceptorStatusToken tokenFieldValue = (InterceptorStatusToken) componentResources.getRenderVariable(STATUS_TOKEN);
secChecker.checkAfter(tokenFieldValue, null);
}
};
cleanupRenderMethod.addAdvice(cleanupRenderAdvice);