try {
//Getting the registered required OSGi services
ServiceReference[] references = bundleContext.getServiceReferences(HostObjectServiceInterface.class.getName(), null);
if (references != null && references.length > 0) {
for (ServiceReference reference : references) {
HostObjectServiceInterface hostObjectServiceInterface = (HostObjectServiceInterface) bundleContext.getService(reference);
String className = hostObjectServiceInterface.getHostObjectClassName();
hostObjectsThatNeedServices.remove(className);
}
}
} catch (InvalidSyntaxException e) {
//SyntaxError Occured. Ignoring