Class OsgiProxyFactory
java.lang.Object
com.atlassian.confluence.impl.osgi.OsgiProxyFactory
A factory to produce proxy for OSGi services.
- Since:
- 8.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
createProxy
(Class<T> interfaceType, Supplier<org.osgi.util.tracker.ServiceTracker> serviceTrackerSupplier) Provides a proxy of the given interface T that is backed by the OSGi service from the provided service tracker.
-
Constructor Details
-
OsgiProxyFactory
public OsgiProxyFactory()
-
-
Method Details
-
createProxy
public static <T> T createProxy(Class<T> interfaceType, Supplier<org.osgi.util.tracker.ServiceTracker> serviceTrackerSupplier) Provides a proxy of the given interface T that is backed by the OSGi service from the provided service tracker. The provided implementation will fail fast if the service is not available - it will NOT wait for the service to become available.It is expected callers will use this method to obtain services that they will invoke later in response to user activity. Invoking methods on returned proxy immediately will probably not work, unless you know what you're doing.
-