private final String implementationRefId;
private ExtendedBlueprintContainer container;
- RoutedRpcMetadata(String id, String interfaceName, String implementationRefId) {
+ RoutedRpcMetadata(final String id, final String interfaceName, final String implementationRefId) {
this.id = id;
this.interfaceName = interfaceName;
this.implementationRefId = implementationRefId;
}
@Override
- public void init(ExtendedBlueprintContainer container) {
- this.container = container;
+ public void init(final ExtendedBlueprintContainer newContainer) {
+ this.container = newContainer;
LOG.debug("{}: In init", logName());
}
+ @SuppressWarnings("checkstyle:IllegalCatch")
@Override
public Object create() throws ComponentDefinitionException {
RpcProviderRegistry rpcRegistry = (RpcProviderRegistry) container.getComponentInstance(
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));
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));
}
implementation, rpcInterface);
return rpcRegistry.addRoutedRpcImplementation(rpcInterface, (RpcService)implementation);
- } catch(ComponentDefinitionException e) {
+ } catch (final ComponentDefinitionException e) {
throw e;
- } catch(Exception e) {
+ } catch (final Exception e) {
throw new ComponentDefinitionException(String.format(
"Error processing \"%s\" for %s", ROUTED_RPC_IMPLEMENTATION, implementation.getClass()), e);
}
}
@Override
- public void destroy(Object instance) {
+ public void destroy(final Object instance) {
LOG.debug("{}: In destroy: instance: {}", logName(), instance);
- (( RoutedRpcRegistration<?>)instance).close();
+ ((RoutedRpcRegistration<?>)instance).close();
}
private String logName() {
- return (container != null ? container.getBundleContext().getBundle().getSymbolicName() : "") +
- " (" + id + ")";
+ return (container != null ? container.getBundleContext().getBundle().getSymbolicName() : "") + " (" + id + ")";
}
}