[vlma-devel] commit: Remove command line parsing. (Adrien Grand )
git version control
git at videolan.org
Sat Jun 28 01:46:07 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Fri Jun 27 20:56:45 2008 +0200| [51c0d3fd34514b6092626017bed567771172453b]
Remove command line parsing.
To change the VLMa behavior from the command line, prefer overriding
configuration variables using the -D Java option.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=51c0d3fd34514b6092626017bed567771172453b
---
vlma-daemon/pom.xml | 5 --
.../main/java/org/videolan/vlma/daemon/VLMad.java | 23 +--------
vlma-daemon/src/main/resources/dbgdaemon.xml | 53 --------------------
3 files changed, 2 insertions(+), 79 deletions(-)
diff --git a/vlma-daemon/pom.xml b/vlma-daemon/pom.xml
index 0f843c8..345a4db 100644
--- a/vlma-daemon/pom.xml
+++ b/vlma-daemon/pom.xml
@@ -83,11 +83,6 @@
<version>1.1.1</version>
</dependency>
<dependency>
- <groupId>jargs</groupId>
- <artifactId>jargs</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
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 d00e461..378c25d 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,8 +24,6 @@ import java.net.Inet4Address;
import java.net.URL;
import java.net.UnknownHostException;
-import jargs.gnu.CmdLineParser;
-
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.SystemConfiguration;
@@ -59,27 +57,10 @@ public class VLMad {
System.exit(2);
}
- // parsing of command line
- CmdLineParser parser = new CmdLineParser();
- CmdLineParser.Option springxml = parser.addStringOption("springxml");
-
- try {
- parser.parse(args);
- } catch (CmdLineParser.OptionException e) {
- logger.fatal("Erreur dans la ligne de commande : " + e.getMessage());
- logger.info("Usage: VLMad [{--springxml} daemon.xml]\n");
- System.exit(2);
- }
-
- String springxmlvalue = (String) parser.getOptionValue(springxml);
- if (springxmlvalue == null) {
- springxmlvalue = "daemon.xml";
- }
-
// Launching VLMad
logger.debug("Starting VLMad");
- logger.debug("Loading Spring application context from XML file: " + springxmlvalue);
- ApplicationContext ac = new ClassPathXmlApplicationContext(springxmlvalue);
+ logger.debug("Loading Spring application context");
+ ApplicationContext ac = new ClassPathXmlApplicationContext("daemon.xml");
StreamingStrategy streamingStrategy = (StreamingStrategy) ac.getBean("streamingStrategy");
String announcement = VLMa.getInstance().getString("vlma.announcement.protocol");
String protocol = VLMa.getInstance().getString("vlma.streaming.protocol");
diff --git a/vlma-daemon/src/main/resources/dbgdaemon.xml b/vlma-daemon/src/main/resources/dbgdaemon.xml
deleted file mode 100644
index b0e5c34..0000000
--- a/vlma-daemon/src/main/resources/dbgdaemon.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
-
- <bean id="dataExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
- <property name="serviceName" value="VLMaDataService"/>
- <property name="service" ref="dataSource"/>
- <property name="serviceInterface" value="org.videolan.vlma.common.Data"/>
- <property name="registryPort" value="9050"/>
- <property name="servicePort" value="9060"/>
- </bean>
-
- <bean id="OrderMonitoring" class="org.videolan.vlma.daemon.OrderMonitoring">
- <constructor-arg index="0">
- <ref bean="dataSource" />
- </constructor-arg>
- <property name="streamWatcher">
- <ref bean="StreamWatcherBean" />
- </property>
- </bean>
- <bean id="StreamWatcherBean" class="org.videolan.vlma.daemon.watcher.StreamWatcherMockImpl">
- </bean>
-
- <bean id="dataSource" class="org.videolan.vlma.daemon.Data" init-method="loadFromDisk">
- <property name="servers">
- <list>
- <ref bean="fakeserv1" />
- <ref bean="fakeserv2" />
- <ref bean="fakeserv3" />
- <ref bean="fakeserv4" />
- </list>
- </property>
- </bean>
- <bean id="fakeserv1" class="org.videolan.vlma.common.server.ServerMockImpl">
- <constructor-arg index="0" value="fakeserv1"/>
- <constructor-arg index="1"> <null/></constructor-arg>
- </bean>
- <bean id="fakeserv2" class="org.videolan.vlma.common.server.ServerMockImpl">
- <constructor-arg index="0" value="fakeserv2"/>
- <constructor-arg index="1"> <null/></constructor-arg>
- </bean>
- <bean id="fakeserv3" class="org.videolan.vlma.common.server.ServerMockImpl">
- <constructor-arg index="0" value="fakeserv3"/>
- <constructor-arg index="1"> <null/></constructor-arg>
- </bean>
- <bean id="fakeserv4" class="org.videolan.vlma.common.server.ServerMockImpl">
- <constructor-arg index="0" value="fakeserv4"/>
- <constructor-arg index="1"> <null/></constructor-arg>
- </bean>
-
-</beans>
More information about the vlma-devel
mailing list