Package com.yahoo.jdisc.core
Class BundleCollisionHook
- java.lang.Object
-
- com.yahoo.jdisc.core.BundleCollisionHook
-
- All Implemented Interfaces:
org.osgi.framework.hooks.bundle.CollisionHook
,org.osgi.framework.hooks.bundle.EventHook
,org.osgi.framework.hooks.bundle.FindHook
public class BundleCollisionHook extends Object implements org.osgi.framework.hooks.bundle.CollisionHook, org.osgi.framework.hooks.bundle.EventHook, org.osgi.framework.hooks.bundle.FindHook
A bundleCollisionHook
that contains a set of bundles that are allowed to collide with bundles that are about to be installed. This class also implements aFindHook
to provide a consistent view of bundles such that the two sets of duplicate bundles are invisible to each other. In order to clean up when bundles are uninstalled, this is also a bundleEventHook
. Thread safe- Author:
- gjoranv
-
-
Constructor Summary
Constructors Constructor Description BundleCollisionHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
event(org.osgi.framework.BundleEvent event, Collection<org.osgi.framework.BundleContext> contexts)
Cleans up the allowed duplicates when a bundle is uninstalled.void
filterCollisions(int operationType, org.osgi.framework.Bundle target, Collection<org.osgi.framework.Bundle> collisionCandidates)
Removes duplicates of the allowed duplicate bundles from the given collision candidates.void
find(org.osgi.framework.BundleContext context, Collection<org.osgi.framework.Bundle> bundles)
Filters out the set of bundles that should not be visible to the bundle associated with the given context.void
start(org.osgi.framework.BundleContext context)
void
stop()
-
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context)
-
stop
public void stop()
-
event
public void event(org.osgi.framework.BundleEvent event, Collection<org.osgi.framework.BundleContext> contexts)
Cleans up the allowed duplicates when a bundle is uninstalled.- Specified by:
event
in interfaceorg.osgi.framework.hooks.bundle.EventHook
-
filterCollisions
public void filterCollisions(int operationType, org.osgi.framework.Bundle target, Collection<org.osgi.framework.Bundle> collisionCandidates)
Removes duplicates of the allowed duplicate bundles from the given collision candidates.- Specified by:
filterCollisions
in interfaceorg.osgi.framework.hooks.bundle.CollisionHook
-
find
public void find(org.osgi.framework.BundleContext context, Collection<org.osgi.framework.Bundle> bundles)
Filters out the set of bundles that should not be visible to the bundle associated with the given context. If the given context represents one of the allowed duplicates, this method filters out all bundles that are duplicates of the allowed duplicates. Otherwise this method filters out the allowed duplicates, so they are not visible to other bundles.- Specified by:
find
in interfaceorg.osgi.framework.hooks.bundle.FindHook
-
-