OPS4J Pax Swissbox :: Extender 1.3.1

org.ops4j.pax.swissbox.extender
Class BundleWatcher<T>

java.lang.Object
  extended by org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle
      extended by org.ops4j.pax.swissbox.extender.BundleWatcher<T>
All Implemented Interfaces:
org.ops4j.pax.swissbox.lifecycle.Lifecycle

public class BundleWatcher<T>
extends org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle

Watches bundles life cycle events. Once a bundle becomes active a scanning process will be performed and each bundle resource found during scanning will be registered. Once a bundle stops the registered resources for that bundle will be unregistered. If the bundle watcher is stopped all bundle resources will be unregistered.

Since:
October 14, 2007
Author:
Alin Dreghiciu

Constructor Summary
BundleWatcher(org.osgi.framework.BundleContext context, BundleScanner<T> scanner)
          Create a new bundle watcher.
BundleWatcher(org.osgi.framework.BundleContext context, BundleScanner<T> scanner, BundleObserver<T>... observers)
          Create a new bundle watcher.
 
Method Summary
protected  void onStart()
          Registers a listener for bundle events and scans already active bundles.
protected  void onStop()
          Un-register the bundle listener, releases resources
 
Methods inherited from class org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle
isStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleWatcher

public BundleWatcher(org.osgi.framework.BundleContext context,
                     BundleScanner<T> scanner)
Create a new bundle watcher.

Parameters:
context - a bundle context. Cannot be null.
scanner - a bundle scanner. Cannot be null.

BundleWatcher

public BundleWatcher(org.osgi.framework.BundleContext context,
                     BundleScanner<T> scanner,
                     BundleObserver<T>... observers)
Create a new bundle watcher.

Parameters:
context - a bundle context. Cannot be null.
scanner - a bundle scanner. Cannot be null.
observers - list of observers
Method Detail

onStart

protected void onStart()
Registers a listener for bundle events and scans already active bundles.

Specified by:
onStart in class org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle

onStop

protected void onStop()
Un-register the bundle listener, releases resources

Specified by:
onStop in class org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle

OPS4J Pax Swissbox :: Extender 1.3.1

Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.