/** * 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; }
/** * Creates a new client-side representation of a resource described by * the interface passed in the first argument. * * @param <C> Type of the resource to be created. * @param resourceInterface Interface describing the resource to be created. * @param target WebTarget pointing to the resource or the parent of the resource. * @param ignoreResourcePath If set to true, ignores path annotation on the resource interface (this is used when creating * sub-resources) * @param headers Header params collected from parent resources (used when creating a sub-resource) * @param cookies Cookie params collected from parent resources (used when creating a sub-resource) * @param form Form params collected from parent resources (used when creating a sub-resource) * @return Instance of a class implementing the resource interface that can * be used for making requests to the server. */ @SuppressWarnings("unchecked") public static <C> C newResource(final Class<C> resourceInterface, final WebTarget target, final boolean ignoreResourcePath, final MultivaluedMap<String, Object> headers, final List<Cookie> cookies, final Form form) { return (C) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(resourceInterface)), new Class[] {resourceInterface}, new WebResourceFactory(ignoreResourcePath ? target : addPathFromAnnotation(resourceInterface, target), headers, cookies, form)); }
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
/** * 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; }
/** * @since 1.0.2 */ @SuppressWarnings("unchecked") public static <T> T create(final Class<T> intf, final WebTarget target, @Nullable final MultivaluedMap<String,Object> headers, @Nullable final List<Cookie> cookies, @Nullable final Form form) { checkNotNull(intf); checkNotNull(target); T result = (T) Proxy.newProxyInstance( AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(intf)), new Class[]{intf}, handler( intf, target, headers == null ? EMPTY_HEADERS : headers, cookies == null ? EMPTY_COOKIES : cookies, form == null ? EMPTY_FORM : form ) ); log.trace("Endpoint: {}", result); return result; }
/** * Creates a new client-side representation of a resource described by * the interface passed in the first argument. * * @param <C> Type of the resource to be created. * @param resourceInterface Interface describing the resource to be created. * @param target WebTarget pointing to the resource or the parent of the resource. * @param ignoreResourcePath If set to true, ignores path annotation on the resource interface (this is used when creating * sub-resources) * @param headers Header params collected from parent resources (used when creating a sub-resource) * @param cookies Cookie params collected from parent resources (used when creating a sub-resource) * @param form Form params collected from parent resources (used when creating a sub-resource) * @return Instance of a class implementing the resource interface that can * be used for making requests to the server. */ @SuppressWarnings("unchecked") public static <C> C newResource(final Class<C> resourceInterface, final WebTarget target, final boolean ignoreResourcePath, final MultivaluedMap<String, Object> headers, final List<Cookie> cookies, final Form form) { return (C) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(resourceInterface)), new Class[] {resourceInterface}, new WebResourceFactory(ignoreResourcePath ? target : addPathFromAnnotation(resourceInterface, target), headers, cookies, form)); }
/** * Creates a new client-side representation of a resource described by * the interface passed in the first argument. * * @param <C> Type of the resource to be created. * @param resourceInterface Interface describing the resource to be created. * @param target WebTarget pointing to the resource or the parent of the resource. * @param ignoreResourcePath If set to true, ignores path annotation on the resource interface (this is used when creating * sub-resources) * @param headers Header params collected from parent resources (used when creating a sub-resource) * @param cookies Cookie params collected from parent resources (used when creating a sub-resource) * @param form Form params collected from parent resources (used when creating a sub-resource) * @param invoker Method invoker * @return Instance of a class implementing the resource interface that can * be used for making requests to the server. */ @SuppressWarnings("unchecked") public static <C> C newResource(final Class<C> resourceInterface, final WebTarget target, final boolean ignoreResourcePath, final MultivaluedMap<String, Object> headers, final List<Cookie> cookies, final Form form, final ClientMethodInvoker invoker) { return (C) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(resourceInterface)), new Class[]{resourceInterface}, new WebResourceFactory(ignoreResourcePath ? target : addPathFromAnnotation(resourceInterface, target), headers, cookies, form, invoker)); }
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));
AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(wadlGenerator.getClass()));