public class PluginComponentAccessor extends Object
| Constructor and Description |
|---|
PluginComponentAccessor() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getOSGiComponentInstanceOfType(Class<T> clazz)
Returns an instance of the service identified by the given interface, as exported by a plugin module.
|
@Nullable public static <T> T getOSGiComponentInstanceOfType(Class<T> clazz)
Warning: as the instance returned comes from OSGi-land, it can become invalid at anytime (if the plugin is disabled/enabled for instance). For this reason, it should NEVER be cached (e.g stored in a field variable).
T - the interface typeclazz - the interface of the servicenull if no plugin publicly exports this particular service.Copyright © 2020 Atlassian. All rights reserved.