Package org.atmosphere.interceptor
Class AtmosphereResourceStateRecovery
java.lang.Object
org.atmosphere.interceptor.AtmosphereResourceStateRecovery
- All Implemented Interfaces:
AtmosphereInterceptor,AtmosphereConfigAware
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
Nested ClassesModifier and TypeClassDescriptionfinal classstatic final classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(AtmosphereConfig config) Configure an AtmosphereFramework object.voiddestroy()Clean the AtmosphereInterceptor when removed or when the Atmosphere is undeployed.Invoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.voidInvoked after anAtmosphereResourcegets dispatched toAtmosphereHandler.retrieveCache(AtmosphereResource r, AtmosphereResourceStateRecovery.BroadcasterTracker tracker, boolean force) protected voidstates()longtimeout()timeout(long timeout) toString()
-
Constructor Details
-
AtmosphereResourceStateRecovery
public AtmosphereResourceStateRecovery()
-
-
Method Details
-
configure
Description copied from interface:AtmosphereConfigAwareConfigure an AtmosphereFramework object.- Specified by:
configurein interfaceAtmosphereConfigAware- Parameters:
config-AtmosphereConfig
-
timeout
-
timeout
public long timeout() -
startStateTracker
protected void startStateTracker() -
inspect
Description copied from interface:AtmosphereInterceptorInvoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.- Specified by:
inspectin interfaceAtmosphereInterceptor- Parameters:
r- aAtmosphereResource- Returns:
Action.CONTINUEorAction.SUSPENDto dispatch theAtmosphereResourceto otherAtmosphereInterceptororAtmosphereHandler. ReturnAction.TYPE.CANCELLEDto stop the processing.
-
postInspect
Description copied from interface:AtmosphereInterceptorInvoked after anAtmosphereResourcegets dispatched toAtmosphereHandler.- Specified by:
postInspectin interfaceAtmosphereInterceptor- Parameters:
r- aAtmosphereResource
-
destroy
public void destroy()Description copied from interface:AtmosphereInterceptorClean the AtmosphereInterceptor when removed or when the Atmosphere is undeployed.- Specified by:
destroyin interfaceAtmosphereInterceptor
-
states
-
toString
-
retrieveCache
public List<Object> retrieveCache(AtmosphereResource r, AtmosphereResourceStateRecovery.BroadcasterTracker tracker, boolean force)
-