X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sli%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fsdnc%2Fsli%2Fprovider%2FExistsNodeExecutor.java;fp=sli%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fsdnc%2Fsli%2Fprovider%2FExistsNodeExecutor.java;h=464c6761bd29e01adb763bc7e75ac9e40e6cd754;hb=974b67dd4021e6e839eaad25366bffe6d7a414c8;hp=48b511e7dff9012fb4e066af0fa6a8275a9aba8c;hpb=e0451f75b26082418757f279351c2d3e29c0a5c8;p=sdnc%2Fcore.git diff --git a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ExistsNodeExecutor.java b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ExistsNodeExecutor.java index 48b511e..464c676 100644 --- a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ExistsNodeExecutor.java +++ b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/ExistsNodeExecutor.java @@ -55,14 +55,9 @@ public class ExistsNodeExecutor 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) { @@ -87,10 +82,6 @@ public class ExistsNodeExecutor 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) { @@ -114,5 +105,21 @@ public class ExistsNodeExecutor 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; + } + } + }