public final class OSGiLocator extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
locate(String serviceName)
Finds the preferred provider for the given service.
|
static List<Class<?>> |
locateAll(String serviceName)
Finds all providers for the given service.
|
static void |
register(String serviceName,
Callable<Class<?>> factory)
Adds the given service provider factory to the set of
providers for the service.
|
static void |
unregister(String serviceName,
Callable<Class<?>> factory)
Removes the given service provider factory from the set of
providers for the service.
|
public static void unregister(String serviceName, Callable<Class<?>> factory)
serviceName - The fully qualified name of the service interface.factory - A factory for creating a specific type of service
provider. May be null in which case this
method does nothing.IllegalArgumentException - if serviceName is nullpublic static void register(String serviceName, Callable<Class<?>> factory)
serviceName - The fully qualified name of the service interface.factory - A factory for creating a specific type of service
provider. May be null in which case this
method does nothing.IllegalArgumentException - if serviceName is nullpublic static Class<?> locate(String serviceName)
serviceName - The fully qualified name of the service interface.IllegalArgumentException - if serviceName is nullpublic static List<Class<?>> locateAll(String serviceName)
serviceName - The fully qualified name of the service interface.IllegalArgumentException - if serviceName is nullCopyright © 2001–2020 JBoss by Red Hat. All rights reserved.