OSGi™ Core
Release 6

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.

"ThreadSafe"

Field Summary
static int INSTALLING
          Specifies a bundle install operation is being performed.
static int UPDATING
          Specifies a bundle update operation is being performed.
 
Method Summary
 void filterCollisions(int operationType, Bundle target, Collection<Bundle> collisionCandidates)
          Filter bundle collisions hook method.
 

Field Detail

INSTALLING

static final int INSTALLING
Specifies a bundle install operation is being performed.

See Also:
Constant Field Values

UPDATING

static final int UPDATING
Specifies a bundle update operation is being performed.

See Also:
Constant Field Values
Method Detail

filterCollisions

void filterCollisions(int operationType,
                      Bundle target,
                      Collection<Bundle> collisionCandidates)
Filter bundle collisions hook method. This method is called during the install or update operation. The operation type will be installing or updating. Depending on the operation type the target bundle and the collision candidate collection are the following: This method can filter the collection of collision candidates by removing potential collisions. For the specified operation to succeed, the collection of collision candidates must be empty after all registered collision hook services have been called.

Parameters:
operationType - The operation type. Must be the value of installing or updating.
target - The target bundle used to determine what collision candidates to filter.
collisionCandidates - The collection of collision candidates. The collection supports all the optional Collection operations except add and addAll. Attempting to add to the collection will result in an UnsupportedOperationException . The collection is not synchronized.

OSGi™ Core
Release 6

Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0