diff options
Diffstat (limited to 'sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java')
-rw-r--r-- | sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java index 12e85db..b51cf9f 100644 --- a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java +++ b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ReleaseNodeExecutor.java @@ -53,15 +53,7 @@ public class ReleaseNodeExecutor extends SvcLogicNodeExecutor { + plugin); } - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - - ServiceReference sref = bctx.getServiceReference(plugin); - - if (sref != null) { - SvcLogicResource resourcePlugin = (SvcLogicResource) bctx - .getService(sref); - + SvcLogicResource resourcePlugin = getSvcLogicResource(plugin); if (resourcePlugin != null) { try { @@ -85,10 +77,6 @@ public class ReleaseNodeExecutor extends SvcLogicNodeExecutor { LOG.warn("Could not find SvcLogicResource object for plugin " + plugin); } - } else { - LOG.warn("Could not find service reference object for plugin " - + plugin); - } SvcLogicNode nextNode = node.getOutcomeValue(outValue); if (nextNode != null) { @@ -112,5 +100,21 @@ public class ReleaseNodeExecutor extends SvcLogicNodeExecutor { return (nextNode); } + protected SvcLogicResource getSvcLogicResource(String plugin) { + BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) + .getBundleContext(); + + ServiceReference sref = bctx.getServiceReference(plugin); + if (sref != null) { + SvcLogicResource resourcePlugin = (SvcLogicResource) bctx + .getService(sref); + return resourcePlugin; + } + else { + LOG.warn("Could not find service reference object for plugin " + plugin); + return null; + } + } + } |