public class IdleResourceInterceptor extends AtmosphereInterceptorAdapter
AtmosphereResource
and close it. This interceptor is useful for
tracking disconnected client that aren't detected by the network. A good example is a wireless connection
that goes down. In that case Tomcat and Jetty fail to detects the disconnect.InvokationOrder.PRIORITY
AFTER_DEFAULT, BEFORE_DEFAULT, FIRST_BEFORE_DEFAULT
Constructor and Description |
---|
IdleResourceInterceptor() |
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.
|
protected void |
idleResources() |
Action |
inspect(AtmosphereResource r)
Invoked before an
AtmosphereResource gets dispatched to AtmosphereHandler . |
long |
maxInactiveTime() |
IdleResourceInterceptor |
maxInactiveTime(long maxInactiveTime) |
InvokationOrder.PRIORITY |
priority()
Return the priority an AtmosphereInterceptor must be executed.
|
postInspect, toString
public void configure(AtmosphereConfig config)
AtmosphereConfigAware
configure
in interface AtmosphereConfigAware
configure
in class AtmosphereInterceptorAdapter
config
- AtmosphereConfig
protected void idleResources()
public long maxInactiveTime()
public IdleResourceInterceptor maxInactiveTime(long maxInactiveTime)
public Action inspect(AtmosphereResource r)
AtmosphereInterceptor
AtmosphereResource
gets dispatched to AtmosphereHandler
.inspect
in interface AtmosphereInterceptor
inspect
in class AtmosphereInterceptorAdapter
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 InvokationOrder.PRIORITY priority()
InvokationOrder
priority
in interface InvokationOrder
priority
in class AtmosphereInterceptorAdapter
public void destroy()
AtmosphereInterceptor
destroy
in interface AtmosphereInterceptor
destroy
in class AtmosphereInterceptorAdapter
Copyright © 2016. All rights reserved.