Package org.atmosphere.interceptor
Class JavaScriptProtocol
- java.lang.Object
-
- org.atmosphere.cpr.AtmosphereInterceptorAdapter
-
- org.atmosphere.interceptor.JavaScriptProtocol
-
- All Implemented Interfaces:
AtmosphereInterceptor,AtmosphereConfigAware,InvokationOrder
public class JavaScriptProtocol extends AtmosphereInterceptorAdapter
An Interceptor that send back to a websocket and http client the value of
HeaderConfig.X_ATMOSPHERE_TRACKING_ID.Moreover, if any
HeartbeatInterceptoris installed, it provides the configured heartbeat interval in seconds and the value to be sent for each heartbeat by the client. If not interceptor is installed, then "0" is sent to tell he client to not send any heartbeat.- 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 JavaScriptProtocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(AtmosphereConfig config)Configure an AtmosphereFramework object.booleanenforceAtmosphereVersion()JavaScriptProtocolenforceAtmosphereVersion(boolean enforceAtmosphereVersion)Actioninspect(AtmosphereResource ar)Invoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.java.lang.StringtoString()java.lang.StringwsDelimiter()JavaScriptProtocolwsDelimiter(java.lang.String wsDelimiter)-
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorAdapter
destroy, postInspect, priority
-
-
-
-
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
-
inspect
public Action inspect(AtmosphereResource ar)
Description copied from interface:AtmosphereInterceptorInvoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.- Specified by:
inspectin interfaceAtmosphereInterceptor- Overrides:
inspectin classAtmosphereInterceptorAdapter- Parameters:
ar- aAtmosphereResource- Returns:
Action.CONTINUEorAction.SUSPENDto dispatch theAtmosphereResourceto otherAtmosphereInterceptororAtmosphereHandler. ReturnAction.TYPE.CANCELLEDto stop the processing.
-
wsDelimiter
public java.lang.String wsDelimiter()
-
wsDelimiter
public JavaScriptProtocol wsDelimiter(java.lang.String wsDelimiter)
-
enforceAtmosphereVersion
public boolean enforceAtmosphereVersion()
-
enforceAtmosphereVersion
public JavaScriptProtocol enforceAtmosphereVersion(boolean enforceAtmosphereVersion)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAtmosphereInterceptorAdapter
-
-