tuddman / axon-guice

DEPRECATED: Axon-Guice is an integration module between Google Guice and the Axon Framework.
Apache License 2.0
0 stars 1 forks source link

AnnotationCommandHandlerProvider doesn't initiate Command Handlers #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First, thanks for this project. I was about to recreate it for my app.

What steps will reproduce the problem?
I have a command handler annotated with @CommandHandlerComponent.
When I use the AxonGuiceModule to initialize the app, I see from the logs that 
my command handler is Found. However, when I start the application, I get an 
error that the handler was not registered with the CommandBus.

What is the expected output? What do you see instead?
No errors.

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

My workaround is to Eager bind the command handler

/*
 * (non-Javadoc)
 * @see
 * com.google.code.axonguice.commandhandling
 * .CommandHandlingModule#bindCommandHandler(java
 * .lang.Class)
 */
@Override
protected void bindCommandHandler(Class<?> handlerClass) {
   @SuppressWarnings("rawtypes")
    Provider commandHandlerProvider = 
        new AnnotationCommandHandlerProvider(handlerClass);
    requestInjection(commandHandlerProvider);
    bind(handlerClass).toProvider(commandHandlerProvider)
        .asEagerSingleton();
}

Original issue reported on code.google.com by br...@ridgetopsolutions.com on 1 Oct 2013 at 10:52