Added bundle STARTING and STOPPING events (FELIX-34).
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@425319 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
index 20d6a5e..47b4355 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -1186,14 +1186,17 @@
return;
case Bundle.INSTALLED:
_resolveBundle(bundle);
+ // No break.
case Bundle.RESOLVED:
info.setState(Bundle.STARTING);
+ fireBundleEvent(BundleEvent.STARTING, bundle);
+ break;
}
try
{
// Set the bundle's activator.
- bundle.getInfo().setActivator(createBundleActivator(bundle.getInfo()));
+ info.setActivator(createBundleActivator(bundle.getInfo()));
// Activate the bundle if it has an activator.
if (bundle.getInfo().getActivator() != null)
@@ -1215,11 +1218,9 @@
}
}
- info.setState(Bundle.ACTIVE);
-
// TODO: CONCURRENCY - Reconsider firing event outside of the
// bundle lock.
-
+ info.setState(Bundle.ACTIVE);
fireBundleEvent(BundleEvent.STARTED, bundle);
}
catch (Throwable th)
@@ -1510,8 +1511,10 @@
case Bundle.ACTIVE:
// Set bundle state..
info.setState(Bundle.STOPPING);
+ fireBundleEvent(BundleEvent.STOPPING, bundle);
+ break;
}
-
+
try
{
if (bundle.getInfo().getActivator() != null)