diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-04-07 21:13:53 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2017-04-19 01:20:20 +0000 |
commit | 443143f685a4a45cce32bb468c279d9a700dff6f (patch) | |
tree | d4f31bebda4244cc1a176769fb05be33afbc5cf1 /appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main | |
parent | a8d6915645c780c9e0eef189fb72d45635b581a0 (diff) |
Parameterize raw generic type CommandTask<M>
Change-Id: I935d39537b83d1daaa63cee86d6fb83c49a5011f
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main')
2 files changed, 5 insertions, 4 deletions
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java index 60a951722..e351cfe12 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java @@ -118,7 +118,7 @@ public class CommandExecutorImpl implements CommandExecutor { logger.trace("Entering to enqueRequest with CommandRequest = "+ ObjectUtils.toString(request)); } try { - CommandTask commandTask = getMessageExecutor(request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getAction().name()); + CommandTask<? extends CommandRequest> commandTask = getMessageExecutor(request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getAction().name()); commandTask.setCommandRequest(request); long remainingTTL = getRemainingTTL(request); executionQueueService.putMessage(commandTask,remainingTTL, TimeUnit.MILLISECONDS); @@ -138,11 +138,11 @@ public class CommandExecutorImpl implements CommandExecutor { return ttl*1000 + requestTimestamp.getTime() - System.currentTimeMillis(); } - private CommandTask getMessageExecutor(String action){ + private CommandTask<? extends CommandRequest> getMessageExecutor(String action){ if (logger.isTraceEnabled()) { logger.trace("Entering to getMessageExecutor with command = "+ action); } - CommandTask executionTask = executionTaskFactory.getExecutionTask(action); + CommandTask<? extends CommandRequest> executionTask = executionTaskFactory.getExecutionTask(action); if (logger.isTraceEnabled()) { logger.trace("Exiting from getMessageExecutor"); } diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java index 610f0bca3..d01722062 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java @@ -23,6 +23,7 @@ package org.openecomp.appc.executor.impl; import org.openecomp.appc.domainmodel.lcm.VNFOperation; +import org.openecomp.appc.executor.impl.objects.CommandRequest; import org.openecomp.appc.lifecyclemanager.LifecycleManager; import org.openecomp.appc.requesthandler.RequestHandler; import org.openecomp.appc.workflow.WorkFlowManager; @@ -53,7 +54,7 @@ public class CommandTaskFactory { } - public synchronized CommandTask getExecutionTask(String action){ + public synchronized CommandTask<? extends CommandRequest> getExecutionTask(String action){ if (VNFOperation.Sync.toString().equals(action) || VNFOperation.Audit.toString().equals(action)){ return new LCMReadonlyCommandTask(requestHandler,workflowManager); }else { |