|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.interceptor.AtmosphereResourceLifecycleInterceptor
public class AtmosphereResourceLifecycleInterceptor
This AtmosphereInterceptor implementation automatically suspends the intercepted
AtmosphereResource and takes care of managing the response's state (flushing, resuming,
etc.) when a Broadcaster.broadcast(java.lang.Object) is invoked. When used, AtmosphereHandler implementations no longer need to make calls to
AtmosphereResource.suspend().
Broadcaster, this interceptor will not work and you need to programmatically
resume, flush, etc.
By default, intercepted AtmosphereResource instances are suspended when a GET
request is received. You can change the triggering http method by configuring
ApplicationConfig.ATMOSPHERERESOURCE_INTERCEPTOR_METHOD
Use this class when you don't want to manage the suspend/resume operation from your
particular Atmosphere framework implementation classes (AtmosphereHandler,
WebSocketHandler, or
Meteor instances) or extensions (GWT, Jersey, Wicket, etc...)
HeaderConfig.X_ATMOSPHERE_TRANSPORT header. Your AtmosphereHandler must also extends the
AbstractReflectorAtmosphereHandler or implements the logic defined inside
AbstractReflectorAtmosphereHandler.postStateChange(org.atmosphere.cpr.AtmosphereResourceEvent)
| Constructor Summary | |
|---|---|
AtmosphereResourceLifecycleInterceptor()
|
|
| Method Summary | |
|---|---|
void |
configure(AtmosphereConfig config)
Allow this object to configure it's state when initialized |
Action |
inspect(AtmosphereResource r)
Automatically suspend the AtmosphereResource based on AtmosphereResource.TRANSPORT value. |
void |
postInspect(AtmosphereResource r)
Invoked after an AtmosphereResource gets dispatched to AtmosphereHandler |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AtmosphereResourceLifecycleInterceptor()
| Method Detail |
|---|
public void configure(AtmosphereConfig config)
AtmosphereInterceptor
configure in interface AtmosphereInterceptorconfig - an AtmosphereConfigpublic Action inspect(AtmosphereResource r)
AtmosphereResource based on AtmosphereResource.TRANSPORT value.
inspect in interface AtmosphereInterceptorr - a AtmosphereResource
public void postInspect(AtmosphereResource r)
AtmosphereInterceptorAtmosphereResource gets dispatched to AtmosphereHandler
postInspect in interface AtmosphereInterceptorr - a AtmosphereResourcepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||