X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fblueprint%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fblueprint%2Fext%2FRoutedRpcMetadata.java;h=04e6d30620e451c738033782bbdc41b556df395c;hb=67ff0fc78b2933b8b4f5a8544c7639499824e622;hp=7bf559ea4cca3bf7a169db89725a24c8872203c0;hpb=762f30c90106b79a775478f0485e0db76ea361ff;p=controller.git diff --git a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcMetadata.java b/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcMetadata.java index 7bf559ea4c..04e6d30620 100644 --- a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcMetadata.java +++ b/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RoutedRpcMetadata.java @@ -56,12 +56,13 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata { } @Override - public void init(ExtendedBlueprintContainer container) { - this.container = container; + public void init(ExtendedBlueprintContainer newContainer) { + this.container = newContainer; LOG.debug("{}: In init", logName()); } + @SuppressWarnings("checkstyle:IllegalCatch") @Override public Object create() throws ComponentDefinitionException { RpcProviderRegistry rpcRegistry = (RpcProviderRegistry) container.getComponentInstance( @@ -70,7 +71,7 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata { Object implementation = container.getComponentInstance(implementationRefId); try { - if(!RpcService.class.isAssignableFrom(implementation.getClass())) { + if (!RpcService.class.isAssignableFrom(implementation.getClass())) { throw new ComponentDefinitionException(String.format( "Implementation \"ref\" instance %s for \"%s\" is not an RpcService", implementation.getClass(), ROUTED_RPC_IMPLEMENTATION)); @@ -80,10 +81,10 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata { interfaceName, implementation.getClass(), container.getBundleContext().getBundle(), ROUTED_RPC_IMPLEMENTATION); - if(rpcInterfaces.size() > 1) { + if (rpcInterfaces.size() > 1) { throw new ComponentDefinitionException(String.format( - "Implementation \"ref\" instance %s for \"%s\" implements more than one RpcService " + - "interface (%s). Please specify the exact \"interface\"", implementation.getClass(), + "Implementation \"ref\" instance %s for \"%s\" implements more than one RpcService " + + "interface (%s). Please specify the exact \"interface\"", implementation.getClass(), ROUTED_RPC_IMPLEMENTATION, rpcInterfaces)); } @@ -93,9 +94,9 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata { implementation, rpcInterface); return rpcRegistry.addRoutedRpcImplementation(rpcInterface, (RpcService)implementation); - } catch(ComponentDefinitionException e) { + } catch (ComponentDefinitionException e) { throw e; - } catch(Exception e) { + } catch (Exception e) { throw new ComponentDefinitionException(String.format( "Error processing \"%s\" for %s", ROUTED_RPC_IMPLEMENTATION, implementation.getClass()), e); } @@ -109,7 +110,6 @@ class RoutedRpcMetadata implements ComponentFactoryMetadata { } private String logName() { - return (container != null ? container.getBundleContext().getBundle().getSymbolicName() : "") + - " (" + id + ")"; + return (container != null ? container.getBundleContext().getBundle().getSymbolicName() : "") + " (" + id + ")"; } }