Package org.atmosphere.client
Class TrackMessageSizeInterceptor
- java.lang.Object
-
- org.atmosphere.cpr.AtmosphereInterceptorAdapter
-
- org.atmosphere.client.TrackMessageSizeInterceptor
-
- All Implemented Interfaces:
AtmosphereInterceptor,AtmosphereConfigAware,InvokationOrder
public class TrackMessageSizeInterceptor extends AtmosphereInterceptorAdapter
AnAtmosphereInterceptorthat add a message size and delimiter. The special String is configurable usingApplicationConfig.MESSAGE_DELIMITERand you can configure this class to exclude some response's content-type by using theApplicationConfig.EXCLUDED_CONTENT_TYPES- Author:
- Jeanfrancois Arcand
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.atmosphere.interceptor.InvokationOrder
InvokationOrder.PRIORITY
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSKIP_INTERCEPTOR-
Fields inherited from interface org.atmosphere.interceptor.InvokationOrder
AFTER_DEFAULT, BEFORE_DEFAULT, FIRST_BEFORE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description TrackMessageSizeInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(AtmosphereConfig config)Configure an AtmosphereFramework object.TrackMessageSizeInterceptorexcludedContentType(java.lang.String excludedContentType)Exclude response's content-type from being processed by this class.java.util.HashSet<java.lang.String>excludedContentTypes()Actioninspect(AtmosphereResource r)Invoked before anAtmosphereResourcegets dispatched toAtmosphereHandler.TrackMessageSizeInterceptormessageDelimiter(java.lang.String endString)Set the character delimiter used by this class to separate message.InvokationOrder.PRIORITYpriority()Return the priority an AtmosphereInterceptor must be executed.java.lang.StringtoString()-
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorAdapter
destroy, postInspect
-
-
-
-
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
-
messageDelimiter
public TrackMessageSizeInterceptor messageDelimiter(java.lang.String endString)
Set the character delimiter used by this class to separate message.- Returns:
- this
-
excludedContentType
public TrackMessageSizeInterceptor excludedContentType(java.lang.String excludedContentType)
Exclude response's content-type from being processed by this class.- Parameters:
excludedContentType- the value ofAtmosphereResponseImpl.getContentType()- Returns:
- this
-
excludedContentTypes
public java.util.HashSet<java.lang.String> excludedContentTypes()
-
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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAtmosphereInterceptorAdapter
-
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
-
-