diff options
author | Hao Kuang <Hao.Kuang@amdocs.com> | 2017-08-18 16:07:56 +0000 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-08-18 20:16:17 +0000 |
commit | 7fec0d41c1fdfdb0eef04c6df8fb4b5368a975a5 (patch) | |
tree | e18d5951fc7888f68af1c2f059234ab6bbd7978a /appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src | |
parent | 5b7590935559fe9e286a703dc662a60b47b7ed1a (diff) |
Fix ExecutionQueue cannot be cleaned
Fix that LCM Requests in Execution Queue continue after Stop OAM
request sent.
Fix that Appc-Ansible bundle cannot be fully stopped because
of NPE.
Issue-Id: APPC-159
Change-Id: I8f0a3a79a5c572ad84e66f71b4ddb47118704302
Signed-off-by: Hao Kuang <Hao.Kuang@amdocs.com>
Diffstat (limited to 'appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src')
-rw-r--r-- | appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/openecomp/appc/adapter/ansible/AnsibleActivator.java | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/openecomp/appc/adapter/ansible/AnsibleActivator.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/openecomp/appc/adapter/ansible/AnsibleActivator.java index fa81ef7f9..865841db2 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/openecomp/appc/adapter/ansible/AnsibleActivator.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/openecomp/appc/adapter/ansible/AnsibleActivator.java @@ -38,9 +38,6 @@ import com.att.eelf.configuration.EELFManager; /** * This activator is used to initialize and terminate an instance of AnsibleAdapter class - * - * Author : Ashwin Sridharan - * Date : Oct 2016 */ public class AnsibleActivator implements BundleActivator { @@ -57,12 +54,12 @@ public class AnsibleActivator implements BundleActivator { /** * The logger to be used */ - private static final EELFLogger logger = EELFManager.getInstance().getLogger(AnsibleActivator.class); + private final EELFLogger logger = EELFManager.getInstance().getLogger(AnsibleActivator.class); /** * The configuration object used to configure this bundle */ - private Configuration configuration; + private final Configuration configuration = ConfigurationFactory.getConfiguration(); /** * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start @@ -70,26 +67,24 @@ public class AnsibleActivator implements BundleActivator { * <p> * This method must complete and return to its caller in a timely manner. * </p> - * - * @param context - * The execution context of the bundle being started. - * @throws java.lang.Exception - * If this method throws an exception, this bundle is marked as stopped and the Framework will remove - * this bundle's listeners, unregister all services registered by this bundle, and release all services - * used by this bundle. + * + * @param context The execution context of the bundle being started. + * @throws java.lang.Exception If this method throws an exception, this bundle is marked as stopped and the + * Framework will remove this bundle's listeners, unregister all services registered + * by this bundle, and release all services used by this bundle. * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */ @Override public void start(BundleContext context) throws Exception { logger.info("Starting bundle " + getName()); - String appName = "APPC: "; + String appName = "APPC: "; logger.info(Msg.COMPONENT_INITIALIZING, appName, "Ansible Adapter"); - adapter = new AnsibleAdapterImpl(); - + adapter = new AnsibleAdapterImpl(); + if (registration == null) { logger.info(Msg.REGISTERING_SERVICE, appName, adapter.getAdapterName(), - AnsibleAdapter.class.getSimpleName()); + AnsibleAdapter.class.getSimpleName()); registration = context.registerService(AnsibleAdapter.class, adapter, null); } @@ -104,13 +99,11 @@ public class AnsibleActivator implements BundleActivator { * <p> * This method must complete and return to its caller in a timely manner. * </p> - * - * @param context - * The execution context of the bundle being stopped. - * @throws java.lang.Exception - * If this method throws an exception, the bundle is still marked as stopped, and the Framework will - * remove the bundle's listeners, unregister all services registered by the bundle, and release all - * services used by the bundle. * + * + * @param context The execution context of the bundle being stopped. + * @throws java.lang.Exception If this method throws an exception, the bundle is still marked as stopped, and the + * Framework will remove the bundle's listeners, unregister all services registered + * by the bundle, and release all services used by the bundle. * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ @Override @@ -130,5 +123,4 @@ public class AnsibleActivator implements BundleActivator { public String getName() { return "APPC Ansible Adapter"; } - } |