/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }
/** * Returns an {@code OsgiRegistry} instance. Call this method only if sure that the application is running in OSGi * environment, otherwise a call to this method can lead to an {@link ClassNotFoundException}. * * @return an {@code OsgiRegistry} instance. */ public static synchronized OsgiRegistry getInstance() { if (instance == null) { final ClassLoader classLoader = AccessController .doPrivileged(ReflectionHelper.getClassLoaderPA(ReflectionHelper.class)); if (classLoader instanceof BundleReference) { final BundleContext context = FrameworkUtil.getBundle(OsgiRegistry.class).getBundleContext(); if (context != null) { // context could be still null if the current bundle has not been started instance = new OsgiRegistry(context); } } } return instance; }