Package org.cometd.server.http
Class AbstractHttpTransport.LongPollScheduler
java.lang.Object
org.cometd.server.http.AbstractHttpTransport.LongPollScheduler
- All Implemented Interfaces:
java.lang.Runnable
,java.util.EventListener
,javax.servlet.AsyncListener
,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, javax.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 protected
LongPollScheduler(AbstractHttpTransport.Context context, Promise<java.lang.Void> promise, ServerMessage.Mutable message, long timeout)
-
Method Summary
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()
long
getMetaConnectCycle()
Promise<java.lang.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.java.lang.String
toString()
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, Promise<java.lang.Void> promise, ServerMessage.Mutable message, long timeout)
-
-
Method Details
-
getContext
-
getPromise
-
getMessage
- Specified by:
getMessage
in interfaceAbstractHttpTransport.HttpScheduler
-
getMetaConnectCycle
public long getMetaConnectCycle()- Specified by:
getMetaConnectCycle
in interfaceAbstractServerTransport.Scheduler
- Returns:
- the cycle number for suspended
/meta/connect
s.
-
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
-
run
public void run()- Specified by:
run
in interfacejava.lang.Runnable
-
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 java.io.IOException- Specified by:
onComplete
in interfacejavax.servlet.AsyncListener
- Throws:
java.io.IOException
-
onError
public void onError(javax.servlet.AsyncEvent event)- Specified by:
onError
in interfacejavax.servlet.AsyncListener
-
dispatch
protected abstract void dispatch(boolean timeout) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-