/** * Notify all {@link MapperUpdateListener}s about update happened. * * @param networkListener {@link NetworkListener}, which {@link Mapper} got changed * @param mapper new {@link Mapper} value */ public void notifyMapperUpdateListeners(NetworkListener networkListener, Mapper mapper) { final HttpService httpService = config.getHttpService(); for(MapperUpdateListener listener : mapperUpdateListeners) { listener.update(httpService, networkListener, mapper); } }
private void processHttpListeners() throws TransactionFailure { if (!currentConfig.getHttpService().getHttpListener().isEmpty()) { // all changes in this method must be in their own transactions migrateSettings(); } }
public void execute(AdminCommandContext context) { for (Config config : configs.getConfig()) { HttpService service = config.getHttpService(); if(service == null) continue; boolean done = false; try { final List<Property> properties = service.getProperty(); final Iterator<Property> iterator = properties.iterator(); while (!done && iterator.hasNext()) { final Property property = iterator.next(); String name = property.getName(); if ("accessLoggingEnabled".equals(name) || "accessLogBufferSize".equals(name) || "accessLogWriteInterval".equals(name) || "sso-enabled".equals(name)) { done = true; upgrade(context, property, service); } } } catch (TransactionFailure tf) { Logger.getAnonymousLogger().log(Level.SEVERE, "Failure while upgrading http-service properties." + " Please check logs for errors", tf); throw new RuntimeException(tf); } } }
public void execute(AdminCommandContext context) { for (Config config : configs.getConfig()) { HttpService service = config.getHttpService(); if(service == null) continue; boolean done = false; try { final List<Property> properties = service.getProperty(); final Iterator<Property> iterator = properties.iterator(); while (!done && iterator.hasNext()) { final Property property = iterator.next(); String name = property.getName(); if ("accessLoggingEnabled".equals(name) || "accessLogBufferSize".equals(name) || "accessLogWriteInterval".equals(name) || "sso-enabled".equals(name)) { done = true; upgrade(context, property, service); } } } catch (TransactionFailure tf) { ConfigApiLoggerInfo.getLogger().log(Level.SEVERE, ConfigApiLoggerInfo.ERR_UPGRADE_HTTP_SVC_PROPS, tf); throw new RuntimeException(tf); } } }
@Override public void registerEndpoint(String contextRoot, HttpHandler endpointAdapter, ApplicationContainer container, String virtualServers) throws EndpointRegistrationException { List<String> virtualServerList; if (virtualServers == null) { virtualServerList = config.getHttpService().getNonAdminVirtualServerList(); } else{ virtualServerList = StringUtils.parseStringList(virtualServers, ","); } registerEndpoint(contextRoot, virtualServerList, endpointAdapter, container); }
private VirtualServer createAdminVirtualServer( final Transaction t, final Config config_w) throws TransactionFailure, PropertyVetoException { final HttpService hs_w = t.enroll(config_w.getHttpService()); final VirtualServer vs_w = hs_w.createChild(VirtualServer.class); hs_w.getVirtualServer().add(vs_w); vs_w.setId(ASADMIN_VS_NAME); vs_w.setNetworkListeners(ADMIN_LISTENER_NAME); return vs_w; }
public void postConstruct() { for (Config config : configs.getConfig()) { currentConfig = config; try { final NetworkConfig networkConfig = currentConfig.getNetworkConfig(); if (networkConfig == null) { createFromScratch(); } normalizeThreadPools(); if (currentConfig.getHttpService() != null) { promoteHttpServiceProperties( currentConfig.getHttpService()); promoteVirtualServerProperties( currentConfig.getHttpService()); } else { // this only happens during some unit tests logger.log(Level.WARNING, ConfigApiLoggerInfo.nullHttpService, new String[] { currentConfig.getName() }); } promoteSystemProperties(); addAsadminProtocol(currentConfig.getNetworkConfig()); } catch (TransactionFailure tf) { logger.log(Level.SEVERE, ConfigApiLoggerInfo.failUpgradeDomain, tf); throw new RuntimeException(tf); } } }
private VirtualServer createAdminVirtualServer( final Transaction t, final Config config_w) throws TransactionFailure, PropertyVetoException { final HttpService hs_w = t.enroll(config_w.getHttpService()); final VirtualServer vs_w = hs_w.createChild(VirtualServer.class); hs_w.getVirtualServer().add(vs_w); vs_w.setId(ASADMIN_VS_NAME); vs_w.setNetworkListeners(ADMIN_LISTENER_NAME); return vs_w; }
private void migrateHttpListeners(NetworkConfig config) throws TransactionFailure { for (final HttpListener listener : currentConfig.getHttpService().getHttpListener()) { final Protocol protocol = migrateToProtocols(config, listener); final NetworkListener networkListener = createNetworkListener(currentConfig, listener, protocol); if ("ws/tcp".equals(listener.getPropertyValue("proxiedProtocols"))) { createPortUnification(networkListener); ConfigSupport.apply(new SingleConfigCode<NetworkListener>() { @Override public Object run(NetworkListener param) { param.setProtocol("pu-" + networkListener.getName()); return null; } }, networkListener); } ConfigSupport.apply(new SingleConfigCode<HttpService>() { @Override public Object run(HttpService param) { param.getHttpListener().remove(param.getHttpListenerById(listener.getId())); return null; } }, currentConfig.getHttpService()); } }
public void postConstruct() { for (Config config : configs.getConfig()) { currentConfig = config; try { final NetworkConfig networkConfig = currentConfig.getNetworkConfig(); if (networkConfig == null) { createFromScratch(); } normalizeThreadPools(); if (currentConfig.getHttpService() != null) { processHttpListeners(); promoteHttpServiceProperties( currentConfig.getHttpService()); promoteVirtualServerProperties( currentConfig.getHttpService()); } else { // this only happens during some unit tests Logger.getAnonymousLogger().log(Level.WARNING, String.format( "config.getHttpService() null for config '%s'", currentConfig.getName())); } promoteSystemProperties(); addAsadminProtocol(currentConfig.getNetworkConfig()); } catch (TransactionFailure tf) { Logger.getAnonymousLogger().log(Level.SEVERE, "Failure while upgrading domain.xml.", tf); throw new RuntimeException(tf); } } }
/** * Scans the domain.xml to see if it specifies any configuration * that can be handled only by the web container, and if so, starts * the web container */ public void postConstruct() { domainProvider.get(); Config serverConfig = serverConfigProvider.get(); boolean isStartNeeded = false; if (serverConfig != null) { if (isStartNeeded(serverConfig.getHttpService())) { isStartNeeded = true; } if (!isStartNeeded && isStartNeeded(serverConfig.getNetworkConfig())) { isStartNeeded = true; } } if (isStartNeeded) { startWebContainer(); } else { ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(serverConfig.getHttpService()); bean.addListener(this); bean = (ObservableBean) ConfigSupport.getImpl(serverConfig.getNetworkConfig().getNetworkListeners()); bean.addListener(this); } }
private List<AddressInfo> getAddressInfoFromVirtualServers(Collection<String> virtualServers) { List<AddressInfo> addressInfos = new ArrayList<AddressInfo>(); List<NetworkListener> networkListenerList = config.getNetworkConfig().getNetworkListeners().getNetworkListener(); for (String vs : virtualServers) { VirtualServer virtualServer = config.getHttpService().getVirtualServerByName(vs); if (virtualServer == null) { // non-existent virtual server LOGGER.log(Level.WARNING, KernelLoggerInfo.grizzlyNonExistentVS, vs); continue; } String vsNetworkListeners = virtualServer.getNetworkListeners(); List<String> vsNetworkListenerList = StringUtils.parseStringList(vsNetworkListeners, ","); if (vsNetworkListenerList != null && !vsNetworkListenerList.isEmpty()) { for (String vsNetworkListener : vsNetworkListenerList) { for (NetworkListener networkListener : networkListenerList) { if (networkListener.getName().equals(vsNetworkListener) && Boolean.valueOf(networkListener.getEnabled())) { addressInfos.add(new AddressInfo(networkListener.getAddress(), networkListener.getPort())); break; } } } } } return addressInfos; }
HttpService httpService = serverConfig.getHttpService(); DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class); String vsIDs = params.virtualservers;
private void migrateSettings() throws TransactionFailure { final HttpService service = currentConfig.getHttpService(); NetworkConfig networkConfig = getNetworkConfig(); migrateHttpListeners(networkConfig); migrateHttpProtocol(networkConfig, service); migrateHttpFileCache(networkConfig, service); migrateRequestProcessing(networkConfig, service); migrateKeepAlive(networkConfig, service); migrateConnectionPool(networkConfig, service); }
ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(networkConfig.getNetworkListeners()); bean.addListener(configListener); bean = (ObservableBean) ConfigSupport.getImpl(config.getHttpService()); bean.addListener(configListener); transactions.addListenerForType(SystemProperty.class, configListener);
final NetworkConfig networkConfig = listener.getParent(NetworkListeners.class).getParent(NetworkConfig.class); for (VirtualServer vs : networkConfig.getParent(Config.class).getHttpService().getVirtualServer()) { List<String> vsListeners = StringUtils.parseStringList(vs.getNetworkListeners(), " ,");
serverConfig.getHttpService()); bean.addListener(configListener); HttpService httpService = serverConfig.getHttpService(); NetworkConfig networkConfig = serverConfig.getNetworkConfig(); if (networkConfig != null) {
httpService = config.getHttpService();
public static void addIndex(Config c, ServiceLocator habitat, String name) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(c, name, Config.class)); // directly referenced objects ConfigBeanProxy dirref[] = { c.getAdminService(), c.getAvailabilityService(), c.getDiagnosticService(), c.getHttpService(), c.getJavaConfig(), c.getLogService(), c.getNetworkConfig(), c.getSecurityService(), c.getThreadPools(), c.getMonitoringService(), }; for (ConfigBeanProxy cbp : dirref) { if (cbp != null) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(cbp, name, ConfigSupport.getImpl(cbp).getProxyType())); } } // containers for (Container extension : c.getContainers()) { ServiceLocatorUtilities.addOneDescriptor(habitat, BuilderHelper.createConstantDescriptor(extension, name, ConfigSupport.getImpl(extension).getProxyType())); } }
HttpService httpSvc = cfg.getHttpService(); if (httpSvc != null) { List<HttpListener> httpListeners = httpSvc.getHttpListener();