diff options
Diffstat (limited to 'sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java')
-rw-r--r-- | sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java index ac1144c..e7a6621 100644 --- a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java +++ b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/UpdateNodeExecutor.java @@ -87,14 +87,9 @@ public class UpdateNodeExecutor extends SvcLogicNodeExecutor { + plugin); } - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - ServiceReference sref = bctx.getServiceReference(plugin); + SvcLogicResource resourcePlugin = getSvcLogicResource(plugin); - if (sref != null) { - SvcLogicResource resourcePlugin = (SvcLogicResource) bctx - .getService(sref); if (resourcePlugin != null) { @@ -119,10 +114,6 @@ public class UpdateNodeExecutor 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) { @@ -145,4 +136,19 @@ public class UpdateNodeExecutor 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; + } + } } |