* Implemented from BundleActivator.
*/
@Override
- public void start(BundleContext context) {
+ public void start(final BundleContext context) {
LOG.info("Starting {}", getClass().getSimpleName());
restartService = new BlueprintContainerRestartServiceImpl();
new ServiceTrackerCustomizer<BlueprintExtenderService, BlueprintExtenderService>() {
@Override
public BlueprintExtenderService addingService(
- ServiceReference<BlueprintExtenderService> reference) {
+ final ServiceReference<BlueprintExtenderService> reference) {
blueprintExtenderService = reference.getBundle().getBundleContext().getService(reference);
bundleTracker.open();
}
@Override
- public void modifiedService(ServiceReference<BlueprintExtenderService> reference,
- BlueprintExtenderService service) {
+ public void modifiedService(final ServiceReference<BlueprintExtenderService> reference,
+ final BlueprintExtenderService service) {
}
@Override
- public void removedService(ServiceReference<BlueprintExtenderService> reference,
- BlueprintExtenderService service) {
+ public void removedService(final ServiceReference<BlueprintExtenderService> reference,
+ final BlueprintExtenderService service) {
}
});
blueprintExtenderServiceTracker.open();
new ServiceTrackerCustomizer<QuiesceParticipant, QuiesceParticipant>() {
@Override
public QuiesceParticipant addingService(
- ServiceReference<QuiesceParticipant> reference) {
+ final ServiceReference<QuiesceParticipant> reference) {
quiesceParticipant = reference.getBundle().getBundleContext().getService(reference);
LOG.debug("Got QuiesceParticipant");
}
@Override
- public void modifiedService(ServiceReference<QuiesceParticipant> reference,
- QuiesceParticipant service) {
+ public void modifiedService(final ServiceReference<QuiesceParticipant> reference,
+ final QuiesceParticipant service) {
}
@Override
- public void removedService(ServiceReference<QuiesceParticipant> reference,
- QuiesceParticipant service) {
+ public void removedService(final ServiceReference<QuiesceParticipant> reference,
+ final QuiesceParticipant service) {
}
});
quiesceParticipantTracker.open();
}
- private void registerNamespaceHandler(BundleContext context) {
+ private void registerNamespaceHandler(final BundleContext context) {
Dictionary<String, Object> props = new Hashtable<>();
props.put("osgi.service.blueprint.namespace", OpendaylightNamespaceHandler.NAMESPACE_1_0_0);
namespaceReg = context.registerService(NamespaceHandler.class.getName(),
new OpendaylightNamespaceHandler(), props);
}
- private void registerBlueprintEventHandler(BundleContext context) {
+ private void registerBlueprintEventHandler(final BundleContext context) {
Dictionary<String, Object> props = new Hashtable<>();
props.put(org.osgi.service.event.EventConstants.EVENT_TOPIC,
new String[]{EventConstants.TOPIC_CREATED, EventConstants.TOPIC_FAILURE});
* Implemented from BundleActivator.
*/
@Override
- public void stop(BundleContext context) {
+ public void stop(final BundleContext context) {
bundleTracker.close();
blueprintExtenderServiceTracker.close();
quiesceParticipantTracker.close();
* Implemented from SynchronousBundleListener.
*/
@Override
- public void bundleChanged(BundleEvent event) {
+ public void bundleChanged(final BundleEvent event) {
// If the system bundle (id 0) is stopping, do an orderly shutdown of all blueprint containers. On
// shutdown the system bundle is stopped first.
if (event.getBundle().getBundleId() == SYSTEM_BUNDLE_ID && event.getType() == BundleEvent.STOPPING) {
* Implemented from BundleActivator.
*/
@Override
- public Bundle addingBundle(Bundle bundle, BundleEvent event) {
+ public Bundle addingBundle(final Bundle bundle, final BundleEvent event) {
modifiedBundle(bundle, event, bundle);
return bundle;
}
* Implemented from BundleTrackerCustomizer.
*/
@Override
- public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+ public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
if (shuttingDown) {
return;
}
* Implemented from BundleTrackerCustomizer.
*/
@Override
- public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+ public void removedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
// BlueprintExtenderService will handle this.
}
* @param event the event to handle
*/
@Override
- public void handleEvent(Event event) {
+ public void handleEvent(final Event event) {
if (EventConstants.TOPIC_CREATED.equals(event.getTopic())) {
LOG.info("Blueprint container for bundle {} was successfully created",
event.getProperty(EventConstants.BUNDLE));
}
@SuppressWarnings({ "rawtypes", "unchecked" })
- static List<Object> findBlueprintPaths(Bundle bundle) {
+ static List<Object> findBlueprintPaths(final Bundle bundle) {
Enumeration<?> rntries = bundle.findEntries(BLUEPRINT_FILE_PATH, BLUEPRINT_FLE_PATTERN, false);
if (rntries == null) {
return Collections.emptyList();
LOG.info("Shutdown of blueprint containers complete");
}
- private List<Bundle> getBundlesToDestroy(Collection<Bundle> containerBundles) {
+ private List<Bundle> getBundlesToDestroy(final Collection<Bundle> containerBundles) {
List<Bundle> bundlesToDestroy = new ArrayList<>();
// Find all container bundles that either have no registered services or whose services are no
return bundlesToDestroy;
}
- private static int getServiceUsage(ServiceReference<?> ref) {
+ private static int getServiceUsage(final ServiceReference<?> ref) {
Bundle[] usingBundles = ref.getUsingBundles();
return usingBundles != null ? usingBundles.length : 0;
}
- private <T> T getOSGiService(Class<T> serviceInterface) {
+ private <T> T getOSGiService(final Class<T> serviceInterface) {
try {
ServiceReference<T> serviceReference = bundleContext.getServiceReference(serviceInterface);
if (serviceReference == null) {
}
return service;
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
// This is thrown if the BundleContext is no longer valid which is possible on shutdown so we
// log as debug.
LOG.debug("Error obtaining OSGi service {}", serviceInterface.getSimpleName(), e);
restartExecutor.execute(() -> restartContainerAndDependentsInternal(bundle));
}
- private void restartContainerAndDependentsInternal(Bundle forBundle) {
+ private void restartContainerAndDependentsInternal(final Bundle forBundle) {
Preconditions.checkNotNull(blueprintExtenderService);
Preconditions.checkNotNull(quiesceParticipant);
containerBundles, containerBundles.size() - containerCreationComplete.getCount());
return;
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
LOG.debug("CountDownLatch await was interrupted - returning");
return;
}
}, Collections.singletonList(nextBundle));
}
- private void createContainers(List<Bundle> containerBundles) {
+ private void createContainers(final List<Bundle> containerBundles) {
containerBundles.forEach(bundle -> {
List<Object> paths = BlueprintBundleTracker.findBlueprintPaths(bundle);
});
}
- private void restartConfigModules(BundleContext bundleContext, List<Entry<String,
+ private void restartConfigModules(final BundleContext bundleContext, final List<Entry<String,
ModuleIdentifier>> configModules) {
if (configModules.isEmpty()) {
return;
}
- private void restartConfigModules(List<Entry<String, ModuleIdentifier>> configModules,
- ConfigSubsystemFacade configFacade) throws ParserConfigurationException, DocumentedException,
+ private void restartConfigModules(final List<Entry<String, ModuleIdentifier>> configModules,
+ final ConfigSubsystemFacade configFacade) throws ParserConfigurationException, DocumentedException,
ValidationException, ConflictingVersionException {
Document document = XmlUtil.newDocument();
Element moduleElement = configMapping.moduleToXml(moduleNamespace, moduleId.getFactoryName(),
moduleId.getInstanceName(), instanceON, document);
modulesElement.appendChild(moduleElement);
- } catch (InstanceNotFoundException e) {
+ } catch (final InstanceNotFoundException e) {
LOG.warn("Error looking up config module: namespace {}, module name {}, instance {}",
moduleNamespace, moduleId.getFactoryName(), moduleId.getInstanceName(), e);
}
* @param containerBundles the current set of bundles containing blueprint containers
* @param configModules the current set of bundles containing config modules
*/
- private void findDependentContainersRecursively(Bundle bundle, Set<Bundle> containerBundles,
- List<Entry<String, ModuleIdentifier>> configModules) {
+ private void findDependentContainersRecursively(final Bundle bundle, final Set<Bundle> containerBundles,
+ final List<Entry<String, ModuleIdentifier>> configModules) {
if (!containerBundles.add(bundle)) {
// Already seen this bundle...
return;
}
}
- private void possiblyAddConfigModuleIdentifier(ServiceReference<?> reference,
- List<Entry<String, ModuleIdentifier>> configModules) {
+ private void possiblyAddConfigModuleIdentifier(final ServiceReference<?> reference,
+ final List<Entry<String, ModuleIdentifier>> configModules) {
Object moduleNamespace = reference.getProperty(CONFIG_MODULE_NAMESPACE_PROP);
if (moduleNamespace == null) {
return;
}
@Nullable
- private String getRequiredConfigModuleProperty(String propName, Object moduleNamespace,
- ServiceReference<?> reference) {
+ private String getRequiredConfigModuleProperty(final String propName, final Object moduleNamespace,
+ final ServiceReference<?> reference) {
Object value = reference.getProperty(propName);
if (value == null) {
LOG.warn(
return value.toString();
}
- private ServiceRegistration<?> registerEventHandler(BundleContext bundleContext, EventHandler handler) {
+ private ServiceRegistration<?> registerEventHandler(final BundleContext bundleContext, final EventHandler handler) {
Dictionary<String, Object> props = new Hashtable<>();
props.put(org.osgi.service.event.EventConstants.EVENT_TOPIC,
new String[]{EventConstants.TOPIC_CREATED, EventConstants.TOPIC_FAILURE});
}
return service;
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
// This is thrown if the BundleContext is no longer valid which is possible on shutdown so we
// log as debug.
log.debug("{}: Error obtaining {}", logName(), serviceInterface.getSimpleName(), e);
final Class<?> interfaceClass;
try {
interfaceClass = container().getBundleContext().getBundle().loadClass(interfaceName);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new ComponentDefinitionException(String.format("%s: Error obtaining interface class %s",
logName(), interfaceName), e);
}
log.debug("{}: create returning service {}", logName(), rpcService);
return rpcService;
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new ComponentDefinitionException("Error getting RPC service for " + interfaceName, e);
}
}
if (reg != null) {
try {
reg.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.warn("{}: error while unregistering", ACTION_PROVIDER, e);
} finally {
reg = null;
try {
iface = bundle.loadClass(interfaceName);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new ComponentDefinitionException(String.format(
"The specified \"interface\" for %s \"%s\" does not refer to an available class", interfaceName,
ACTION_PROVIDER), e);
*/
public abstract class BindingContext {
- public static BindingContext create(String logName, Class<? extends DataObject> klass,
- String appConfigListKeyValue) {
+ public static BindingContext create(final String logName, final Class<? extends DataObject> klass,
+ final String appConfigListKeyValue) {
if (Identifiable.class.isAssignableFrom(klass)) {
// The binding class corresponds to a yang list.
if (Strings.isNullOrEmpty(appConfigListKeyValue)) {
private boolean restartDependentsOnUpdates;
private boolean useDefaultForReferenceTypes;
- public void setBundle(Bundle bundle) {
+ public void setBundle(final Bundle bundle) {
this.bundle = bundle;
}
- public void setBlueprintContainerRestartService(BlueprintContainerRestartService restartService) {
+ public void setBlueprintContainerRestartService(final BlueprintContainerRestartService restartService) {
this.blueprintContainerRestartService = restartService;
}
- public void setRestartDependentsOnUpdates(boolean restartDependentsOnUpdates) {
+ public void setRestartDependentsOnUpdates(final boolean restartDependentsOnUpdates) {
this.restartDependentsOnUpdates = restartDependentsOnUpdates;
}
- public void setUseDefaultForReferenceTypes(boolean useDefaultForReferenceTypes) {
+ public void setUseDefaultForReferenceTypes(final boolean useDefaultForReferenceTypes) {
this.useDefaultForReferenceTypes = useDefaultForReferenceTypes;
}
}
@Override
- public void process(ComponentDefinitionRegistry registry) {
+ public void process(final ComponentDefinitionRegistry registry) {
LOG.debug("{}: In process", logName());
for (String name : registry.getComponentDefinitionNames()) {
}
}
- private void processServiceReferenceMetadata(MutableServiceReferenceMetadata serviceRef) {
+ private void processServiceReferenceMetadata(final MutableServiceReferenceMetadata serviceRef) {
if (!useDefaultForReferenceTypes) {
return;
}
}
}
- private void processMutableBeanMetadata(MutableBeanMetadata bean) {
+ private void processMutableBeanMetadata(final MutableBeanMetadata bean) {
if (restartDependentsOnUpdates && bean.getRuntimeClass() != null
&& AbstractPropertyPlaceholder.class.isAssignableFrom(bean.getRuntimeClass())) {
LOG.debug("{}: Found PropertyPlaceholder bean: {}, runtime {}", logName(), bean.getId(),
private volatile boolean initialUpdate = true;
@Override
- public void updated(Dictionary<String, ?> properties) {
+ public void updated(final Dictionary<String, ?> properties) {
LOG.debug("{}: ManagedService updated for persistentId {}, properties: {}, initialUpdate: {}",
logName(), persistentId, properties, initialUpdate);
public class ConfigXMLReaderException extends Exception {
private static final long serialVersionUID = 1L;
- public ConfigXMLReaderException(String message) {
+ public ConfigXMLReaderException(final String message) {
super(message);
}
- public ConfigXMLReaderException(String message, Throwable cause) {
+ public ConfigXMLReaderException(final String message, final Throwable cause) {
super(message, cause);
}
}
public DataStoreAppConfigDefaultXMLReader(
- String logName,
- String defaultAppConfigFileName,
- SchemaService schemaService,
- BindingNormalizedNodeSerializer bindingSerializer,
- BindingContext bindingContext,
- ConfigURLProvider inputStreamProvider) {
+ final String logName,
+ final String defaultAppConfigFileName,
+ final SchemaService schemaService,
+ final BindingNormalizedNodeSerializer bindingSerializer,
+ final BindingContext bindingContext,
+ final ConfigURLProvider inputStreamProvider) {
this.logName = logName;
this.defaultAppConfigFileName = defaultAppConfigFileName;
}
public DataStoreAppConfigDefaultXMLReader(
- Class<?> testClass,
- String defaultAppConfigFileName,
- SchemaService schemaService,
- BindingNormalizedNodeSerializer bindingSerializer,
- Class<T> klass) {
+ final Class<?> testClass,
+ final String defaultAppConfigFileName,
+ final SchemaService schemaService,
+ final BindingNormalizedNodeSerializer bindingSerializer,
+ final Class<T> klass) {
this(testClass.getName(), defaultAppConfigFileName, schemaService, bindingSerializer,
BindingContext.create(testClass.getName(), klass, null),
appConfigFileName -> Optional.of(getURL(testClass, defaultAppConfigFileName)));
}
- private static URL getURL(Class<?> testClass, String defaultAppConfigFileName) {
+ private static URL getURL(final Class<?> testClass, final String defaultAppConfigFileName) {
return Resources.getResource(testClass, defaultAppConfigFileName);
}
}
@SuppressWarnings("unchecked")
- public T createDefaultInstance(FallbackConfigProvider fallback) throws ConfigXMLReaderException {
+ public T createDefaultInstance(final FallbackConfigProvider fallback) throws ConfigXMLReaderException {
YangInstanceIdentifier yangPath = bindingSerializer.toYangInstanceIdentifier(bindingContext.appConfigPath);
LOG.debug("{}: Creating app config instance from path {}, Qname: {}", logName, yangPath,
appConfigFileName = moduleName + "_" + bindingContext.bindingQName.getLocalName() + ".xml";
}
- DomToNormalizedNodeParserFactory parserFactory = DomToNormalizedNodeParserFactory.getInstance(
+ final DomToNormalizedNodeParserFactory parserFactory = DomToNormalizedNodeParserFactory.getInstance(
XmlUtils.DEFAULT_XML_CODEC_PROVIDER, schemaContext);
Optional<URL> optionalURL;
try {
optionalURL = inputStreamProvider.getURL(appConfigFileName);
- } catch (IOException e) {
+ } catch (final IOException e) {
String msg = String.format("%s: Could not getURL()", logName);
LOG.error(msg, e);
throw new ConfigXMLReaderException(msg, e);
}
appConfigBindingClass = (Class<DataObject>) bindingClass;
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new ComponentDefinitionException(String.format("%s: Error loading app config binding class %s",
logName(), appConfigBindingClassName), e);
}
}
});
- } catch (ConfigXMLReaderException e) {
+ } catch (final ConfigXMLReaderException e) {
if (e.getCause() == null) {
setFailureMessage(e.getMessage());
} else {
private final String interfaceClass;
private final String id;
- MandatoryServiceReferenceMetadata(String id, String interfaceClass) {
+ MandatoryServiceReferenceMetadata(final String id, final String interfaceClass) {
this.id = Preconditions.checkNotNull(id);
this.interfaceClass = interfaceClass;
}
private NotificationListener notificationListener;
private ListenerRegistration<?> registration;
- public void setNotificationService(NotificationService notificationService) {
+ public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
- public void setNotificationListener(NotificationListener notificationListener) {
+ public void setNotificationListener(final NotificationListener notificationListener) {
this.notificationListener = notificationListener;
}
- public void setBundle(Bundle bundle) {
+ public void setBundle(final Bundle bundle) {
this.bundle = bundle;
}
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 newContainer) {
+ public void init(final ExtendedBlueprintContainer newContainer) {
this.container = newContainer;
LOG.debug("{}: In init", logName());
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();
*/
public class RoutedRpcRegistrationConverter implements Converter {
@Override
- public boolean canConvert(Object sourceObject, ReifiedType targetType) {
+ public boolean canConvert(final Object sourceObject, final ReifiedType targetType) {
return sourceObject instanceof RoutedRpcRegistration
&& RoutedRpcRegistration.class.isAssignableFrom(targetType.getRawClass());
}
@Override
- public Object convert(Object sourceObject, ReifiedType targetType) {
+ public Object convert(final Object sourceObject, final ReifiedType targetType) {
return sourceObject;
}
}
private RpcService implementation;
private final List<RpcRegistration<RpcService>> rpcRegistrations = new ArrayList<>();
- public void setRpcRegistry(RpcProviderRegistry rpcRegistry) {
+ public void setRpcRegistry(final RpcProviderRegistry rpcRegistry) {
this.rpcRegistry = rpcRegistry;
}
- public void setBundle(Bundle bundle) {
+ public void setBundle(final Bundle bundle) {
this.bundle = bundle;
}
- public void setInterfaceName(String interfaceName) {
+ public void setInterfaceName(final String interfaceName) {
this.interfaceName = interfaceName;
}
- public void setImplementation(RpcService implementation) {
+ public void setImplementation(final RpcService implementation) {
this.implementation = implementation;
}
for (Class<RpcService> rpcInterface : rpcInterfaces) {
rpcRegistrations.add(rpcRegistry.addRpcImplementation(rpcInterface, 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", RPC_IMPLEMENTATION, implementation.getClass()), e);
}
}
@SuppressWarnings("unchecked")
- static List<Class<RpcService>> getImplementedRpcServiceInterfaces(String interfaceName,
- Class<?> implementationClass, Bundle bundle, String logName) throws ClassNotFoundException {
+ static List<Class<RpcService>> getImplementedRpcServiceInterfaces(final String interfaceName,
+ final Class<?> implementationClass, final Bundle bundle, final String logName)
+ throws ClassNotFoundException {
if (!Strings.isNullOrEmpty(interfaceName)) {
Class<?> rpcInterface = bundle.loadClass(interfaceName);
private volatile BundleTracker<Bundle> bundleTracker;
private volatile ServiceTracker<Object, Object> serviceTracker;
- SpecificReferenceListMetadata(String id, String interfaceName) {
+ SpecificReferenceListMetadata(final String id, final String interfaceName) {
super(id);
this.interfaceName = interfaceName;
serviceResourcePath = "META-INF/services/" + interfaceName;
protected void startTracking() {
BundleTrackerCustomizer<Bundle> bundleListener = new BundleTrackerCustomizer<Bundle>() {
@Override
- public Bundle addingBundle(Bundle bundle, BundleEvent event) {
+ public Bundle addingBundle(final Bundle bundle, final BundleEvent event) {
bundleAdded(bundle);
return bundle;
}
@Override
- public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+ public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
}
@Override
- public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
+ public void removedBundle(final Bundle bundle, final BundleEvent event, final Bundle object) {
}
};
ServiceTrackerCustomizer<Object, Object> serviceListener = new ServiceTrackerCustomizer<Object, Object>() {
@Override
- public Object addingService(ServiceReference<Object> reference) {
+ public Object addingService(final ServiceReference<Object> reference) {
return serviceAdded(reference);
}
@Override
- public void modifiedService(ServiceReference<Object> reference, Object service) {
+ public void modifiedService(final ServiceReference<Object> reference, final Object service) {
}
@Override
- public void removedService(ServiceReference<Object> reference, Object service) {
+ public void removedService(final ServiceReference<Object> reference, final Object service) {
container().getBundleContext().ungetService(reference);
}
};
serviceTracker.open();
}
- private void bundleAdded(Bundle bundle) {
+ private void bundleAdded(final Bundle bundle) {
URL resource = bundle.getEntry(serviceResourcePath);
if (resource == null) {
return;
LOG.debug("{}: Retrieved service type {}", logName(), serviceType);
expectedServiceTypes.add(serviceType);
}
- } catch (IOException e) {
+ } catch (final IOException e) {
setFailure(String.format("%s: Error reading resource %s from bundle %s", logName(), resource,
bundle.getSymbolicName()), e);
}
}
- private Object serviceAdded(ServiceReference<Object> reference) {
+ private Object serviceAdded(final ServiceReference<Object> reference) {
Object service = container().getBundleContext().getService(reference);
String serviceType = (String) reference.getProperty(OpendaylightNamespaceHandler.TYPE_ATTR);
}
@Override
- public void destroy(Object instance) {
+ public void destroy(final Object instance) {
super.destroy(instance);
if (bundleTracker != null) {
private final String interfaceName;
private volatile Object retrievedService;
- StaticReferenceMetadata(String id, String interfaceName) {
+ StaticReferenceMetadata(final String id, final String interfaceName) {
super(id);
this.interfaceName = interfaceName;
}
private volatile Object trackedService;
private Consumer<Object> serviceSatisfiedCallback;
- StaticServiceReferenceRecipe(String name, ExtendedBlueprintContainer blueprintContainer,
- String interfaceClass) {
+ StaticServiceReferenceRecipe(final String name, final ExtendedBlueprintContainer blueprintContainer,
+ final String interfaceClass) {
super(name, blueprintContainer, new MandatoryServiceReferenceMetadata(name, interfaceClass), null, null,
Collections.emptyList());
}
- void startTracking(Consumer<Object> newServiceSatisfiedCallback) {
+ void startTracking(final Consumer<Object> newServiceSatisfiedCallback) {
this.serviceSatisfiedCallback = newServiceSatisfiedCallback;
super.start(NOOP_LISTENER);
}
@SuppressWarnings("rawtypes")
@Override
- protected void track(ServiceReference reference) {
+ protected void track(final ServiceReference reference) {
retrack();
}
@SuppressWarnings("rawtypes")
@Override
- protected void untrack(ServiceReference reference) {
+ protected void untrack(final ServiceReference reference) {
LOG.debug("{}: In untrack {}", getName(), reference);
if (trackedServiceReference == reference) {
if (trackedServiceReference != null && trackedService != null) {
try {
getBundleContextForServiceLookup().ungetService(trackedServiceReference);
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
// In case the service no longer exists, ignore.
}