public class PtolemyWebSocketServlet extends org.eclipse.jetty.websocket.WebSocketServlet implements WebSocketService
Red (ltrnc) |
Red (ltrnc) |
Constructor and Description |
---|
PtolemyWebSocketServlet()
Create a new servlet.
|
Modifier and Type | Method and Description |
---|---|
void |
clearEndpoints()
Clear the list of endpoints.
|
org.eclipse.jetty.websocket.WebSocket |
doWebSocketConnect(javax.servlet.http.HttpServletRequest request,
java.lang.String protocol)
Upon receiving a connect request, create a new websocket endpoint to
manage communication.
|
java.net.URI |
getRelativePath()
Not used here.
|
void |
onMessage(WebSocketEndpoint sender,
java.lang.String message)
Broadcast message to other recipient actors in the Ptolemy model.
|
void |
setConnection(org.eclipse.jetty.websocket.WebSocket.Connection connection)
Set the websocket connection that the service should use.
|
void |
setRelativePath(java.net.URI relativePath)
Not used here.
|
checkOrigin, destroy, init, service
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public org.eclipse.jetty.websocket.WebSocket doWebSocketConnect(javax.servlet.http.HttpServletRequest request, java.lang.String protocol)
doWebSocketConnect
in interface org.eclipse.jetty.websocket.WebSocketFactory.Acceptor
request
- The request.protocol
- The protocol of the request.public void clearEndpoints()
public java.net.URI getRelativePath()
getRelativePath
in interface WebSocketService
setRelativePath(URI)
public void onMessage(WebSocketEndpoint sender, java.lang.String message)
onMessage
in interface WebSocketService
sender
- The WebSocketEndpoint that sent the message.message
- The message that was received.public void setConnection(org.eclipse.jetty.websocket.WebSocket.Connection connection)
WebSocketService
setConnection
in interface WebSocketService
public void setRelativePath(java.net.URI relativePath)
setRelativePath
in interface WebSocketService
relativePath
- The URI to associate with this servlet.getRelativePath()