001 package com.hammurapi.eventbus.tests;
002
003 import com.hammurapi.common.Condition;
004 import com.hammurapi.eventbus.Handler;
005 import com.hammurapi.eventbus.EventHandlerBase.Mode;
006 import com.hammurapi.eventbus.local.LocalEventDispatchJoinContext;
007
008 public class JoinRemoveHandler {
009
010 private int joinCounter;
011 private boolean joinOk;
012
013 public boolean isJoinOk() {
014 return joinOk;
015 }
016
017 public int getJoinCounter() {
018 return joinCounter;
019 }
020
021 @Handler(mode=Mode.REMOVE, value="java(*)://world.equals(\"World\")")
022 public void join(
023 LocalEventDispatchJoinContext<Object, Integer, Object> context,
024 @Condition("\"Hello\".equals(hello)") String hello,
025 String world) {
026 ++joinCounter;
027 joinOk = "Hello".equals(hello) && "World".equals(world) && Mode.REMOVE.equals(context.getMode());
028 }
029 }