Package org.atmosphere.interceptor
Class IdleResourceInterceptor
- java.lang.Object
-
- org.atmosphere.cpr.AtmosphereInterceptorAdapter
-
- org.atmosphere.interceptor.IdleResourceInterceptor
-
- All Implemented Interfaces:
AtmosphereInterceptor,AtmosphereConfigAware,InvokationOrder
public class IdleResourceInterceptor extends AtmosphereInterceptorAdapter
An Interceptor that track idleAtmosphereResourceand 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.- Author:
- Jeanfrancois Arcand
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.atmosphere.interceptor.InvokationOrder
InvokationOrder.PRIORITY
-
-
Field Summary
-
Fields inherited from interface org.atmosphere.interceptor.InvokationOrder
AFTER_DEFAULT, BEFORE_DEFAULT, FIRST_BEFORE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description IdleResourceInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(AtmosphereConfig config)Configure an AtmosphereFramework object.voiddestroy()Clean the AtmosphereInterceptor when removed or when the Atmosphere is undeployed.protected voididleResources()Actioninspect(AtmosphereResource r)Invoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.longmaxInactiveTime()IdleResourceInterceptormaxInactiveTime(long maxInactiveTime)InvokationOrder.PRIORITYpriority()Return the priority an AtmosphereInterceptor must be executed.-
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorAdapter
postInspect, toString
-
-
-
-
Method Detail
-
configure
public void configure(AtmosphereConfig config)
Description copied from interface:AtmosphereConfigAwareConfigure an AtmosphereFramework object.- Specified by:
configurein interfaceAtmosphereConfigAware- Overrides:
configurein classAtmosphereInterceptorAdapter- Parameters:
config-AtmosphereConfig
-
idleResources
protected void idleResources()
-
maxInactiveTime
public long maxInactiveTime()
-
maxInactiveTime
public IdleResourceInterceptor maxInactiveTime(long maxInactiveTime)
-
inspect
public Action inspect(AtmosphereResource r)
Description copied from interface:AtmosphereInterceptorInvoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.- Specified by:
inspectin interfaceAtmosphereInterceptor- Overrides:
inspectin classAtmosphereInterceptorAdapter- Parameters:
r- aAtmosphereResource- Returns:
Action.CONTINUEorAction.SUSPENDto dispatch theAtmosphereResourceto otherAtmosphereInterceptororAtmosphereHandler. ReturnAction.TYPE.CANCELLEDto stop the processing.
-
priority
public InvokationOrder.PRIORITY priority()
Description copied from interface:InvokationOrderReturn the priority an AtmosphereInterceptor must be executed.- Specified by:
priorityin interfaceInvokationOrder- Overrides:
priorityin classAtmosphereInterceptorAdapter- Returns:
- PRIORITY
-
destroy
public void destroy()
Description copied from interface:AtmosphereInterceptorClean the AtmosphereInterceptor when removed or when the Atmosphere is undeployed.- Specified by:
destroyin interfaceAtmosphereInterceptor- Overrides:
destroyin classAtmosphereInterceptorAdapter
-
-