// -------------------------------------------------------------------
// handle the body of this operation below here
// -------------------------------------------------------------------
IoAcceptor acceptor = ( IoAcceptor ) requestor.getIoSession().getService();
List<IoSession> sessions = new ArrayList<IoSession>(
acceptor.getManagedSessions().values() );
// build the graceful disconnect message with replicationContexts
GracefulDisconnectResponse notice = getGracefulDisconnect( req.getTimeOffline(), req.getDelay() );
// send (synch) the GracefulDisconnect to each client before unbinding
sendGracefulDisconnect( sessions, notice, requestor.getIoSession() );
// wait for the specified delay before we unbind the service
waitForDelay( req.getDelay() );
// -------------------------------------------------------------------
// unbind the server socket for the LDAP service here so no new
// connections are accepted while we process this shutdown request
// note that the following must be issued before binding the ldap
// service in order to prevent client disconnects on service unbind:
//
// minaRegistry.getAcceptor( service.getTransportType() )
// .setDisconnectClientsOnUnbind( false );
// -------------------------------------------------------------------
// This might not work, either.
acceptor.unbind( requestor.getIoSession().getServiceAddress() );
// -------------------------------------------------------------------
// synchronously send a NoD to clients that are not aware of this resp
// after sending the NoD the client is disconnected if still connected
// -------------------------------------------------------------------