X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=misc%2Fenv%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fmisc%2Fenv%2FLifeCycle.java;h=75f3b70178a967c896a4941987b58f4ea3ce45d0;hb=4b5a7d721d994a49057e9bfb403c7bff1b376660;hp=5124f6b57a864f740b2e9a8df5234ee3c8a5af75;hpb=824dc7b5fc0e1ccdf7f460479aff344727f0f01e;p=aaf%2Fauthz.git diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/LifeCycle.java b/misc/env/src/main/java/org/onap/aaf/misc/env/LifeCycle.java index 5124f6b5..75f3b701 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/LifeCycle.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/LifeCycle.java @@ -43,81 +43,81 @@ import org.onap.aaf.misc.env.util.RefreshableThreadObject; * */ public interface LifeCycle { - /** - * The Service using LifeCycle Elements is required to call this method at - * the appropriate startup time. This is better for services than a simple - * static call, because the exact moment of starting can be determined - * programatically. - *

- * - * An excellent use is to establish security credentials with a backend - * after appropriate configurations have been read and available as part of - * the {@link Env} Object. - * - * @param env - * @throws APIException - */ - public abstract void servicePrestart(Env env) throws APIException; + /** + * The Service using LifeCycle Elements is required to call this method at + * the appropriate startup time. This is better for services than a simple + * static call, because the exact moment of starting can be determined + * programatically. + *

+ * + * An excellent use is to establish security credentials with a backend + * after appropriate configurations have been read and available as part of + * the {@link Env} Object. + * + * @param env + * @throws APIException + */ + public abstract void servicePrestart(Env env) throws APIException; - /** - * Many cases of implementations are not thread safe, and mechanisms must be - * derived to accomodate them by holding per Thread. - *

- * - * {@link ThreadLocal} is a valuable resource, but start up times within the - * thread, depending on what it is, can be substantial. - *

- * - * Use ThreadPrestart to do all that is possible before actually performing - * work, i.e. inside of a client transaction. - * - * @param env - * @throws APIException - */ - public abstract void threadPrestart(Env env) throws APIException; + /** + * Many cases of implementations are not thread safe, and mechanisms must be + * derived to accomodate them by holding per Thread. + *

+ * + * {@link ThreadLocal} is a valuable resource, but start up times within the + * thread, depending on what it is, can be substantial. + *

+ * + * Use ThreadPrestart to do all that is possible before actually performing + * work, i.e. inside of a client transaction. + * + * @param env + * @throws APIException + */ + public abstract void threadPrestart(Env env) throws APIException; - /** - * The Service will call this when (service-defined) configurations change. - *

- * - * This mechanism allows the Service to recognize events, such as file - * changes, and pass on the event to all LifeCycle implementors. - *

- * - * The code should take the opportunity to evaluate configuration and change - * as necessary. - *

- * - *

IMPORTANT:

- * The LifeCycle implementor cannot guarantee it will not be in the middle - * of a transaction, so it would behoove the implementor to construct - * content that does not affect anything until finished, then apply to an - * appropriate atomic action (i.e. setting an Object to a field), or even - * synchronizing. - * - * If you are using Java's "ThreadLocal", consider - * {@link RefreshableThreadObject}, because it implements LifeCycle, and - * responds to the refresh command. - * - * @param env - * @throws APIException - */ - public abstract void refresh(Env env) throws APIException; + /** + * The Service will call this when (service-defined) configurations change. + *

+ * + * This mechanism allows the Service to recognize events, such as file + * changes, and pass on the event to all LifeCycle implementors. + *

+ * + * The code should take the opportunity to evaluate configuration and change + * as necessary. + *

+ * + *

IMPORTANT:

+ * The LifeCycle implementor cannot guarantee it will not be in the middle + * of a transaction, so it would behoove the implementor to construct + * content that does not affect anything until finished, then apply to an + * appropriate atomic action (i.e. setting an Object to a field), or even + * synchronizing. + * + * If you are using Java's "ThreadLocal", consider + * {@link RefreshableThreadObject}, because it implements LifeCycle, and + * responds to the refresh command. + * + * @param env + * @throws APIException + */ + public abstract void refresh(Env env) throws APIException; - /** - * Parallel to threadPrestart, threadDestroy tells the implementor that the - * service is ending this particular thread, and to take this opportunity to - * close out any content specific to this thread that can be closed. - * - * @param env - * @throws APIException - */ - public abstract void threadDestroy(Env env) throws APIException; + /** + * Parallel to threadPrestart, threadDestroy tells the implementor that the + * service is ending this particular thread, and to take this opportunity to + * close out any content specific to this thread that can be closed. + * + * @param env + * @throws APIException + */ + public abstract void threadDestroy(Env env) throws APIException; - /** - * Parallel to servicePrestart, serviceDestroy tells the implementor that - * the service is ending, and to take this opportunity to close out any - * content under it's control that can or should be closed explicitly. - */ - public abstract void serviceDestroy(Env env) throws APIException; + /** + * Parallel to servicePrestart, serviceDestroy tells the implementor that + * the service is ending, and to take this opportunity to close out any + * content under it's control that can or should be closed explicitly. + */ + public abstract void serviceDestroy(Env env) throws APIException; }