X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fserver%2FAbsServiceStarter.java;h=90f4158fe1088247a8299aa8e0f6385d30dfca97;hb=3d1706fcbe7f95830ff6fd23cf679ee55c6d0595;hp=11ba6562bb12d367dbbad12e921c0b11fff136b4;hpb=feab2592f964ff68e04812aeafc807b4ce71048c;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java index 11ba6562..90f4158f 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java @@ -42,18 +42,18 @@ public abstract class AbsServiceStarter registrar; private boolean do_register; protected AbsService service; - protected String hostname; - protected final boolean secure; + protected String hostname; + protected final boolean secure; public AbsServiceStarter(final AbsService service, boolean secure) { - this.secure = secure; + this.secure = secure; this.service = service; try { OrganizationFactory.init(service.env); } catch (OrganizationException e) { service.access.log(e, "Missing defined Organization Plugins"); - System.exit(3); + System.exit(3); } // do_register - this is used for specialty Debug Situations. Developer can create an Instance for a remote system // for Debugging purposes without fear that real clients will start to call your debug instance @@ -61,10 +61,10 @@ public abstract class AbsServiceStarter app = es.submit(this); + ExecutorService es = Executors.newSingleThreadExecutor(); + Future app = es.submit(this); final AbsServiceStarter absSS = this; // Docker/K8 may separately create startup Status in this dir for startup // sequencing. If so, delete ON EXIT - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override public void run() { - absSS.access().printf(Level.INIT, "Shutting down %s:%s\n",absSS.service.app_name, absSS.service.app_version); - absSS.shutdown(); - app.cancel(true); - } - }); - if(System.getProperty("ECLIPSE", null)!=null) { - Thread.sleep(2000); - if(!app.isCancelled()) { - System.out.println("Service Started in Eclipse: "); - System.out.print(" Hit to end:\n"); - try { - System.in.read(); - System.exit(0); - } catch (IOException e) { - } - } - } + absSS.access().printf(Level.INIT, "Shutting down %s:%s\n",absSS.service.app_name, absSS.service.app_version); + absSS.shutdown(); + app.cancel(true); + } + }); + if(System.getProperty("ECLIPSE", null)!=null) { + Thread.sleep(2000); + if(!app.isCancelled()) { + System.out.println("Service Started in Eclipse: "); + System.out.print(" Hit to end:\n"); + try { + System.in.read(); + System.exit(0); + } catch (IOException e) { + } + } + } } @SafeVarargs @@ -123,16 +123,16 @@ public abstract class AbsServiceStarter