@Override public synchronized void init(Server server) { ModClusterLogger.LOGGER.init(Version.INSTANCE.toString()); this.server = server; this.mcmpHandler.init(this.mcmpConfig.getProxyConfigurations(), this); this.autoEnableContexts = this.mcmpConfig.isAutoEnableContexts(); this.excludedContexts.clear(); this.excludedContexts.putAll(this.mcmpConfig.getExcludedContextsPerHost()); this.resetRequestSource.init(server, this); this.loadBalanceFactorProvider = this.loadBalanceFactorProviderFactory.createLoadBalanceFactorProvider(); Boolean advertise = this.mcmpConfig.getAdvertise(); if (Boolean.TRUE.equals(advertise) || (advertise == null && this.mcmpConfig.getProxyConfigurations().isEmpty())) { try { this.advertiseListener = this.listenerFactory.createListener(this.mcmpHandler, this.advertiseConfig); } catch (IOException e) { ModClusterLogger.LOGGER.advertiseStartFailed(e); } } }
Proxy(InetSocketAddress socketAddress, InetSocketAddress sourceAddress, MCMPHandlerConfiguration config) { this.socketAddress = socketAddress; this.sourceAddress = sourceAddress; this.socketFactory = config.getSocketFactory(); this.socketTimeout = config.getSocketTimeout(); }
Proxy(InetSocketAddress socketAddress, MCMPHandlerConfiguration config) { this.socketAddress = socketAddress; this.socketFactory = config.isSsl() ? new JSSESocketFactory(config) : SocketFactory.getDefault(); this.socketTimeout = config.getSocketTimeout(); }
@Override public void stop(Context context) { ModClusterLogger.LOGGER.stopContext(context.getHost(), context); if (this.established && this.include(context)) { this.disable(context); long start = System.currentTimeMillis(); long end = start + this.mcmpConfig.getStopContextTimeoutUnit().toMillis(this.mcmpConfig.getStopContextTimeout()); if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context)) { // If the session manager is not distributed // we need to drain the active sessions // before draining pending requests. this.drainSessions(context, start, end); } // Drain pending requests via iterative STOP-APP commands this.drainRequests(context, start, end); } }
List<InetSocketAddress> initialProxies = Utils.parseSocketAddresses(this.mcmpConfig.getProxyList(), DEFAULT_PORT); this.autoEnableContexts = this.mcmpConfig.isAutoEnableContexts(); this.excludedContexts.clear(); Map<String, Set<String>> excludedContextPaths = Utils.parseContexts(this.mcmpConfig.getExcludedContexts()); Boolean advertise = this.mcmpConfig.getAdvertise();
@Override public boolean stopContext(String host, String path, long timeout, TimeUnit unit) { if (!this.established) return false; Context context = this.findContext(this.findHost(host), path); this.disable(context); long start = System.currentTimeMillis(); boolean success = true; if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context)) { success = this.drainSessions(context, start, start + unit.toMillis(timeout)); } this.mcmpHandler.sendRequest(this.requestFactory.createStopRequest(context)); return success; }
protected void establishJvmRoute(Engine engine) { // Create default jvmRoute if none was specified if (engine.getJvmRoute() == null) { String jvmRoute = this.mcmpConfig.getJvmRouteFactory().createJvmRoute(engine); engine.setJvmRoute(jvmRoute); this.log.info(Strings.DETECT_JVMROUTE.getString(engine, jvmRoute)); } }
String proxyURL = this.config.getProxyURL();
/** * {@inhericDoc} * @see org.jboss.modcluster.ContainerEventHandler#stop(org.jboss.modcluster.Context) */ public void stop(Context context) { if (this.established && this.include(context)) { this.log.debug(Strings.CONTEXT_STOP.getString(context, context.getHost())); this.disable(context); long start = System.currentTimeMillis(); long end = start + this.mcmpConfig.getStopContextTimeoutUnit().toMillis(this.mcmpConfig.getStopContextTimeout()); if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context)) { // If the session manager is not distributed // we need to drain the active sessions // before draining pending requests. this.drainSessions(context, start, end); } // Drain pending requests via iterative STOP-APP commands this.drainRequests(context, start, end); } }
/** * {@inhericDoc} * * @see org.jboss.modcluster.ModClusterServiceMBean#stopContext(java.lang.String, java.lang.String, long, * java.util.concurrent.TimeUnit) */ @Override public boolean stopContext(String host, String path, long timeout, TimeUnit unit) { if (!this.established) return false; Context context = this.findContext(this.findHost(host), path); this.disable(context); long start = System.currentTimeMillis(); boolean success = true; if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context)) { success = this.drainSessions(context, start, start + unit.toMillis(timeout)); } this.mcmpHandler.sendRequest(this.requestFactory.createStopRequest(context)); return success; }
protected void establishJvmRoute(Engine engine) { // Create default jvmRoute if none was specified if (engine.getJvmRoute() == null) { String jvmRoute = this.mcmpConfig.getJvmRouteFactory().createJvmRoute(engine); engine.setJvmRoute(jvmRoute); ModClusterLogger.LOGGER.detectJvmRoute(engine, jvmRoute); } }
String proxyURL = this.config.getProxyURL();
/** * {@inhericDoc} * * @see org.jboss.modcluster.ContainerEventHandler#stop(org.jboss.modcluster.Context) */ @Override public void stop(Context context) { ModClusterLogger.LOGGER.stopContext(context.getHost(), context); if (this.established && this.include(context)) { this.disable(context); long start = System.currentTimeMillis(); long end = start + this.mcmpConfig.getStopContextTimeoutUnit().toMillis(this.mcmpConfig.getStopContextTimeout()); if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context)) { // If the session manager is not distributed // we need to drain the active sessions // before draining pending requests. this.drainSessions(context, start, end); } // Drain pending requests via iterative STOP-APP commands this.drainRequests(context, start, end); } }
/** * @{inheritDoc * @see org.jboss.modcluster.ContainerEventHandler#init(java.lang.Object) */ @Override public synchronized void init(Server server) { ModClusterLogger.LOGGER.init(Version.INSTANCE.toString()); this.server = server; this.mcmpHandler.init(this.mcmpConfig.getProxyConfigurations(), this); this.autoEnableContexts = this.mcmpConfig.isAutoEnableContexts(); this.excludedContexts.clear(); this.excludedContexts.putAll(this.mcmpConfig.getExcludedContextsPerHost()); this.resetRequestSource.init(server, this); this.loadBalanceFactorProvider = this.loadBalanceFactorProviderFactory.createLoadBalanceFactorProvider(); Boolean advertise = this.mcmpConfig.getAdvertise(); if (Boolean.TRUE.equals(advertise) || (advertise == null && this.mcmpConfig.getProxyConfigurations().isEmpty())) { try { this.advertiseListener = this.listenerFactory.createListener(this.mcmpHandler, this.advertiseConfig); this.advertiseListener.start(); } catch (IOException e) { ModClusterLogger.LOGGER.advertiseStartFailed(e); } } }
Proxy(InetSocketAddress socketAddress, InetSocketAddress sourceAddress, MCMPHandlerConfiguration config) { this.socketAddress = socketAddress; this.sourceAddress = sourceAddress; this.socketFactory = config.getSocketFactory(); this.socketTimeout = config.getSocketTimeout(); }
@Override public boolean stop(long timeout, TimeUnit unit) { if (!this.established) return false; // Send DISABLE-APP * requests for (Engine engine : this.server.getEngines()) { this.mcmpHandler.sendRequest(this.requestFactory.createDisableRequest(engine)); } long start = System.currentTimeMillis(); long end = start + unit.toMillis(timeout); boolean success = true; for (Engine engine : this.server.getEngines()) { for (Host host : engine.getHosts()) { for (Context context : host.getContexts()) { if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context) && !this.drainSessions(context, start, end)) { success = false; } } } } // Send STOP-APP * requests for (Engine engine : this.server.getEngines()) { this.mcmpHandler.sendRequest(this.requestFactory.createStopRequest(engine)); } return success; }
protected void establishJvmRoute(Engine engine) { // Create default jvmRoute if none was specified if (engine.getJvmRoute() == null) { String jvmRoute = this.mcmpConfig.getJvmRouteFactory().createJvmRoute(engine); engine.setJvmRoute(jvmRoute); ModClusterLogger.LOGGER.detectJvmRoute(engine, jvmRoute); } }
String proxyURL = this.config.getProxyURL();
for (Host host : engine.getHosts()) { for (Context context : host.getContexts()) { if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context) && !this.drainSessions(context, start, end)) { success = false;