Package org.fusesource.restygwt.client.callback

Examples of org.fusesource.restygwt.client.callback.CachingCallbackFilter


         * configure RESTY to use cache, usually done in gin
         */
        final EventBus eventBus = new SimpleEventBus();
        final QueueableCacheStorage cache = new VolatileQueueableCacheStorage();
       
        final CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        final CallbackFactory callbackFactory = new RetryingCallbackFactory(cachingCallbackFilter,
                new ModelChangeCallbackFilter(eventBus));
        final DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);
       
        Dispatcher dispatcher = new DefaultFilterawareDispatcher(cachingDispatcherFilter);
View Full Code Here


     */
    public void testIfCachingWorks() {
        //configure RESTY to use cache:
        final EventBus eventBus = new SimpleEventBus();
        QueueableCacheStorage cache = new VolatileQueueableCacheStorage();
        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new DefaultCallbackFactory(cachingCallbackFilter,
                    new ModelChangeCallbackFilter(eventBus));
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);
       
        Dispatcher dispatcher = new DefaultFilterawareDispatcher(cachingDispatcherFilter);
View Full Code Here

        /*
         * configure RESTY to use cache, usually done in gin
         */
        QueueableCacheStorage cache = new VolatileQueueableCacheStorage();
       
        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new RetryingCallbackFactory(
                100,// grace period millis
                4,// number of retries
                cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);
View Full Code Here

                new CallbackFactory() {
                    public FilterawareRequestCallback createCallback(Method method) {
                        final FilterawareRequestCallback retryingCallback = new DefaultFilterawareRequestCallback(
                                method);

                        retryingCallback.addFilter(new CachingCallbackFilter(cacheStorage));
                        retryingCallback.addFilter(new ModelChangeCallbackFilter(eventBus));
                        return retryingCallback;
                    }
                }));
View Full Code Here

                new CallbackFactory() {
                    public FilterawareRequestCallback createCallback(Method method) {
                        final FilterawareRequestCallback retryingCallback = new DefaultFilterawareRequestCallback(
                                method);

                        retryingCallback.addFilter(new CachingCallbackFilter(cacheStorage));
                        retryingCallback.addFilter(new ModelChangeCallbackFilter(eventBus));
                        return retryingCallback;
                    }
                }));
View Full Code Here

    }

    public FilterawareDispatcher cachingDispatcher(){
        QueueableCacheStorage cache = new DefaultQueueableCacheStorage();

        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new DefaultCallbackFactory(cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache,callbackFactory);

        FilterawareDispatcher dispatcher = new DefaultFilterawareDispatcher(cachingDispatcherFilter);
View Full Code Here

        CallbackFilter xsrfCallbackFilter = new XSRFTokenCallbackFilter(xsrf);

        QueueableCacheStorage cache = new DefaultQueueableCacheStorage();

        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new DefaultCallbackFactory(xsrfCallbackFilter, cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);

        FilterawareDispatcher dispatcher = new DefaultFilterawareDispatcher(xsrfDispatcherFilter, cachingDispatcherFilter);
View Full Code Here

    }

    public FilterawareDispatcher retryingDispatcher(){
        QueueableCacheStorage cache = new VolatileQueueableCacheStorage();

        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new RetryingCallbackFactory(cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);

        FilterawareDispatcher dispatcher = new DefaultFilterawareDispatcher(cachingDispatcherFilter);
View Full Code Here

    }

    public FilterawareDispatcher retryingCachingDispatcher(){
        QueueableCacheStorage cache = new DefaultQueueableCacheStorage();

        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new RetryingCallbackFactory(cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);

        FilterawareDispatcher dispatcher = new DefaultFilterawareDispatcher(cachingDispatcherFilter);
View Full Code Here

        CallbackFilter xsrfCallbackFilter = new XSRFTokenCallbackFilter(xsrf);

        QueueableCacheStorage cache = new DefaultQueueableCacheStorage();

        CallbackFilter cachingCallbackFilter = new CachingCallbackFilter(cache);
        CallbackFactory callbackFactory = new RetryingCallbackFactory(xsrfCallbackFilter, cachingCallbackFilter);
        DispatcherFilter cachingDispatcherFilter = new CachingDispatcherFilter(cache, callbackFactory);

        FilterawareDispatcher dispatcher = new DefaultFilterawareDispatcher(xsrfDispatcherFilter, cachingDispatcherFilter);
View Full Code Here

TOP

Related Classes of org.fusesource.restygwt.client.callback.CachingCallbackFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.