Package org.atmosphere.config.managed
Class ManagedAtmosphereHandler
java.lang.Object
org.atmosphere.handler.AbstractReflectorAtmosphereHandler
org.atmosphere.config.managed.ManagedAtmosphereHandler
- All Implemented Interfaces:
AtmosphereHandler,AtmosphereResourceHeartbeatEventListener,AtmosphereServletProcessor,AnnotatedProxy
public class ManagedAtmosphereHandler
extends AbstractReflectorAtmosphereHandler
implements AnnotatedProxy, AtmosphereResourceHeartbeatEventListener
An internal implementation of
AtmosphereHandler that implement support for Atmosphere 2.0 annotations.- Author:
- Jeanfrancois
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classNested classes/interfaces inherited from class org.atmosphere.handler.AbstractReflectorAtmosphereHandler
AbstractReflectorAtmosphereHandler.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ManagedAtmosphereHandler.MethodInfo> protected booleanprotected AtmosphereResourceFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigure(AtmosphereConfig config, Object c) Configure the proxy.voidNotifies the heartbeat for the given resource to the annotated method if exists.voidonRequest(AtmosphereResource resource) When a client sends a request to its associatedAtmosphereHandler, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously.voidWrite theAtmosphereResourceEvent.getMessage()back to the client using theAtmosphereResponseImpl.getOutputStream()orAtmosphereResponseImpl.getWriter().booleanReturn true ifPathParamare supported.protected booleanpathParams(Object o) protected Methodpopulate(Object c, Class<? extends Annotation> annotation) protected List<ManagedAtmosphereHandler.MethodInfo> protected voidtarget()The Object theAtmosphereHandleris proxying.toString()Methods inherited from class org.atmosphere.handler.AbstractReflectorAtmosphereHandler
destroy, init, postStateChange, useTwoStepWrite, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.atmosphere.cpr.AtmosphereHandler
destroy
-
Field Details
-
onRuntimeMethod
-
pathParams
protected boolean pathParams -
resourcesFactory
-
-
Constructor Details
-
ManagedAtmosphereHandler
public ManagedAtmosphereHandler()
-
-
Method Details
-
configure
Description copied from interface:AnnotatedProxyConfigure the proxy.- Specified by:
configurein interfaceAnnotatedProxy- Parameters:
config-c-- Returns:
-
onRequest
Description copied from interface:AtmosphereHandlerWhen a client sends a request to its associatedAtmosphereHandler, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously. It is recommended to only suspend requests for which HTTP method is a GET and use the POST method to send data to the server, without marking the connection as asynchronous.- Specified by:
onRequestin interfaceAtmosphereHandler- Parameters:
resource- anAtmosphereResource- Throws:
IOException
-
onStateChange
Description copied from class:AbstractReflectorAtmosphereHandlerWrite theAtmosphereResourceEvent.getMessage()back to the client using theAtmosphereResponseImpl.getOutputStream()orAtmosphereResponseImpl.getWriter(). If aSerializeris defined, it will be invoked and the write operation will be delegated to it. By default, this method will try to useAtmosphereResponseImpl.getWriter().- Specified by:
onStateChangein interfaceAtmosphereHandler- Overrides:
onStateChangein classAbstractReflectorAtmosphereHandler- Parameters:
event- theAtmosphereResourceEvent.getMessage()- Throws:
IOException
-
pathParams
public boolean pathParams()Description copied from interface:AnnotatedProxyReturn true ifPathParamare supported.- Specified by:
pathParamsin interfaceAnnotatedProxy- Returns:
- true if
PathParamare supported.
-
pathParams
-
populate
-
populateMessage
-
target
Description copied from interface:AnnotatedProxyThe Object theAtmosphereHandleris proxying.- Specified by:
targetin interfaceAnnotatedProxy- Returns:
-
processReady
-
onHeartbeat
Notifies the heartbeat for the given resource to the annotated method if exists.
- Specified by:
onHeartbeatin interfaceAtmosphereResourceHeartbeatEventListener- Parameters:
event- the event
-
toString
-