com.atlassian.confluence.osgi
Interface OsgiServiceRegistry
- All Known Implementing Classes:
- OsgiServiceRegistryImpl
public interface OsgiServiceRegistry
This registry eliminates the boilerplate required for a component in Confluence Core to consume a service that is
not available in the application context, but exclusively published through OSGI.
Use this registry to obtain services published this way from CORE code only.
NOTE: this registry's intended behaviour pretty closely overlaps a very small subset of what Gemini / Spring DM
offers, but we don't want to depend on those tools for what is a moderately straightforward task.
Method Summary |
|
getService(Class<T> clazz)
Provides an implementation of the given interface T that is guaranteed to be backed by the highest ranked
OSGI service implementing T. |
getService
<T> T getService(Class<T> clazz)
- Provides an implementation of the given interface T that is guaranteed to be backed by the highest ranked
OSGI service implementing T. 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 implementation immediately will probably not work, unless you
know what you're doing.
Copyright © 2003–2015 Atlassian. All rights reserved.