/** * Retrieve instance of a class via OSGI registry, if there * are many only the first is returned. On this version an LDAP * type of filter is applied * * @param clazz The target class * @param containerName The container name * @param bundle The caller * @param serviceFilter LDAP filter to be applied in the search */ public static Object getInstance(Class<?> clazz, String containerName, Object bundle, String serviceFilter) { Object[] instances = getInstances(clazz, containerName, bundle, serviceFilter); if (instances != null) { return instances[0]; } return null; }