org.atmosphere.interceptor
Class AtmosphereResourceStateRecovery

java.lang.Object
  extended by org.atmosphere.interceptor.AtmosphereResourceStateRecovery
All Implemented Interfaces:
AtmosphereInterceptor

public class AtmosphereResourceStateRecovery
extends Object
implements AtmosphereInterceptor

This interceptor associates a AtmosphereResource to all Broadcaster the resource was added before the underlying connection got closed and resume. This allow an application to restore the state of the client before the disconnection occurred, and for the long-polling transport to return to it's previous state.

Author:
Jeanfrancois Arcand

Nested Class Summary
 class AtmosphereResourceStateRecovery.B
           
static class AtmosphereResourceStateRecovery.BroadcasterTracker
           
 
Constructor Summary
AtmosphereResourceStateRecovery()
           
 
Method Summary
protected  void clearStateTracker()
           
 void configure(AtmosphereConfig config)
          Allow this object to configure its state when initialized.
 Action inspect(AtmosphereResource r)
          Invoked before an AtmosphereResource gets dispatched to AtmosphereHandler.
 void postInspect(AtmosphereResource r)
          Invoked after an AtmosphereResource gets dispatched to AtmosphereHandler.
 List<Object> retrieveCache(AtmosphereResource r, AtmosphereResourceStateRecovery.BroadcasterTracker tracker, boolean force)
           
 ConcurrentHashMap<String,AtmosphereResourceStateRecovery.BroadcasterTracker> states()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtmosphereResourceStateRecovery

public AtmosphereResourceStateRecovery()
Method Detail

configure

public void configure(AtmosphereConfig config)
Description copied from interface: AtmosphereInterceptor
Allow this object to configure its state when initialized.

Specified by:
configure in interface AtmosphereInterceptor
Parameters:
config - an AtmosphereConfig

clearStateTracker

protected void clearStateTracker()

inspect

public Action inspect(AtmosphereResource r)
Description copied from interface: AtmosphereInterceptor
Invoked before an AtmosphereResource gets dispatched to AtmosphereHandler.

Specified by:
inspect in interface AtmosphereInterceptor
Parameters:
r - a AtmosphereResource
Returns:
Action.CONTINUE or Action.SUSPEND to dispatch the AtmosphereResource to other AtmosphereInterceptor or AtmosphereHandler. Return Action.TYPE.CANCELLED to stop the processing.

postInspect

public void postInspect(AtmosphereResource r)
Description copied from interface: AtmosphereInterceptor
Invoked after an AtmosphereResource gets dispatched to AtmosphereHandler.

Specified by:
postInspect in interface AtmosphereInterceptor
Parameters:
r - a AtmosphereResource

states

public ConcurrentHashMap<String,AtmosphereResourceStateRecovery.BroadcasterTracker> states()

toString

public String toString()
Overrides:
toString in class Object

retrieveCache

public List<Object> retrieveCache(AtmosphereResource r,
                                  AtmosphereResourceStateRecovery.BroadcasterTracker tracker,
                                  boolean force)


Copyright © 2013. All Rights Reserved.