public interface StompServer
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.Modifier and Type | Method and Description |
---|---|
int |
actualPort()
Gets the port on which the server is listening.
|
Future<Void> |
close()
Closes the server.
|
void |
close(Handler<AsyncResult<Void>> completionHandler)
Closes the server.
|
static StompServer |
create(Vertx vertx)
Creates a
StompServer based on the default Stomp Server implementation, and use the default options. |
static StompServer |
create(Vertx vertx,
NetServer netServer)
Creates a
StompServer based on the default Stomp Server implementation. |
static StompServer |
create(Vertx vertx,
NetServer net,
StompServerOptions options)
Creates a
StompServer based on the default Stomp Server implementation. |
static StompServer |
create(Vertx vertx,
StompServerOptions options)
Creates a
StompServer based on the default Stomp Server implementation. |
StompServer |
handler(StompServerHandler handler)
Configures the
StompServerHandler . |
boolean |
isListening()
Checks whether or not the server is listening.
|
Future<StompServer> |
listen()
Connects the STOMP server to the port / host configured in the server options.
|
StompServer |
listen(Handler<AsyncResult<StompServer>> handler)
Connects the STOMP server default port (61613) and network interface (
0.0.0.0 ). |
Future<StompServer> |
listen(int port)
Connects the STOMP server to the given port.
|
StompServer |
listen(int port,
Handler<AsyncResult<StompServer>> handler)
Connects the STOMP server to the given port.
|
Future<StompServer> |
listen(int port,
String host)
Connects the STOMP server to the given port / interface.
|
StompServer |
listen(int port,
String host,
Handler<AsyncResult<StompServer>> handler)
Connects the STOMP server to the given port / interface.
|
StompServerOptions |
options() |
StompServerHandler |
stompHandler() |
Vertx |
vertx() |
Handler<ServerWebSocket> |
webSocketHandler()
Gets the
Handler able to manage web socket connections. |
StompServer |
writingFrameHandler(Handler<ServerFrame> handler)
Configures the handler that is invoked every time a frame is going to be written to the "wire".
|
static StompServer create(Vertx vertx, StompServerOptions options)
StompServer
based on the default Stomp Server implementation.vertx
- the vert.x instance to useoptions
- the server optionsStompServer
static StompServer create(Vertx vertx, NetServer netServer)
StompServer
based on the default Stomp Server implementation.vertx
- the vert.x instance to usenetServer
- the Net server used by the STOMP serverStompServer
static StompServer create(Vertx vertx, NetServer net, StompServerOptions options)
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 optionsStompServer
static StompServer create(Vertx vertx)
StompServer
based on the default Stomp Server implementation, and use the default options.vertx
- the vert.x instance to useStompServer
StompServer handler(StompServerHandler handler)
StompServerHandler
. You must calls this method before calling the listen()
method.handler
- the handlerStompServer
Future<StompServer> listen(int port)
port
- the portFuture<StompServer> listen(int port, String host)
port
- the porthost
- the interfaceFuture<StompServer> listen()
StompServer listen(Handler<AsyncResult<StompServer>> handler)
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 resultStompServer
StompServer listen(int port, Handler<AsyncResult<StompServer>> handler)
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 resultStompServer
StompServer listen(int port, String host, Handler<AsyncResult<StompServer>> handler)
port
- the porthost
- the host / interfacehandler
- the handler to call with the resultStompServer
void close(Handler<AsyncResult<Void>> completionHandler)
completionHandler
- handler called once the server has been stoppedboolean isListening()
true
if the server is listening, false
otherwiseint actualPort()
NetServer.actualPort()
StompServerOptions options()
Vertx vertx()
StompServerHandler stompHandler()
StompServerHandler
used by this server.Handler<ServerWebSocket> webSocketHandler()
Handler
able to manage web socket connections. If the web socket bridge is disabled, it returns
null
.HttpServer.webSocketHandler(Handler)
.StompServer writingFrameHandler(Handler<ServerFrame> handler)
handler
- the handler, must not be null
StompServer
Copyright © 2024 Eclipse. All rights reserved.