org.fusesource.restygwt.client.dispatcher
Class DefaultFilterawareDispatcher

java.lang.Object
  extended by org.fusesource.restygwt.client.dispatcher.DefaultFilterawareDispatcher
All Implemented Interfaces:
Dispatcher, FilterawareDispatcher

public class DefaultFilterawareDispatcher
extends Object
implements FilterawareDispatcher

Some valuable ideas came from: http://turbomanage.wordpress.com/2010/07/12/caching-batching-dispatcher-for-gwt-dispatch/

Thanks David!

Especially: - Waiting if a particular request is already on the way (otherwise you end up having many requests on the same source.

Author:
rEyez, Hiram Chirino

Field Summary
protected  List<DispatcherFilter> dispatcherFilters
          list of dispatcherfilters to be performed when an request is done
static DefaultFilterawareDispatcher INSTANCE
           
 
Constructor Summary
DefaultFilterawareDispatcher()
           
DefaultFilterawareDispatcher(DispatcherFilter... filters)
           
 
Method Summary
 void addFilter(DispatcherFilter filter)
          well, add one more dispatcherfilter
 Request send(Method method, RequestBuilder builder)
           
static DefaultFilterawareDispatcher singleton()
          get one instance of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static DefaultFilterawareDispatcher INSTANCE

dispatcherFilters

protected final List<DispatcherFilter> dispatcherFilters
list of dispatcherfilters to be performed when an request is done

Constructor Detail

DefaultFilterawareDispatcher

public DefaultFilterawareDispatcher()

DefaultFilterawareDispatcher

public DefaultFilterawareDispatcher(DispatcherFilter... filters)
Method Detail

singleton

public static DefaultFilterawareDispatcher singleton()
get one instance of this class

Parameters:
cacheStorage - the one and only QueueableCacheStorage for this instance
cf - CallbackFactory to be able to use DefaultFilterawareRequestCallback
Returns:

send

public Request send(Method method,
                    RequestBuilder builder)
             throws RequestException
Specified by:
send in interface Dispatcher
Throws:
RequestException

addFilter

public void addFilter(DispatcherFilter filter)
well, add one more dispatcherfilter

Specified by:
addFilter in interface FilterawareDispatcher


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.