/** * Stops the container */ @Override public void stop() { if (!started) { return; } getApplicationHandler().onShutdown(this); applicationHandlerDelegate = null; started = false; }
@Test public void testStart() throws Exception { packages.add("com.englishtown.vertx.jersey.resources"); container = new DefaultVertxContainer(vertx, options, locator, null); container.start(); assertEquals(options, container.getOptions()); assertNotNull(container.getConfiguration()); assertNotNull(container.getApplicationHandler()); assertNotNull(container.getApplicationHandlerDelegate()); // Can't mock applicationHandler so can't verify onStartup() was called }
/** * Stops the container */ @Override public void stop() { if (!started) { return; } getApplicationHandler().onShutdown(this); applicationHandlerDelegate = null; started = false; }
/** * Return an immutable representation of the current {@link ResourceConfig * configuration}. * * @return current configuration of the hosted Jersey application. */ @Override public ResourceConfig getConfiguration() { ApplicationHandler handler = getApplicationHandler(); return handler == null ? null : handler.getConfiguration(); }
/** * Return an immutable representation of the current {@link ResourceConfig * configuration}. * * @return current configuration of the hosted Jersey application. */ @Override public ResourceConfig getConfiguration() { ApplicationHandler handler = getApplicationHandler(); return handler == null ? null : handler.getConfiguration(); }
/** * Starts the container */ @Override public void start() { if (started) { return; } ApplicationHandler handler = getApplicationHandler(); if (handler == null) { throw new IllegalStateException("ApplicationHandler cannot be null"); } handler.onStartup(this); started = true; }
/** * Starts the container */ @Override public void start() { if (started) { return; } ApplicationHandler handler = getApplicationHandler(); if (handler == null) { throw new IllegalStateException("ApplicationHandler cannot be null"); } handler.onStartup(this); started = true; }
/** * Reload the hosted Jersey application using a new {@link ResourceConfig * configuration}. * * @param configuration new configuration used for the reload. */ @Override public void reload(ResourceConfig configuration) { ApplicationHandler applicationHandler = new ApplicationHandler(configuration, null, locator); applicationHandlerDelegate = new DefaultApplicationHandlerDelegate(applicationHandler); getApplicationHandler().onReload(this); applicationHandler.onStartup(this); }
/** * Reload the hosted Jersey application using a new {@link ResourceConfig * configuration}. * * @param configuration new configuration used for the reload. */ @Override public void reload(ResourceConfig configuration) { ApplicationHandler applicationHandler = new ApplicationHandler(configuration, null, locator); applicationHandlerDelegate = new DefaultApplicationHandlerDelegate(applicationHandler); getApplicationHandler().onReload(this); applicationHandler.onStartup(this); }