org.atmosphere.interceptor
Class AtmosphereResourceStateRecovery
java.lang.Object
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
AtmosphereResourceStateRecovery
public AtmosphereResourceStateRecovery()
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.