Package org.cometd.server.transport
Class AbstractHttpTransport.LongPollScheduler
- java.lang.Object
-
- org.cometd.server.transport.AbstractHttpTransport.LongPollScheduler
-
- All Implemented Interfaces:
Runnable
,EventListener
,javax.servlet.AsyncListener
,AbstractServerTransport.Scheduler
,AbstractHttpTransport.HttpScheduler
- Direct Known Subclasses:
AbstractStreamHttpTransport.DispatchingLongPollScheduler
- Enclosing class:
- AbstractHttpTransport
protected abstract class AbstractHttpTransport.LongPollScheduler extends Object implements Runnable, AbstractHttpTransport.HttpScheduler, javax.servlet.AsyncListener
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LongPollScheduler(AbstractHttpTransport.Context context, Promise<Void> promise, ServerMessage.Mutable message, long timeout)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancel()
Invoked when the transport wants to cancel scheduled operations that will trigger when the /meta/connect timeout fires.void
destroy()
Invoked when the transport wants to abort communication.protected abstract void
dispatch(boolean timeout)
AbstractHttpTransport.Context
getContext()
ServerMessage.Mutable
getMessage()
Promise<Void>
getPromise()
void
onComplete(javax.servlet.AsyncEvent asyncEvent)
void
onError(javax.servlet.AsyncEvent event)
void
onStartAsync(javax.servlet.AsyncEvent event)
void
onTimeout(javax.servlet.AsyncEvent event)
void
run()
void
schedule()
Invoked when the transport wants to send queued messages, and possibly a /meta/connect reply.
-
-
-
Constructor Detail
-
LongPollScheduler
protected LongPollScheduler(AbstractHttpTransport.Context context, Promise<Void> promise, ServerMessage.Mutable message, long timeout)
-
-
Method Detail
-
getContext
public AbstractHttpTransport.Context getContext()
-
getMessage
public ServerMessage.Mutable getMessage()
- Specified by:
getMessage
in interfaceAbstractHttpTransport.HttpScheduler
-
schedule
public void schedule()
Description copied from interface:AbstractServerTransport.Scheduler
Invoked when the transport wants to send queued messages, and possibly a /meta/connect reply.- Specified by:
schedule
in interfaceAbstractServerTransport.Scheduler
-
cancel
public void cancel()
Description copied from interface:AbstractServerTransport.Scheduler
Invoked when the transport wants to cancel scheduled operations that will trigger when the /meta/connect timeout fires.- Specified by:
cancel
in interfaceAbstractServerTransport.Scheduler
-
destroy
public void destroy()
Description copied from interface:AbstractServerTransport.Scheduler
Invoked when the transport wants to abort communication.- Specified by:
destroy
in interfaceAbstractServerTransport.Scheduler
-
onStartAsync
public void onStartAsync(javax.servlet.AsyncEvent event)
- Specified by:
onStartAsync
in interfacejavax.servlet.AsyncListener
-
onTimeout
public void onTimeout(javax.servlet.AsyncEvent event)
- Specified by:
onTimeout
in interfacejavax.servlet.AsyncListener
-
onComplete
public void onComplete(javax.servlet.AsyncEvent asyncEvent) throws IOException
- Specified by:
onComplete
in interfacejavax.servlet.AsyncListener
- Throws:
IOException
-
onError
public void onError(javax.servlet.AsyncEvent event)
- Specified by:
onError
in interfacejavax.servlet.AsyncListener
-
dispatch
protected abstract void dispatch(boolean timeout)
-
-