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/> |
[email protected]<mailto:[email protected]>
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