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.LongpollSession
for the givenClientSession
of the session layer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
dispatch
(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.void
service
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, long lastEventId) Services requests from theLongpollTransportServlet
.void
shutdown()
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.LongpollSession
for the givenClientSession
of the session layer.- Parameters:
client
- theClientSession
of the session layer, for that aLongpollTransportServlet.LongpollSession
should 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.TransportSession
Try to dispatch a message via the transport connection to the connected client. Returntrue
if dispatching was successful,false
otherwise.- Parameters:
message
- that should be sent to the client.- Returns:
true
if message could be forwarded,false
otherwise
-
getMethod
Description copied from interface:com.levigo.jadice.web.transport.server.session.internal.TransportSession
Return 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
- TheHttpServletRequest
of the client.response
- TheHttpServletRequest
of 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.TransportSession
Perform a server-initiated shutdown of the transport session.- Specified by:
shutdown
in interfacecom.levigo.jadice.web.transport.server.session.internal.TransportSession
- Specified by:
shutdown
in classAbstractTransportServlet<LongpollTransportServlet.LongpollSession>.AbstractTransportSession
-