// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/command/ChildCustomCommand.java
// public class ChildCustomCommand extends FirstCustomCommand {
//     public ChildCustomCommand(String name, CountDownLatch countDownLatch) {
//         super(name, countDownLatch);
//     }
// 
//     @Override
//     public UUID getAggregateId() {
//         return super.getAggregateId();
//     }
// }
// 
// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/command/FirstCustomCommand.java
// public class FirstCustomCommand implements Command {
//     private final CountDownLatch countDownLatch;
//     private String message;
//     private volatile int callCount = 0;
//     private UUID aggregateId;
// 
//     public FirstCustomCommand(String message, CountDownLatch countDownLatch) {
//         this.aggregateId = UUID.randomUUID();
//         this.message = message;
//         this.countDownLatch = countDownLatch;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     public synchronized int getCallCount() {
//         return callCount;
//     }
// 
//     public synchronized void setCallCount(int callCount) {
//         this.callCount = callCount;
//     }
// 
//     public CountDownLatch getCountDownLatch() {
//         return countDownLatch;
//     }
// 
//     public synchronized void incrementCallCount() {
//         callCount++;
//     }
// 
//     @Override
//     public UUID getAggregateId() {
//         return aggregateId;
//     }
// }
// 
// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/event/TestEvent.java
// public class TestEvent implements Event {
// 
//     private String message;
// 
//     public TestEvent() {
//     }
// 
//     public TestEvent(String message) {
//         this.message = message;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// }
// 
// Path: eventasia-framework/src/main/java/com/github/eventasia/framework/Event.java
// public interface Event extends Serializable {
// }


import com.github.eventasia.eventstore.command.AggregateCommandHandler;
import com.github.eventasia.eventstore.command.ChildCustomCommand;
import com.github.eventasia.eventstore.command.FirstCustomCommand;
import com.github.eventasia.eventstore.event.TestEvent;
import com.github.eventasia.framework.Event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
package com.github.eventasia.eventstore.wrapper;


@Component
public class TestEventListenerWrapper {


    private Log log = LogFactory.getLog(TestEventListenerWrapper.class);

    @AggregateCommandHandler
    public Event onApplicationEvent(FirstCustomCommand command) {
        command.getCountDownLatch().countDown();
        command.incrementCallCount();
        log.debug("m=onApplicationEvent, message='" + command.getMessage() + "'");

        return new TestEvent("TEST EVENT");
    }

    @AggregateCommandHandler
    public void onApplicationEvent(ChildCustomCommand command) {
        command.getCountDownLatch().countDown();
        command.incrementCallCount();
// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/command/ChildCustomCommand.java
// public class ChildCustomCommand extends FirstCustomCommand {
//     public ChildCustomCommand(String name, CountDownLatch countDownLatch) {
//         super(name, countDownLatch);
//     }
// 
//     @Override
//     public UUID getAggregateId() {
//         return super.getAggregateId();
//     }
// }
// 
// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/command/FirstCustomCommand.java
// public class FirstCustomCommand implements Command {
//     private final CountDownLatch countDownLatch;
//     private String message;
//     private volatile int callCount = 0;
//     private UUID aggregateId;
// 
//     public FirstCustomCommand(String message, CountDownLatch countDownLatch) {
//         this.aggregateId = UUID.randomUUID();
//         this.message = message;
//         this.countDownLatch = countDownLatch;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     public synchronized int getCallCount() {
//         return callCount;
//     }
// 
//     public synchronized void setCallCount(int callCount) {
//         this.callCount = callCount;
//     }
// 
//     public CountDownLatch getCountDownLatch() {
//         return countDownLatch;
//     }
// 
//     public synchronized void incrementCallCount() {
//         callCount++;
//     }
// 
//     @Override
//     public UUID getAggregateId() {
//         return aggregateId;
//     }
// }
// 
// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/event/TestEvent.java
// public class TestEvent implements Event {
// 
//     private String message;
// 
//     public TestEvent() {
//     }
// 
//     public TestEvent(String message) {
//         this.message = message;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// }
// 
// Path: eventasia-framework/src/main/java/com/github/eventasia/framework/Event.java
// public interface Event extends Serializable {
// }


// Path: eventasia-starter/src/test/java/com/github/eventasia/eventstore/wrapper/TestEventListenerWrapper.java
import com.github.eventasia.eventstore.command.AggregateCommandHandler;
import com.github.eventasia.eventstore.command.ChildCustomCommand;
import com.github.eventasia.eventstore.command.FirstCustomCommand;
import com.github.eventasia.eventstore.event.TestEvent;
import com.github.eventasia.framework.Event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

package com.github.eventasia.eventstore.wrapper;


@Component
public class TestEventListenerWrapper {


    private Log log = LogFactory.getLog(TestEventListenerWrapper.class);

    @AggregateCommandHandler
    public Event onApplicationEvent(FirstCustomCommand command) {
        command.getCountDownLatch().countDown();
        command.incrementCallCount();
        log.debug("m=onApplicationEvent, message='" + command.getMessage() + "'");

        return new TestEvent("TEST EVENT");
    }

    @AggregateCommandHandler
    public void onApplicationEvent(ChildCustomCommand command) {
        command.getCountDownLatch().countDown();
        command.incrementCallCount();
        log.debug("m=onApplicationEvent, message='" + command.getMessage() + "'");