Class LongpollTransportServlet.LongpollSession
java.lang.Object
AbstractTransportServlet<LongpollTransportServlet.LongpollSession>.com.levigo.jadice.web.transport.server.networking.AbstractTransportServlet.AbstractTransportSession
com.levigo.jadice.web.transport.server.networking.longpoll.LongpollTransportServlet.LongpollSession
- All Implemented Interfaces:
com.levigo.jadice.web.transport.server.session.internal.TransportSession
- Enclosing class:
LongpollTransportServlet
public class LongpollTransportServlet.LongpollSession
extends AbstractTransportServlet<LongpollTransportServlet.LongpollSession>.AbstractTransportSession
Represents a longpoll session for a single client.
-
Field Summary
Fields inherited from class com.levigo.jadice.web.transport.server.networking.AbstractTransportServlet.AbstractTransportSession
client, MAX_MESSAGE_COUNT, MAX_PENDING_POLLS, MAX_RESPONSE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionLongpollSession(ClientSession client) Constructs aLongpollTransportServlet.LongpollSessionfor the givenClientSessionof the session layer. -
Method Summary
Modifier and TypeMethodDescriptionbooleandispatch(com.levigo.jadice.web.transport.server.session.internal.ServerToClientMessage message) Try to dispatch a message via the transport connection to the connected client.Return the method used to communicate with the client, i.e. the kind of transport that is used.voidservice(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, long lastEventId) Services requests from theLongpollTransportServlet.voidshutdown()Perform a server-initiated shutdown of the transport session.Methods inherited from class com.levigo.jadice.web.transport.server.networking.AbstractTransportServlet.AbstractTransportSession
readLine, receiveAndDispatchIncomingMessages
-
Constructor Details
-
LongpollSession
Constructs aLongpollTransportServlet.LongpollSessionfor the givenClientSessionof the session layer.- Parameters:
client- theClientSessionof the session layer, for that aLongpollTransportServlet.LongpollSessionshould be created.
-
-
Method Details
-
dispatch
public boolean dispatch(com.levigo.jadice.web.transport.server.session.internal.ServerToClientMessage message) Description copied from interface:com.levigo.jadice.web.transport.server.session.internal.TransportSessionTry to dispatch a message via the transport connection to the connected client. Returntrueif dispatching was successful,falseotherwise.- Parameters:
message- that should be sent to the client.- Returns:
trueif message could be forwarded,falseotherwise
-
getMethod
Description copied from interface:com.levigo.jadice.web.transport.server.session.internal.TransportSessionReturn the method used to communicate with the client, i.e. the kind of transport that is used.- Returns:
- The current communication method of client.
-
service
public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, long lastEventId) throws IOException, jakarta.servlet.ServletException Services requests from theLongpollTransportServlet.TODO remove unused variable #isExistingClientSession
- Parameters:
request- TheHttpServletRequestof the client.response- TheHttpServletRequestof the server.lastEventId- The last event id, extracted from the request.- Throws:
IOException- If an error occurred trying to read the request message.jakarta.servlet.ServletException- When the size of the message received is greater thenAbstractTransportServlet.getMaxMessageSize()bytes.
-
shutdown
public void shutdown()Description copied from interface:com.levigo.jadice.web.transport.server.session.internal.TransportSessionPerform a server-initiated shutdown of the transport session.- Specified by:
shutdownin interfacecom.levigo.jadice.web.transport.server.session.internal.TransportSession- Specified by:
shutdownin classAbstractTransportServlet<LongpollTransportServlet.LongpollSession>.AbstractTransportSession
-