/** * Stops the Grizzly service. */ @Override public void stop() throws IOException { grizzlyListener.stop(); }
/** * Start internal Grizzly listener. * @throws IOException */ protected void start0() throws IOException { final long t1 = System.currentTimeMillis(); grizzlyListener.start(); if (logger.isLoggable(Level.INFO)) { logger.log(Level.INFO, KernelLoggerInfo.grizzlyStarted, new Object[]{Grizzly.getDotedVersion(), System.currentTimeMillis() - t1, grizzlyListener.getAddress() + ":" + grizzlyListener.getPort()}); } }
@Override public void destroy() { grizzlyListener.destroy(); }
public void run() { try { grizzlyListener.start(); } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new RuntimeException(e.getMessage()); } } }
/** * {@inheritDoc} */ @Override public void registerEndpoint(final Endpoint endpoint) { final HttpAdapter httpAdapter = grizzlyListener.getAdapter(HttpAdapter.class); if (httpAdapter != null) { httpAdapter.getMapper().register(endpoint); } }
public void register(String contextRoot, Collection<String> vs, HttpHandler httpService, ApplicationContainer container) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "MAPPER({0}) REGISTER contextRoot: {1} adapter: {2} container: {3} port: {4}", new Object[]{this, contextRoot, httpService, container, String.valueOf(listener.getPort())}); } mapMultipleAdapter = true; ContextRootInfo c = new ContextRootInfo(httpService, container); for (String host : vs) { mapper.addContext(host, contextRoot, c, new String[0], null); /* if (adapter instanceof StaticResourcesAdapter) { mapper.addWrapper(host, ctx, wrapper, c); } */ } }
/** * Create a <code>GrizzlyServiceListener</code> based on a NetworkListener * configuration object. */ public void initialize() throws IOException { String port = networkListener.getPort(); portNumber = 8080; if (port == null) { logger.severe(KernelLoggerInfo.noPort); throw new RuntimeException("Cannot find port information from domain configuration"); } try { portNumber = Integer.parseInt(port); } catch (NumberFormatException e) { logger.log(Level.SEVERE, KernelLoggerInfo.badPort, port); } try { address = InetAddress.getByName(networkListener.getAddress()); } catch (UnknownHostException ex) { LogHelper.log(logger, Level.SEVERE, KernelLoggerInfo.badAddress, ex, address); } grizzlyListener = createGrizzlyListener(networkListener); grizzlyListener.configure(grizzlyService.getHabitat(), networkListener); }
if (proxy != null) { GrizzlyListener netListener = proxy.getUnderlyingListener(); netListener.processDynamicConfigurationChange( grizzlyService.getHabitat(), changedProperties); return null;
/** * Removes the context-root from our list of endpoints. */ @Override public void unregisterEndpoint(String contextRoot, ApplicationContainer app) throws EndpointRegistrationException { final HttpAdapter httpAdapter = grizzlyListener.getAdapter(HttpAdapter.class); if (httpAdapter != null) { httpAdapter.getMapper().unregister(contextRoot); } }
public void shutdown() throws IOException { synchronized (listeners) { for (GrizzlyListener listener : listeners) { try { listener.stop(); } catch (Exception e) { e.printStackTrace(); } } listeners.clear(); } }
@Override public void registerEndpoint(String contextRoot, Collection<String> vsServers, HttpHandler endpointService, ApplicationContainer container) throws EndpointRegistrationException { // e.g., there is no admin service in an instance if (contextRoot == null) { return; } if (endpointService == null) { throw new EndpointRegistrationException( "The endpoint adapter is null"); } final HttpAdapter httpAdapter = grizzlyListener.getAdapter(HttpAdapter.class); if (httpAdapter != null) { httpAdapter.getMapper().register(contextRoot, vsServers, endpointService, container); } }
public void shutdownNetwork() { synchronized (listeners) { for (GrizzlyListener listener : listeners) { try { listener.stop(); } catch (Exception e) { e.printStackTrace(); } } listeners.clear(); } }
public void shutdown() throws IOException { synchronized (listeners) { for (GrizzlyListener listener : listeners) { try { listener.stop(); } catch (Exception e) { e.printStackTrace(); } } listeners.clear(); } }
public void shutdownNetwork() { synchronized (listeners) { for (GrizzlyListener listener : listeners) { try { listener.stop(); } catch (Exception e) { e.printStackTrace(); } } listeners.clear(); } }