directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Carlo.Acco...@ibs-ag.com>
Subject Graceful shutdown sequence
Date Fri, 08 Nov 2013 21:28:19 GMT
Sometimes stopping the server brutally in eclipse causes partition corruption.
I dug through archived messages on this topic but could not find a code example.
I'm trying to shutdown gracefully so that the entire system exits, stopping all the threads.
This code below seems to shut down the incoming connections but it doesn't shut down all threads.
Any hints this?  Thanks!

                LdapConnection  ldapConnection = ... //admin connection
                GracefulShutdownRequest req = new GracefulShutdownRequestImpl();
                req.setDelay(0);
                req.setTimeOffline(0);

                ExtendedResponse res = ldapConnection.extended(req);
                ResultCodeEnum resultCode = res.getLdapResult().getResultCode();
                switch (resultCode)
                {
                                case SUCCESS :
                                                LOG.info("Server shutting down");
                                                break;
                                default :
                                                LOG.error ("Server shutdown failed : {} ",
resultCode.toString());
                }



Carlo Accorsi

IBS America
A Siemens Business

24 Hartwell Ave | Lexington | Massachusetts | 02421
+1-781-862-9002 x129 (Office) | +1-781-676-8129 (Direct) | +1-781-862-9003 (Fax)
www.ibs-us.com<http://www.ibs-us.com/> | carlo.accorsi@ibs-ag.com<mailto:carlo.accorsi@ibs-ag.com>

Connect With Us:
Twitter<https://twitter.com/IBSAmerica> | Facebook<https://www.facebook.com/pages/IBS-America-Inc/126278080785762>
| LinkedIn<http://www.linkedin.com/company/2118605?trk=tyah> | Blog<http://info.ibs-us.com/>
| Our Events<http://www.ibs-us.com/de/company/events/index.html>

The Quality Management System of: IBS America, Inc.
has been assessed and approved by National Quality Assurance, U.S.A.,
against the provisions of:
ISO 9001: 2008


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message