* ============LICENSE_END=========================================================
*/
-package org.onap.appc.executor.conv;
+package org.onap.appc.workflow.activator;
-import java.io.IOException;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
-import org.onap.appc.executor.objects.Params;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+public class WorkflowManagerActivator implements BundleActivator{
+ private ScheduledExecutorService executor = null;
-public class Converter {
-
- public static Params convJsonStringToParams(String inObj) throws IOException {
- Params outObj = null;
- if(inObj != null) {
- outObj = new ObjectMapper().readValue(inObj, Params.class);
- }
- return outObj;
+ @Override
+ public void start(BundleContext bundleContext) {
+ executor = Executors.newSingleThreadScheduledExecutor();
+ TransactionAbortedMarker runnable = new TransactionAbortedMarker(executor);
+ executor.schedule(runnable, 30, TimeUnit.SECONDS);
}
- public static String convParamsToJsonString(Params inObj) throws JsonProcessingException {
- String outObj = null;
- if(inObj != null) {
- outObj = new ObjectMapper().writeValueAsString(inObj);
- }
- return outObj;
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ executor.shutdown();
}
}