domino.java.capsule.DefaultCapsuleScope Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-java Show documentation
Show all versions of domino-java Show documentation
A lightweight Java library for writing elegant OSGi bundle activators
package domino.java.capsule;
/**
* A capsule scope implementation based on a {@link Iterable}.
*
*/
public class DefaultCapsuleScope implements CapsuleScope {
private final Iterable capsules;
/**
* Creates a capsule scope containing the given capsules.
*
* @param capsules
* The capsules in this scope.
*/
public DefaultCapsuleScope(final Iterable capsules) {
this.capsules = capsules;
}
/**
* Stop this stop and therefore all containing capsules.
*/
@Override
public void stop() {
for (final Capsule capsule : capsules) {
capsule.stop();
}
}
}