aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle
diff options
context:
space:
mode:
authorJakub Dudycz <jakub.dudycz@nokia.com>2018-01-25 14:18:44 +0100
committerPatrick Brady <pb071s@att.com>2018-01-25 20:20:16 +0000
commit5665fb8e6245dfea75a4058a5e6236c7e56ac81c (patch)
treec7f5631dfc355b66c12d4d3fae3af555ce513642 /appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle
parentcd6063f90b296870599a67f6a78e2738dd678463 (diff)
ChefActivator fixes
Change-Id: Iddff91573fa5f7cc99171ca0b782415e77560154 Issue-ID: APPC-514 Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Diffstat (limited to 'appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle')
-rw-r--r--appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/ChefActivator.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/ChefActivator.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/ChefActivator.java
index fc3ab373e..963b78aae 100644
--- a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/ChefActivator.java
+++ b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/ChefActivator.java
@@ -55,6 +55,9 @@ import org.osgi.framework.ServiceRegistration;
*/
public class ChefActivator implements BundleActivator {
+ private static final String NAME = "APPC Chef Adapter";
+ private static final String CHEF_ADAPTER_STR = "CHEF adapter";
+
/**
* The bundle registration
*/
@@ -92,7 +95,7 @@ public class ChefActivator implements BundleActivator {
*/
@Override
public void start(BundleContext context) throws Exception {
- logger.info("Starting bundle " + getName());
+ logger.info("Starting bundle " + NAME);
configuration = ConfigurationFactory.getConfiguration();
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
@@ -104,7 +107,7 @@ public class ChefActivator implements BundleActivator {
registration = context.registerService(ChefAdapter.class, adapter, null);
}
- logger.info(Msg.COMPONENT_INITIALIZED, appName, "CHEF adapter");
+ logger.info(Msg.COMPONENT_INITIALIZED, appName, CHEF_ADAPTER_STR);
}
/**
@@ -126,20 +129,16 @@ public class ChefActivator implements BundleActivator {
*/
@Override
public void stop(BundleContext context) throws Exception {
- logger.info("Stopping bundle " + getName());
+ logger.info("Stopping bundle " + NAME);
if (registration != null) {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
- logger.info(Msg.COMPONENT_TERMINATING, appName, "CHEF adapter");
+ logger.info(Msg.COMPONENT_TERMINATING, appName, CHEF_ADAPTER_STR);
logger.info(Msg.UNREGISTERING_SERVICE, appName, adapter.getAdapterName());
registration.unregister();
registration = null;
- logger.info(Msg.COMPONENT_TERMINATED, appName, "CHEF adapter");
+ logger.info(Msg.COMPONENT_TERMINATED, appName, CHEF_ADAPTER_STR);
}
}
- public String getName() {
- return "APPC Chef Adapter";
- }
-
}