net.customware.gwt.dispatch.server.guice
Class ActionHandlerModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by net.customware.gwt.dispatch.server.guice.ActionHandlerModule
All Implemented Interfaces:
com.google.inject.Module

public abstract class ActionHandlerModule
extends com.google.inject.AbstractModule

This is an abstract base class that configures Guice to inject Dispatch and ActionHandler instances. If no other prior instance of ServerDispatchModule has been installed, the standard Dispatch and ActionHandlerRegistry classes will be configured.

Implement the configureHandlers() method and call bindHandler(Class, Class) to register handler implementations. For example:

 public class MyDispatchModule extends ClientDispatchModule {
      \@Override
      protected void configureHandlers() {
          bindHandler( MyHandler.class );
      }
 }
 


Constructor Summary
ActionHandlerModule()
           
 
Method Summary
protected
<A extends Action<R>,R extends Result>
void
bindHandler(Class<A> actionClass, Class<? extends ActionHandler<A,R>> handlerClass)
          Call this method to binds the specified ActionHandler instance class.
protected  void configure()
           
protected abstract  void configureHandlers()
          Override this method to configure handlers.
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionHandlerModule

public ActionHandlerModule()
Method Detail

configure

protected final void configure()
Specified by:
configure in class com.google.inject.AbstractModule

configureHandlers

protected abstract void configureHandlers()
Override this method to configure handlers.


bindHandler

protected <A extends Action<R>,R extends Result> void bindHandler(Class<A> actionClass,
                                                                  Class<? extends ActionHandler<A,R>> handlerClass)
Call this method to binds the specified ActionHandler instance class.

Parameters:
actionClass - The action class.
handlerClass - The handler class.


Copyright © 2011 customware.net. All Rights Reserved.