[vlma-devel] commit: Catch the appropriate exception when the daemon cannot be contacted . (Adrien Grand )
git version control
git at videolan.org
Tue Jul 29 22:31:40 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Tue Jul 29 22:30:14 2008 +0200| [cea6e261352a1771af11bbda3df532d793fde632]
Catch the appropriate exception when the daemon cannot be contacted.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=cea6e261352a1771af11bbda3df532d793fde632
---
.../main/java/org/videolan/vlma/daemon/VLMad.java | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/vlma-daemon/src/main/java/org/videolan/vlma/daemon/VLMad.java b/vlma-daemon/src/main/java/org/videolan/vlma/daemon/VLMad.java
index c8f492e..5aa216f 100644
--- a/vlma-daemon/src/main/java/org/videolan/vlma/daemon/VLMad.java
+++ b/vlma-daemon/src/main/java/org/videolan/vlma/daemon/VLMad.java
@@ -24,13 +24,13 @@ import java.io.File;
import java.net.URL;
import java.rmi.RemoteException;
-import org.apache.commons.configuration.AbstractConfiguration;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
import org.apache.log4j.Logger;
+import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -71,9 +71,9 @@ public class VLMad {
Daemon daemon = (Daemon) ac.getBean("daemon");
daemon.start();
} else {
- ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("client.xml");
- Data data = (Data) ac.getBean("dataImporter");
try {
+ ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("client.xml");
+ Data data = (Data) ac.getBean("dataImporter");
if(command.equals(Command.stop)) {
data.stop();
ac.close();
@@ -81,7 +81,10 @@ public class VLMad {
data.reload();
}
} catch (RemoteException e) {
- logger.error("Unable to contact VLMa daemon. Is it really running?");
+ System.err.println("[ERROR] Unable to contact VLMa daemon. Is it really running?");
+ System.exit(1);
+ } catch (BeanCreationException e) {
+ System.err.println("[ERROR] Unable to contact VLMa daemon. Is it really running?");
System.exit(1);
}
}
More information about the vlma-devel
mailing list