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=23240cf1550e7fb0067ec9657234020d601315fd;hb=a77e3d6e9180c1722a9d18f7717034bb0650a130;hp=8f0eb8aa03ec7f0a5ce8b6c9b0a9ff7d3b3e13d1;hpb=12414fe43077e12d7ef711951b1633ad31d73573;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 8f0eb8aa..23240cf1 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 @@ -19,17 +19,20 @@ * */ package org.onap.aaf.auth.server; +import java.io.File; import java.io.IOException; +import java.net.Inet4Address; +import java.net.UnknownHostException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; import org.onap.aaf.auth.org.OrganizationException; import org.onap.aaf.auth.org.OrganizationFactory; import org.onap.aaf.auth.rserv.RServlet; import org.onap.aaf.cadi.Access; import org.onap.aaf.cadi.Access.Level; +import org.onap.aaf.cadi.config.Config; import org.onap.aaf.cadi.register.Registrant; import org.onap.aaf.cadi.register.Registrar; import org.onap.aaf.misc.env.Trans; @@ -39,6 +42,7 @@ public abstract class AbsServiceStarter registrar; private boolean do_register; protected AbsService service; + protected String hostname; public AbsServiceStarter(final AbsService service) { @@ -46,17 +50,26 @@ public abstract class AbsServiceStarter rserv) throws Exception; - public abstract void _propertyAdjustment(); + + protected abstract void _start(RServlet rserv) throws Exception; + protected abstract void _propertyAdjustment(); public ENV env() { return service.env; @@ -71,6 +84,8 @@ public abstract class AbsServiceStarter 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 public void run() { @@ -82,17 +97,15 @@ public abstract class AbsServiceStarter to end:"); + System.out.print(" Hit to end\n:"); try { System.in.read(); System.exit(0); } catch (IOException e) { } } - } - @SafeVarargs public final synchronized void register(final Registrant ... registrants) { if (do_register) { @@ -121,7 +134,28 @@ public abstract class AbsServiceStarter