Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##ActionHandlerModule.java
- @Override
- protected final void configure() {
- // This will only get installed once due to equals/hashCode override.
- install( new ServerDispatchModule() );
- configureHandlers();
- }
- ##ServerDispatchModule
- public ServerDispatchModule() {
- this( AbstractDispatch.class, DefaultActionHandlerRegistry.class );
- }
- public ServerDispatchModule( Class<? extends Dispatch> dispatchClass ) {
- this( dispatchClass, DefaultActionHandlerRegistry.class );
- }
- public ServerDispatchModule( Class<? extends Dispatch> dispatchClass,
- Class<? extends ActionHandlerRegistry> actionHandlerRegistryClass ) {
- this.dispatchClass = dispatchClass;
- this.actionHandlerRegistryClass = actionHandlerRegistryClass;
- }
- @Override
- protected final void configure() {
- bind( ActionHandlerRegistry.class ).to( getActionHandlerRegistryClass() ).in( Singleton.class );
- bind( Dispatch.class ).to( getDispatchClass() );
- // This will bind registered handlers to the registry.
- if ( InstanceActionHandlerRegistry.class.isAssignableFrom( getActionHandlerRegistryClass() ) )
- requestStaticInjection( ActionHandlerLinker.class );
- }
Add Comment
Please, Sign In to add comment