Package org.apache.felix.framework
Class HookRegistry
- java.lang.Object
-
- org.apache.felix.framework.HookRegistry
-
public class HookRegistry extends java.lang.Object
This registry holds all services implementing one of the hook services
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description HookRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 hooksvoid
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 hooksvoid
updateHooks(ServiceReference<?> ref)
Update the service ranking for a hook
-
-
-
Field Detail
-
HOOK_CLASSES
private static final java.util.Map<java.lang.String,java.lang.Class<?>> HOOK_CLASSES
no need to use a sync'ed structure as this is read only.
-
m_allHooks
private final java.util.Map<java.lang.String,java.util.SortedSet<ServiceReference<?>>> m_allHooks
-
m_blackList
private final java.util.WeakHashMap<ServiceReference<?>,ServiceReference<?>> m_blackList
-
-
Method Detail
-
addHookClass
private static void addHookClass(java.lang.Class<?> c)
-
isHook
static boolean isHook(java.lang.String[] classNames, java.lang.Class<?> hookClass, java.lang.Object svcObj)
-
isHook
private boolean isHook(java.lang.String serviceName, java.lang.Object svcObj)
-
addHooks
public void addHooks(java.lang.String[] classNames, java.lang.Object svcObj, ServiceReference<?> ref)
Check and add the service to the set of hooks- Parameters:
classNames
- The service namessvcObj
- The service objectref
- The service reference
-
updateHooks
public void updateHooks(ServiceReference<?> ref)
Update the service ranking for a hook- Parameters:
ref
- The service reference
-
removeHooks
public void removeHooks(ServiceReference<?> ref)
Remove the service hooks- Parameters:
ref
- The service reference
-
getHooks
public <S> java.util.Set<ServiceReference<S>> getHooks(java.lang.Class<S> hookClass)
Return the sorted set of hooks- Parameters:
hookClass
- The hook class- Returns:
- The sorted set - the set might be empty
-
isHookBlackListed
public boolean isHookBlackListed(ServiceReference<?> sr)
-
blackListHook
public void blackListHook(ServiceReference<?> sr)
-
-