public class ManagedAtmosphereHandler extends AbstractReflectorAtmosphereHandler implements AnnotatedProxy, AtmosphereResourceHeartbeatEventListener
AtmosphereHandler that implement support for Atmosphere 2.0 annotations.| Modifier and Type | Class and Description |
|---|---|
static class |
ManagedAtmosphereHandler.Managed |
static class |
ManagedAtmosphereHandler.MethodInfo |
AbstractReflectorAtmosphereHandler.Default| Modifier and Type | Field and Description |
|---|---|
protected List<ManagedAtmosphereHandler.MethodInfo> |
onRuntimeMethod |
protected boolean |
pathParams |
protected AtmosphereResourceFactory |
resourcesFactory |
| Constructor and Description |
|---|
ManagedAtmosphereHandler() |
| Modifier and Type | Method and Description |
|---|---|
AnnotatedProxy |
configure(AtmosphereConfig config,
Object c)
Configure the proxy.
|
void |
onHeartbeat(AtmosphereResourceEvent event)
Notifies the heartbeat for the given resource to the annotated method if exists.
|
void |
onRequest(AtmosphereResource resource)
When a client sends a request to its associated
AtmosphereHandler, it can decide if the underlying
connection can be suspended (creating a Continuation) or handle the connection synchronously. |
void |
onStateChange(AtmosphereResourceEvent event)
Write the
AtmosphereResourceEvent.getMessage() back to the client using
the AtmosphereResponseImpl.getOutputStream() or AtmosphereResponseImpl.getWriter(). |
boolean |
pathParams()
Return true if
PathParam are supported. |
protected boolean |
pathParams(Object o) |
protected Method |
populate(Object c,
Class<? extends Annotation> annotation) |
protected List<ManagedAtmosphereHandler.MethodInfo> |
populateMessage(Object c,
Class<? extends Annotation> annotation) |
protected void |
processReady(AtmosphereResource r) |
Object |
target()
The Object the
AtmosphereHandler is proxying. |
String |
toString() |
destroy, init, postStateChange, useTwoStepWrite, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdestroyprotected List<ManagedAtmosphereHandler.MethodInfo> onRuntimeMethod
protected boolean pathParams
protected AtmosphereResourceFactory resourcesFactory
public AnnotatedProxy configure(AtmosphereConfig config, Object c)
AnnotatedProxyconfigure in interface AnnotatedProxypublic void onRequest(AtmosphereResource resource) throws IOException
AtmosphereHandlerAtmosphereHandler, 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.onRequest in interface AtmosphereHandlerresource - an AtmosphereResourceIOExceptionpublic void onStateChange(AtmosphereResourceEvent event) throws IOException
AbstractReflectorAtmosphereHandlerAtmosphereResourceEvent.getMessage() back to the client using
the AtmosphereResponseImpl.getOutputStream() or AtmosphereResponseImpl.getWriter().
If a Serializer is defined, it will be invoked and the write operation
will be delegated to it.
By default, this method will try to use AtmosphereResponseImpl.getWriter().onStateChange in interface AtmosphereHandleronStateChange in class AbstractReflectorAtmosphereHandlerevent - the AtmosphereResourceEvent.getMessage()IOExceptionpublic boolean pathParams()
AnnotatedProxyPathParam are supported.pathParams in interface AnnotatedProxyPathParam are supported.protected boolean pathParams(Object o)
protected Method populate(Object c, Class<? extends Annotation> annotation)
protected List<ManagedAtmosphereHandler.MethodInfo> populateMessage(Object c, Class<? extends Annotation> annotation)
public Object target()
AnnotatedProxyAtmosphereHandler is proxying.target in interface AnnotatedProxyprotected void processReady(AtmosphereResource r)
public void onHeartbeat(AtmosphereResourceEvent event)
Notifies the heartbeat for the given resource to the annotated method if exists.
onHeartbeat in interface AtmosphereResourceHeartbeatEventListenerevent - the eventCopyright © 2016. All rights reserved.