私は axon 2.3.1 を使用しています。集約クラスが 1 つあります。
public class MyAggregate extends AbstractAnnotatedAggregateRoot<MBAggregate> {
@AggregateIdentifier
private MyId Id;
private Circle circle;
EventDispatcher a=new EventDispatcher();
public MyAggregate() {
}
@CommandHandler
public MyAggregate(NewCommand command ) {
apply(new SmallEvent(command.getId(), command.getCircle()));
}
@CommandHandler
public MyAggregate( StoreDestinationsCommand command ) {
apply(new BigEvent(command.getId(), command.getCircle()));
}
//And some event handlers like
@EventHandler
public void onSmallEvent(SmallEvent event)
{
//Some logic here
}
@EventHandler
public void onBigEvent(BigEvent event)
{
//Some logic here
}
これらのイベントハンドラーを他のクラスに含めて、そのイベントがトリガーされたときに呼び出されるようにしたい
public class EventContainer {
private static final long serialVersionUID = -6640657879730853388L;
@EventHandler
public void onSmallEvent(SmallEvent event)
{
//Some logic here
}
@EventHandler
public void onBigEvent(BigEvent event)
{
//Some logic here
}
それらを別のクラスに入れてみましたが、それらのイベントはトリガーされません。
AXONでこれをどのように達成できますか。
ありがとう、