Skip to content

Commit 073a705

Browse files
committed
RequestAction annotation now creates an inbound-only operation
1 parent 8f8b437 commit 073a705

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎config-annotations/src/main/java/org/ocpsoft/rewrite/annotation/handler/RequestActionHandler.java‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
import org.ocpsoft.rewrite.annotation.api.HandlerChain;
2323
import org.ocpsoft.rewrite.annotation.api.MethodContext;
2424
import org.ocpsoft.rewrite.annotation.spi.MethodAnnotationHandler;
25+
import org.ocpsoft.rewrite.config.InboundOperation;
2526
import org.ocpsoft.rewrite.config.Invoke;
2627
import org.ocpsoft.rewrite.config.Operation;
28+
import org.ocpsoft.rewrite.context.EvaluationContext;
2729
import org.ocpsoft.rewrite.el.El;
30+
import org.ocpsoft.rewrite.event.InboundRewrite;
2831

2932
public class RequestActionHandler extends MethodAnnotationHandler<RequestAction>
3033
{
@@ -56,8 +59,19 @@ public void process(MethodContext context, RequestAction annotation, HandlerChai
5659
Assert.notNull(enrichedOperation, "Operation was removed from the context");
5760

5861
// append this operation to the rule
59-
context.getRuleBuilder().perform(enrichedOperation);
62+
context.getRuleBuilder().perform(inboundOperation(enrichedOperation));
6063

6164
}
6265

66+
private Operation inboundOperation(final Operation operation)
67+
{
68+
return new InboundOperation() {
69+
@Override
70+
public void performInbound(InboundRewrite event, EvaluationContext context)
71+
{
72+
operation.perform(event, context);
73+
}
74+
};
75+
}
76+
6377
}

0 commit comments

Comments
 (0)