From: <hag...@us...> - 2008-02-01 15:55:49
|
Revision: 3744 http://jnode.svn.sourceforge.net/jnode/?rev=3744&view=rev Author: hagar-wize Date: 2008-02-01 07:55:46 -0800 (Fri, 01 Feb 2008) Log Message: ----------- started add of apache.db.Derby Modified Paths: -------------- trunk/all/build.xml trunk/all/conf/full-plugin-list.xml Added Paths: ----------- trunk/distr/descriptors/derby.xml trunk/distr/lib/derby.jar trunk/distr/lib/derbynet.jar trunk/distr/src/apps/org/jnode/apps/derby/ trunk/distr/src/apps/org/jnode/apps/derby/DerbyCommand.java Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2008-02-01 08:47:04 UTC (rev 3743) +++ trunk/all/build.xml 2008-02-01 15:55:46 UTC (rev 3744) @@ -58,6 +58,8 @@ <property name="jsp.jar" value="${root.dir}/distr/lib/jsp-2.1.jar" /> <property name="jsp-api.jar" value="${root.dir}/distr/lib/jsp-api-2.1.jar" /> <property name="servlet.jar" value="${root.dir}/distr/lib/servlet-api-2.5-6.1.5.jar" /> + <property name="derby.jar" value="${root.dir}/distr/lib/derby.jar" /> + <property name="derbynet.jar" value="${root.dir}/distr/lib/derbynet.jar" /> <!-- libraries needed to run tests --> <property name="jmock-cglib.jar" value="${root.dir}/core/lib/jmock-cglib-1.0.1.jar"/> @@ -119,6 +121,8 @@ <pathelement location="${commons-net.jar}"/> <pathelement location="${dnsjava.jar}"/> <pathelement location="${mauve.jar}"/> + <pathelement location="${derby.jar}"/> + <pathelement location="${derbynet.jar}"/> </path> <path id="cp-jnode"> @@ -244,6 +248,8 @@ <libalias name="jsp.jar" alias="${jsp.jar}"/> <libalias name="jsp-api.jar" alias="${jsp-api.jar}"/> <libalias name="servlet.jar" alias="${servlet.jar}"/> + <libalias name="derby.jar" alias="${derby.jar}"/> + <libalias name="derbynet.jar" alias="${derbynet.jar}"/> <descriptors dir="${descriptors.dir}/"> <include name="*.xml"/> Modified: trunk/all/conf/full-plugin-list.xml =================================================================== --- trunk/all/conf/full-plugin-list.xml 2008-02-01 08:47:04 UTC (rev 3743) +++ trunk/all/conf/full-plugin-list.xml 2008-02-01 15:55:46 UTC (rev 3744) @@ -39,4 +39,5 @@ <plugin id="net.wimpi.telnetd"/> <plugin id="jetty"/> + <plugin id="derby"/> </plugin-list> Added: trunk/distr/descriptors/derby.xml =================================================================== --- trunk/distr/descriptors/derby.xml (rev 0) +++ trunk/distr/descriptors/derby.xml 2008-02-01 15:55:46 UTC (rev 3744) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="derby" + name="Derby" + version="10.3.2.1" + license-name="apache2.0" + provider-name="apache DB" + provider-url="http://db.apache.org/derby/"> + + + <requires> + <import plugin="org.jnode.shell"/> + </requires> + + <runtime> + <library name="derby.jar"> + <export name="*"/> + </library> + <library name="derbynet.jar"> + <export name="*"/> + </library> + <library name="jnode-distr.jar"> + <export name="org.jnode.apps.derby.*"/> + </library> + </runtime> + + <extension point="org.jnode.shell.aliases"> + <alias name="derby" class="org.jnode.apps.derby.DerbyCommand"/> + </extension> + + <extension point="org.jnode.security.permissions"> + <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> + </extension> + +</plugin> Added: trunk/distr/lib/derby.jar =================================================================== (Binary files differ) Property changes on: trunk/distr/lib/derby.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/distr/lib/derbynet.jar =================================================================== (Binary files differ) Property changes on: trunk/distr/lib/derbynet.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/distr/src/apps/org/jnode/apps/derby/DerbyCommand.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/derby/DerbyCommand.java (rev 0) +++ trunk/distr/src/apps/org/jnode/apps/derby/DerbyCommand.java 2008-02-01 15:55:46 UTC (rev 3744) @@ -0,0 +1,57 @@ +/* + * $Id$ + */ +package org.jnode.apps.derby; + + +import org.apache.derby.drda.NetworkServerControl; + +import org.jnode.shell.AbstractCommand; +import org.jnode.shell.CommandLine; +import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.Help; +import org.jnode.shell.help.Parameter; +import org.jnode.shell.help.Argument; +import org.jnode.shell.help.argument.FileArgument; +import org.jnode.shell.help.argument.IntegerArgument; +import org.jnode.shell.help.argument.StringArgument; + +import java.io.InputStream; +import java.io.PrintStream; +import java.io.File; + +/** + * Command for handling Derby server. + * + * @author Martin Husted Hartvig (ha...@jn...) + */ +public class DerbyCommand extends AbstractCommand { + static final FileArgument ARG_HOME = new FileArgument("derbyhome", "home directory for derby"); + static final Argument ARG_COMMAND = new StringArgument("command","start/stop command for derby"); + static final IntegerArgument ARG_PORT = new IntegerArgument("port", "jdbc port"); + + private static Parameter PARAM_HOME = new Parameter(ARG_HOME, Parameter.OPTIONAL); + private static Parameter PARAM_PORT = new Parameter(ARG_PORT, Parameter.OPTIONAL); + + public static Help.Info HELP_INFO = new Help.Info("derby", "start or stop the derby db server on a given port (default 1527)", + new Parameter(ARG_COMMAND, Parameter.MANDATORY), + PARAM_HOME, + PARAM_PORT); + + public static void main(String[] args) throws Exception { + new DerbyCommand().execute(args); + } + + public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) throws Exception { + ParsedArguments arguments = HELP_INFO.parse(commandLine); + File home_dir = ARG_HOME.getFile(arguments); + String command = ARG_COMMAND.getValue(arguments); + + int port; + if (PARAM_PORT.isSet(arguments)) { + port = ARG_PORT.getInteger(arguments); + } + + NetworkServerControl.main(new String[]{command}); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |