/** * Create a clustered Vertx instance * @param port The port to listen for cluster connections * @param hostname The hostname or ip address to listen for cluster connections */ public static Vertx newVertx(int port, String hostname) { return loadFactory().createVertx(port, hostname); }
@Override public void handle(AsyncResult<HttpServer> result) { if (result.succeeded()) { startedResult.setResult(null); } else { startedResult.setFailure(result.cause()); } } });
@Override public Subscription schedule(final Action0 action) { vertx.currentContext().runOnContext(new Handler<Void>() { public void handle(Void event) { if (innerSubscription.isUnsubscribed()) return; action.call(); } }); return this.innerSubscription; }
void handleException(Exception e) { if (exceptionHandler != null) { exceptionHandler.handle(e); } }
public void handle(AsyncResult<String> res) { if (res.failed()) { // Failed to deploy unblock(); } } };
Auth(final String sessionID, final SockJSSocket sock) { timerID = vertx.setTimer(authTimeout, new Handler<Long>() { public void handle(Long id) { uncacheAuthorisation(sessionID, sock); } }); }
private void callCompletionHandler(AsyncResultHandler<Void> completionHandler) { AsyncResult<Void> f = new AsyncResult<>((Void)null); completionHandler.handle(f); }
/** * Handle the event. It should be overridden by the user. */ protected abstract void handle(); }
@Override public void handle(AsyncResult<HttpServer> ar) { if (!ar.succeeded()) { result.setFailure(ar.cause()); } else { result.setResult(null); } } });
public void handle(WebSocketMatcher.Match match) { if (wsHandler != null) { wsHandler.handle(match.ws); } } });
/** * Create a clustered Vertx instance listening for cluster connections on the default port 25500 * @param hostname The hostname or ip address to listen for cluster connections */ public static Vertx newVertx(String hostname) { return loadFactory().createVertx(hostname); }
void handleEnd() { if (endHandler != null) { checkContext(); endHandler.handle(null); } } };
/** * Create a non clustered Vertx instance */ public static Vertx newVertx() { return loadFactory().createVertx(); }
void writable() { if (drainHandler != null) { Handler<Void> dh = drainHandler; drainHandler = null; dh.handle(null); } }
private void onFailure(Throwable error) { failed = true; Handler<Throwable> handler = plainExceptionHandler; if( handler!=null ) { handler.handle(error); } }
void handleChunk(Buffer data) { if (dataHandler != null) { dataHandler.handle(data); } }
private void checkDrained() { if (drainHandler != null && writesOutstanding <= lwm) { Handler<Void> handler = drainHandler; drainHandler = null; handler.handle(null); } }
void handleEnd() { if (endHandler != null) { endHandler.handle(null); } }
void handleException(Exception e) { if (exceptionHandler != null) { exceptionHandler.handle(e); } } }
void handleException(Exception e) { if (exceptionHandler != null) { exceptionHandler.handle(e); } }