Defines a STOMP server. STOMP servers delegates to a StompServerHandler that let customize the behavior of the server. By default, it uses a handler compliant with the STOMP specification, but let you change anything.
Constructor and description |
---|
StompServer
(java.lang.Object delegate) |
Type | Name and description |
---|---|
int |
actualPort() Gets the port on which the server is listening. |
void |
close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> completionHandler) Closes the server. |
void |
close() Closes the server. |
static StompServer |
create(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options) Creates a StompServer based on the default Stomp Server implementation. |
static StompServer |
create(Vertx vertx, NetServer netServer) Creates a StompServer based on the default Stomp Server implementation. |
static StompServer |
create(Vertx vertx, NetServer net, java.util.Map<java.lang.String, java.lang.Object> options) Creates a StompServer based on the default Stomp Server implementation. |
static StompServer |
create(Vertx vertx) Creates a StompServer based on the default Stomp Server implementation, and use the default options. |
java.lang.Object |
getDelegate() |
StompServer |
handler(StompServerHandler handler) Configures the StompServerHandler. |
boolean |
isListening() Checks whether or not the server is listening. |
StompServer |
listen(int port) Connects the STOMP server to the given port. |
StompServer |
listen(int port, java.lang.String host) Connects the STOMP server to the given port / interface. |
StompServer |
listen() Connects the STOMP server to the port / host configured in the server options. |
StompServer |
listen(io.vertx.core.Handler<io.vertx.core.AsyncResult<StompServer>> handler) Connects the STOMP server default port (61613) and network interface ( 0.0.0.0 ). |
StompServer |
listen(int port, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompServer>> handler) Connects the STOMP server to the given port. |
StompServer |
listen(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompServer>> handler) Connects the STOMP server to the given port / interface. |
java.util.Map<java.lang.String, java.lang.Object> |
options() @return the server options |
StompServerHandler |
stompHandler()
|
Vertx |
vertx()
|
io.vertx.core.Handler<ServerWebSocket> |
webSocketHandler() Gets the able to manage web socket connections. |
StompServer |
writingFrameHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the handler that is invoked every time a frame is going to be written to the "wire". |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Gets the port on which the server is listening.
This is useful if you bound the server specifying 0 as port number signifying an ephemeral port.Closes the server.
completionHandler
- handler called once the server has been stoppedCloses the server.
Creates a StompServer based on the default Stomp Server implementation.
vertx
- the vert.x instance to useoptions
- the server options (see StompServerOptions)Creates a StompServer based on the default Stomp Server implementation.
vertx
- the vert.x instance to usenetServer
- the Net server used by the STOMP serverCreates a StompServer based on the default Stomp Server implementation.
vertx
- the vert.x instance to usenet
- the Net server used by the STOMP serveroptions
- the server options (see StompServerOptions)Creates a StompServer based on the default Stomp Server implementation, and use the default options.
vertx
- the vert.x instance to useConfigures the StompServerHandler. You must calls this method before calling the StompServer.listen method.
handler
- the handlerChecks whether or not the server is listening.
true
if the server is listening, false
otherwiseConnects the STOMP server to the given port.
port
- the portConnects the STOMP server to the given port / interface.
port
- the porthost
- the interfaceConnects the STOMP server to the port / host configured in the server options.
Connects the STOMP server default port (61613) and network interface (0.0.0.0
). Once the socket
it bounds calls the given handler with the result. The result may be a failure if the socket is already used.
handler
- the handler to call with the result Connects the STOMP server to the given port. This method use the default host (0.0.0.0
). Once the socket
it bounds calls the given handler with the result. The result may be a failure if the socket is already used.
port
- the porthandler
- the handler to call with the resultConnects the STOMP server to the given port / interface. Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.
port
- the porthost
- the host / interfacehandler
- the handler to call with the result
Gets the able to manage web socket connections. If the web socket bridge is disabled, it returns
null
.
Configures the handler that is invoked every time a frame is going to be written to the "wire". It lets you log the frames, but also adapt the frame if needed.
handler
- the handler, must not be null