public class HookRegistry
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,java.lang.Class<?>> |
HOOK_CLASSES
no need to use a sync'ed structure as this is read only.
|
private java.util.Map<java.lang.String,java.util.SortedSet<ServiceReference<?>>> |
m_allHooks |
private java.util.WeakHashMap<ServiceReference<?>,ServiceReference<?>> |
m_blackList |
| Constructor and Description |
|---|
HookRegistry() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
addHookClass(java.lang.Class<?> c) |
void |
addHooks(java.lang.String[] classNames,
java.lang.Object svcObj,
ServiceReference<?> ref)
Check and add the service to the set of hooks
|
void |
blackListHook(ServiceReference<?> sr) |
<S> java.util.Set<ServiceReference<S>> |
getHooks(java.lang.Class<S> hookClass)
Return the sorted set of hooks
|
(package private) static boolean |
isHook(java.lang.String[] classNames,
java.lang.Class<?> hookClass,
java.lang.Object svcObj) |
private boolean |
isHook(java.lang.String serviceName,
java.lang.Object svcObj) |
boolean |
isHookBlackListed(ServiceReference<?> sr) |
void |
removeHooks(ServiceReference<?> ref)
Remove the service hooks
|
void |
updateHooks(ServiceReference<?> ref)
Update the service ranking for a hook
|
private static final java.util.Map<java.lang.String,java.lang.Class<?>> HOOK_CLASSES
private final java.util.Map<java.lang.String,java.util.SortedSet<ServiceReference<?>>> m_allHooks
private final java.util.WeakHashMap<ServiceReference<?>,ServiceReference<?>> m_blackList
private static void addHookClass(java.lang.Class<?> c)
static boolean isHook(java.lang.String[] classNames,
java.lang.Class<?> hookClass,
java.lang.Object svcObj)
private boolean isHook(java.lang.String serviceName,
java.lang.Object svcObj)
public void addHooks(java.lang.String[] classNames,
java.lang.Object svcObj,
ServiceReference<?> ref)
classNames - The service namessvcObj - The service objectref - The service referencepublic void updateHooks(ServiceReference<?> ref)
ref - The service referencepublic void removeHooks(ServiceReference<?> ref)
ref - The service referencepublic <S> java.util.Set<ServiceReference<S>> getHooks(java.lang.Class<S> hookClass)
hookClass - The hook classpublic boolean isHookBlackListed(ServiceReference<?> sr)
public void blackListHook(ServiceReference<?> sr)