Package org.cometd.server.http
Class AbstractHttpTransport.LongPollScheduler
java.lang.Object
org.cometd.server.http.AbstractHttpTransport.LongPollScheduler
- All Implemented Interfaces:
jakarta.servlet.AsyncListener,java.lang.Runnable,java.util.EventListener,AbstractServerTransport.Scheduler,AbstractHttpTransport.HttpScheduler
- Direct Known Subclasses:
AbstractStreamHttpTransport.DispatchingLongPollScheduler
- Enclosing class:
- AbstractHttpTransport
protected abstract class AbstractHttpTransport.LongPollScheduler extends java.lang.Object implements java.lang.Runnable, AbstractHttpTransport.HttpScheduler, jakarta.servlet.AsyncListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cometd.server.AbstractServerTransport.Scheduler
AbstractServerTransport.Scheduler.None -
Constructor Summary
Constructors Modifier Constructor Description protectedLongPollScheduler(AbstractHttpTransport.Context context, org.cometd.bayeux.Promise<java.lang.Void> promise, ServerMessage.Mutable message, long timeout) -
Method Summary
Modifier and Type Method Description voidcancel()Invoked when the transport wants to cancel 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)AbstractHttpTransport.ContextgetContext()ServerMessage.MutablegetMessage()longgetMetaConnectCycle()org.cometd.bayeux.Promise<java.lang.Void>getPromise()voidonComplete(jakarta.servlet.AsyncEvent asyncEvent)voidonError(jakarta.servlet.AsyncEvent event)voidonStartAsync(jakarta.servlet.AsyncEvent event)voidonTimeout(jakarta.servlet.AsyncEvent event)voidrun()voidschedule()Invoked when the transport wants to send queued messages, and possibly a /meta/connect reply.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
LongPollScheduler
protected LongPollScheduler(AbstractHttpTransport.Context context, org.cometd.bayeux.Promise<java.lang.Void> promise, ServerMessage.Mutable message, long timeout)
-
-
Method Details
-
getContext
-
getPromise
public org.cometd.bayeux.Promise<java.lang.Void> getPromise() -
getMessage
- Specified by:
getMessagein interfaceAbstractHttpTransport.HttpScheduler
-
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
public void cancel()Description copied from interface:AbstractServerTransport.SchedulerInvoked when the transport wants to cancel 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
public void run()- Specified by:
runin interfacejava.lang.Runnable
-
onStartAsync
public void onStartAsync(jakarta.servlet.AsyncEvent event)- Specified by:
onStartAsyncin interfacejakarta.servlet.AsyncListener
-
onTimeout
public void onTimeout(jakarta.servlet.AsyncEvent event)- Specified by:
onTimeoutin interfacejakarta.servlet.AsyncListener
-
onComplete
public void onComplete(jakarta.servlet.AsyncEvent asyncEvent) throws java.io.IOException- Specified by:
onCompletein interfacejakarta.servlet.AsyncListener- Throws:
java.io.IOException
-
onError
public void onError(jakarta.servlet.AsyncEvent event)- Specified by:
onErrorin interfacejakarta.servlet.AsyncListener
-
dispatch
protected abstract void dispatch(boolean timeout) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-