public class AtmosphereResourceStateRecovery extends Object implements AtmosphereInterceptor
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.Modifier and Type | Class and Description |
---|---|
class |
AtmosphereResourceStateRecovery.B |
static class |
AtmosphereResourceStateRecovery.BroadcasterTracker |
static class |
AtmosphereResourceStateRecovery.OnAlwaysSuspend |
Constructor and Description |
---|
AtmosphereResourceStateRecovery() |
Modifier and Type | Method and Description |
---|---|
void |
configure(AtmosphereConfig config)
Configure an AtmosphereFramework object.
|
void |
destroy()
Clean the AtmosphereInterceptor when removed or when the Atmosphere is undeployed.
|
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) |
protected void |
startStateTracker() |
ConcurrentHashMap<String,AtmosphereResourceStateRecovery.BroadcasterTracker> |
states() |
long |
timeout() |
AtmosphereResourceStateRecovery |
timeout(long timeout) |
String |
toString() |
public void configure(AtmosphereConfig config)
AtmosphereConfigAware
configure
in interface AtmosphereConfigAware
config
- AtmosphereConfig
public AtmosphereResourceStateRecovery timeout(long timeout)
public long timeout()
protected void startStateTracker()
public Action inspect(AtmosphereResource r)
AtmosphereInterceptor
AtmosphereResource
gets dispatched to AtmosphereHandler
.inspect
in interface AtmosphereInterceptor
r
- a AtmosphereResource
Action.CONTINUE
or Action.SUSPEND
to dispatch the AtmosphereResource
to other AtmosphereInterceptor
or AtmosphereHandler
.
Return Action.TYPE.CANCELLED
to stop the processing.public void postInspect(AtmosphereResource r)
AtmosphereInterceptor
AtmosphereResource
gets dispatched to AtmosphereHandler
.postInspect
in interface AtmosphereInterceptor
r
- a AtmosphereResource
public void destroy()
AtmosphereInterceptor
destroy
in interface AtmosphereInterceptor
public ConcurrentHashMap<String,AtmosphereResourceStateRecovery.BroadcasterTracker> states()
public List<Object> retrieveCache(AtmosphereResource r, AtmosphereResourceStateRecovery.BroadcasterTracker tracker, boolean force)
Copyright © 2016. All rights reserved.