/** * Creates a vert.x {@link HttpServer} with a jersey handler */ default void start() { start(null); }
/** * Release resources */ default void close() { stop(); }
/** * {@inheritDoc} */ @Override public void stop() { jerseyServer.close(); jerseyServer = null; } }
@Override public URI getBaseUri() { if (baseUri == null) { baseUri = getContainer().getOptions().getBaseUri(); if (baseUri == null) { throw new IllegalStateException("baseUri is null, have you called init() first?"); } } return baseUri; }
public int getMaxBodySize() { if (maxBodySize == null) { maxBodySize = getContainer().getOptions().getMaxBodySize(); if (maxBodySize <= 0) { maxBodySize = DefaultJerseyOptions.DEFAULT_MAX_BODY_SIZE; } } return maxBodySize; }
@Override public void init(JerseyConfigurator configurator) { baseUri = configurator.getBaseUri(); maxBodySize = configurator.getMaxBodySize(); applicationHandlerDelegate = configurator.getApplicationHandler(); logger.debug("DefaultJerseyHandler - initialized"); }
@Override public void handle(Void aVoid) { // Resume the vert.x request if we haven't already read the body if (inputStream == null) { vertxRequest.resume(); } applicationHandlerDelegate.handle(jerseyRequest); } });
/** * Creates a vert.x {@link HttpServer} with a jersey handler * * @param configurator http server and jersey configuration settings */ default void init(JerseyConfigurator configurator) { init(configurator, null); }
@Override public URI getBaseUri() { if (baseUri == null) { baseUri = getContainer().getOptions().getBaseUri(); if (baseUri == null) { throw new IllegalStateException("baseUri is null, have you called init() first?"); } } return baseUri; }
public int getMaxBodySize() { if (maxBodySize == null) { maxBodySize = getContainer().getOptions().getMaxBodySize(); if (maxBodySize <= 0) { maxBodySize = DefaultJerseyOptions.DEFAULT_MAX_BODY_SIZE; } } return maxBodySize; }
/** * {@inheritDoc} */ @Override public void stop() { jerseyServer.close(); jerseyServer = null; } }
/** * Creates a vert.x {@link HttpServer} with a jersey handler */ default void start() { start(null); }
/** * Release resources */ default void close() { stop(); }
/** * {@inheritDoc} */ @Override public void stop() { jerseyServer.close(); jerseyServer = null; } }
/** * Creates a vert.x {@link HttpServer} with a jersey handler * * @param options http server and jersey configuration settings * @param doneHandler the optional callback for when initialization has completed * @deprecated Use start(doneHandler) instead */ @Deprecated default void init(JerseyOptions options, Handler<AsyncResult<HttpServer>> doneHandler) { start(doneHandler); }
@Override protected void tearDown() throws Exception { if (jerseyServer != null) { jerseyServer.close(); jerseyServer = null; } super.tearDown(); }