Author: gertv
Date: Fri May 23 05:03:37 2008
New Revision: 659512
URL: http://svn.apache.org/viewvc?rev=659512&view=rev
Log:
SMX4KNL-44: Changed bundles are restarted twice
Modified:
servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
Modified:
servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
URL:
http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java?rev=659512&r1=659511&r2=659512&view=diff
==============================================================================
---
servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
(original)
+++
servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
Fri May 23 05:03:37 2008
@@ -82,7 +82,6 @@
private boolean loggedConfigAdminWarning;
private List<Bundle> changedBundles = new ArrayList<Bundle>();
private List<Bundle> bundlesToStart = new ArrayList<Bundle>();
- private List<Bundle> bundlesToUpdate = new ArrayList<Bundle>();
private Map<String, String> artifactToBundle = new HashMap<String,
String>();
private Set<String> pendingArtifacts = new HashSet<String>();
private ServiceListener listener;
@@ -91,6 +90,7 @@
public FileMonitor() {
}
+ @SuppressWarnings("unchecked")
public FileMonitor(FileMonitorActivator activator, Dictionary properties) {
this.activator = activator;
@@ -207,7 +207,6 @@
protected synchronized void onFilesChanged(Collection<String> filenames) {
changedBundles.clear();
bundlesToStart.clear();
- bundlesToUpdate.clear();
Set<File> bundleJarsCreated = new HashSet<File>();
for (Object filename : filenames) {
@@ -346,7 +345,7 @@
}
protected void deployBundle(File file) throws IOException, BundleException
{
- LOGGER.info("Deloying: " + file.getCanonicalPath());
+ LOGGER.info("Deploying: " + file.getCanonicalPath());
InputStream in = new FileInputStream(file);
@@ -354,7 +353,6 @@
Bundle bundle = getBundleForJarFile(file);
if (bundle != null) {
changedBundles.add(bundle);
- bundlesToUpdate.add(bundle);
}
else {
bundle =
getContext().installBundle(file.getCanonicalFile().toURI().toString(), in);
@@ -494,16 +492,6 @@
}
changedBundles.clear();
- for (Bundle bundle : bundlesToUpdate) {
- try {
- bundle.update();
- LOGGER.info("Updated: " + bundle);
-
- }
- catch (BundleException e) {
- LOGGER.warn("Failed to update bundle: " + bundle + ". Reason:
" + e, e);
- }
- }
for (Bundle bundle : bundlesToStart) {
try {
bundle.start();
@@ -609,6 +597,7 @@
return false;
}
+ @SuppressWarnings("unchecked")
protected File getFileValue(Dictionary properties, String key) {
Object value = properties.get(key);
if (value instanceof File) {
@@ -620,6 +609,7 @@
return null;
}
+ @SuppressWarnings("unchecked")
protected Long getLongValue(Dictionary properties, String key) {
Object value = properties.get(key);
if (value instanceof Long) {