Class AbstractHttpTransport.LongPollScheduler
java.lang.Object
org.cometd.server.http.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cometd.server.AbstractServerTransport.Scheduler
AbstractServerTransport.Scheduler.None -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLongPollScheduler(AbstractHttpTransport.Context context, Promise<Void> promise, ServerMessage.Mutable message, long timeout) -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when the transport wants to cancel with the given cause scheduled operations that will trigger when the /meta/connect timeout fires.voiddestroy()Invoked when the transport wants to abort communication.protected abstract voiddispatch(boolean timeout) longvoidonComplete(javax.servlet.AsyncEvent asyncEvent) voidonError(javax.servlet.AsyncEvent event) voidonStartAsync(javax.servlet.AsyncEvent event) voidonTimeout(javax.servlet.AsyncEvent event) voidrun()voidschedule()Invoked when the transport wants to send queued messages, and possibly a /meta/connect reply.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cometd.server.AbstractServerTransport.Scheduler
cancel
-
Constructor Details
-
LongPollScheduler
protected LongPollScheduler(AbstractHttpTransport.Context context, Promise<Void> promise, ServerMessage.Mutable message, long timeout)
-
-
Method Details
-
getContext
-
getPromise
-
getMessage
- Specified by:
getMessagein interfaceAbstractServerTransport.Scheduler- Returns:
- the message associated with this scheduler.
-
getMetaConnectCycle
public long getMetaConnectCycle()- Specified by:
getMetaConnectCyclein interfaceAbstractServerTransport.Scheduler- Returns:
- the cycle number for suspended
/meta/connects.
-
schedule
public void schedule()Description copied from interface:AbstractServerTransport.SchedulerInvoked when the transport wants to send queued messages, and possibly a /meta/connect reply.- Specified by:
schedulein interfaceAbstractServerTransport.Scheduler
-
cancel
Description copied from interface:AbstractServerTransport.SchedulerInvoked when the transport wants to cancel with the given cause scheduled operations that will trigger when the /meta/connect timeout fires.- Specified by:
cancelin interfaceAbstractServerTransport.Scheduler
-
destroy
public void destroy()Description copied from interface:AbstractServerTransport.SchedulerInvoked when the transport wants to abort communication.- Specified by:
destroyin interfaceAbstractServerTransport.Scheduler
-
run
-
onStartAsync
public void onStartAsync(javax.servlet.AsyncEvent event) - Specified by:
onStartAsyncin interfacejavax.servlet.AsyncListener
-
onTimeout
public void onTimeout(javax.servlet.AsyncEvent event) - Specified by:
onTimeoutin interfacejavax.servlet.AsyncListener
-
onComplete
- Specified by:
onCompletein interfacejavax.servlet.AsyncListener- Throws:
IOException
-
onError
public void onError(javax.servlet.AsyncEvent event) - Specified by:
onErrorin interfacejavax.servlet.AsyncListener
-
dispatch
protected abstract void dispatch(boolean timeout) -
toString
-