com.gwtplatform.dispatch.client.gin
Class DispatchAsyncModule
java.lang.Object
com.google.gwt.inject.client.AbstractGinModule
com.gwtplatform.dispatch.client.gin.DispatchAsyncModule
- All Implemented Interfaces:
- com.google.gwt.inject.client.GinModule
public class DispatchAsyncModule
- extends com.google.gwt.inject.client.AbstractGinModule
This gin module provides provides access to the DispatchAsync
singleton, which is used to make remote procedure calls to the server. This
module requires an ExceptionHandler
and a
SecurityCookieAccessor
. By default, these will be bound to
DefaultExceptionHandler
and DefaultSecurityCookieAccessor
respectively.
If you want to prevent XSRF attack (you use secured
Action
s) the default
EmptySecurityCookieAccessor
could leave your application vulnerable
to XSRF attacks. For more details see this document. For more security use DispatchAsyncSecureModule
.
If you don't need XSRF protection, you can use directly this module with your
Ginjector
, i.e.:
@GinModules( { DispatchAsyncModule
.class, ... }
For customization, skip the previous step and install the module in one of
your configure()
methods:
install(new DispatchAsyncModule.Builder().exceptionHandler(
MyExceptionHandler.class).sessionAccessor(
MySecurityCookieAccessor.class).build());
You can pass null
as any of the two parameter to fallback to the
default.
- Author:
- David Peterson, Philippe Beaudoin, Brendan Doherty
Methods inherited from class com.google.gwt.inject.client.AbstractGinModule |
bind, bind, bind, bindConstant, binder, configure, install, requestStaticInjection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exceptionHandlerType
protected final Class<? extends ExceptionHandler> exceptionHandlerType
sessionAccessorType
protected final Class<? extends SecurityCookieAccessor> sessionAccessorType
clientActionHandlerRegistryType
protected final Class<? extends ClientActionHandlerRegistry> clientActionHandlerRegistryType
DispatchAsyncModule
public DispatchAsyncModule()
DispatchAsyncModule
@Deprecated
public DispatchAsyncModule(Class<? extends ExceptionHandler> exceptionHandlerType,
Class<? extends SecurityCookieAccessor> sessionAccessorType)
- Deprecated.
DispatchAsyncModule
@Deprecated
public DispatchAsyncModule(Class<? extends ClientActionHandlerRegistry> clientActionHandlerRegistryType)
- Deprecated.
DispatchAsyncModule
@Deprecated
public DispatchAsyncModule(Class<? extends ExceptionHandler> exceptionHandlerType,
Class<? extends SecurityCookieAccessor> sessionAccessorType,
Class<? extends ClientActionHandlerRegistry> clientActionHandlerRegistryType)
- Deprecated.
configure
protected void configure()
- Specified by:
configure
in class com.google.gwt.inject.client.AbstractGinModule
provideDispatchAsync
@Provides
protected DispatchAsync provideDispatchAsync(ExceptionHandler exceptionHandler,
SecurityCookieAccessor secureSessionAccessor,
ClientActionHandlerRegistry registry)
Copyright © 2010-2012 ArcBees. All Rights Reserved.