Package org.osgi.framework.hooks.bundle
Interface CollisionHook
@ConsumerType
public interface CollisionHook
OSGi Framework Bundle Collision Hook Service.
If the framework was launched with the org.osgi.framework.bsnversion
framework launching property set to
managed
, then all registered
collision hook services will be called during framework bundle install and
update operations to determine if an install or update operation will result
in a bundle symbolic name and version collision.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Specifies a bundle install operation is being performed.static final int
Specifies a bundle update operation is being performed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
filterCollisions
(int operationType, Bundle target, Collection<Bundle> collisionCandidates) Filter bundle collisions hook method.
-
Field Details
-
INSTALLING
static final int INSTALLINGSpecifies a bundle install operation is being performed.- See Also:
-
UPDATING
static final int UPDATINGSpecifies a bundle update operation is being performed.- See Also:
-
-
Method Details
-
filterCollisions
Filter bundle collisions hook method. This method is called during the install or update operation. The operation type will beinstalling
orupdating
. Depending on the operation type the target bundle and the collision candidate collection are the following:installing
- The target is the bundle associated with theBundleContext
used to call one of theinstall
methods. The collision candidate collection contains the existing bundles installed which have the same symbolic name and version as the bundle being installed.updating
- The target is the bundle used to call one of theupdate
methods. The collision candidate collection contains the existing bundles installed which have the same symbolic name and version as the content the target bundle is being updated to.
- Parameters:
operationType
- The operation type. Must be the value ofinstalling
orupdating
.target
- The target bundle used to determine what collision candidates to filter.collisionCandidates
- The collection of collision candidates. The collection supports all the optionalCollection
operations exceptadd
andaddAll
. Attempting to add to the collection will result in anUnsupportedOperationException
. The collection is not synchronized.
-