@Override public void execute(String commandString, Session sess) throws IOException { sess.sendResponse("221 Bye"); sess.quit(); } }
/** */ @Override public void execute(String commandString, Session sess) throws IOException { sess.sendResponse("221 Bye"); sess.quit(); } }
/** */ @Override public void execute(String commandString, Session sess) throws IOException { sess.sendResponse("221 Bye"); sess.quit(); } }
private void shutdownSessions() { // Copy the sessionThreads collection so the guarding lock on this // instance can be released before calling the Session.shutdown methods. // This is necessary to avoid a deadlock, because the terminating // session threads call back the sessionEnded function in this instance, // which locks this instance. List<Session> sessionsToBeClosed; synchronized (this) { sessionsToBeClosed = new ArrayList<Session>(sessionThreads); } for (Session sessionThread : sessionsToBeClosed) { sessionThread.quit(); } server.getExecutorService().shutdown(); try { server.getExecutorService().awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { log.warn("Interrupted waiting for termination of session threads", e); Thread.currentThread().interrupt(); } }
@Override public void execute(String commandString, ConnectionContext context) throws IOException { context.sendResponse("221 Bye"); context.getSession().quit(); } }
private void shutdownSessions() { // Copy the sessionThreads collection so the guarding lock on this // instance can be released before calling the Session.shutdown methods. // This is necessary to avoid a deadlock, because the terminating // session threads call back the sessionEnded function in this instance, // which locks this instance. List<Session> sessionsToBeClosed; synchronized (this) { sessionsToBeClosed = new ArrayList<Session>(sessionThreads); } for (Session sessionThread : sessionsToBeClosed) { sessionThread.quit(); } server.getExecutorService().shutdown(); try { server.getExecutorService().awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { log.warn("Interrupted waiting for termination of session threads", e); Thread.currentThread().interrupt(); } }
private void shutdownSessions() { // Copy the sessionThreads collection so the guarding lock on this // instance can be released before calling the Session.shutdown methods. // This is necessary to avoid a deadlock, because the terminating // session threads call back the sessionEnded function in this instance, // which locks this instance. List<Session> sessionsToBeClosed; synchronized (this) { sessionsToBeClosed = new ArrayList<Session>(sessionThreads); } for (Session sessionThread : sessionsToBeClosed) { sessionThread.quit(); } server.getExecutorService().shutdown(); try { server.getExecutorService().awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { log.warn("Interrupted waiting for termination of session threads", e); Thread.currentThread().interrupt(); } }