|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.util.OSGiLocator
public final class OSGiLocator
Maintains a mapping of service names to an ordered set of service providers when running in an OSGi container.
It is expected that a bundle using Drools will populate this map with properties from its own ClassLoader. This is an adaptation of the technique described by Guillaume Nodet in his article Java EE specs in OSGi. The main changes were to add comments.
http://gnodet.blogspot.com/2008/05/jee-specs-in-osgi.html}
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |