@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; }
/** * {@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; }
@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); } }
/** * {@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); } }
@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; }
for (Host host : engine.getHosts()) { for (Context context : host.getContexts()) { if (this.mcmpConfig.getSessionDrainingStrategy().isEnabled(context) && !this.drainSessions(context, start, end)) { success = false;