|
From: <ls...@us...> - 2009-07-22 10:07:30
|
Revision: 5616
http://jnode.svn.sourceforge.net/jnode/?rev=5616&view=rev
Author: lsantha
Date: 2009-07-22 10:07:29 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
Adedd NativeProcesImpl.
Modified Paths:
--------------
trunk/all/lib/ftp.properties
Added Paths:
-----------
trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java
trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java
Modified: trunk/all/lib/ftp.properties
===================================================================
--- trunk/all/lib/ftp.properties 2009-07-22 08:26:30 UTC (rev 5615)
+++ trunk/all/lib/ftp.properties 2009-07-22 10:07:29 UTC (rev 5616)
@@ -1,3 +1,3 @@
-classlib.url=http://codemammoth.com/jnodeftp/classlib/20090524110358
-classlib.md5=d49489983eb3850e707c0fe8da830806
-classlib-src.md5=e531cd0e489a81e0e38542b3412077bb
\ No newline at end of file
+classlib.url=http://codemammoth.com/jnodeftp/classlib/20090722120045
+classlib.md5=db80e29d8154341d4cf4dc8b1476a131
+classlib-src.md5=72ead15492b953ed1b8022b816971730
\ No newline at end of file
Added: trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java
===================================================================
--- trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java (rev 0)
+++ trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java 2009-07-22 10:07:29 UTC (rev 5616)
@@ -0,0 +1,53 @@
+package java.lang;
+
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Arrays;
+
+/**
+ *
+ */
+class JNodeProcess extends Process {
+
+ static Process start(String[] cmdarray, java.util.Map<String, String> environment, String dir,
+ boolean redirectErrorStream) throws IOException {
+
+ System.out.println("cmdarray: " + Arrays.asList(cmdarray));
+ System.out.println("environment: " + environment);
+ System.out.println("dir: " + dir);
+ System.out.println("redirectErrorStream: " + redirectErrorStream);
+
+ return new JNodeProcess();
+ }
+
+ @Override
+ public OutputStream getOutputStream() {
+ return null;
+ }
+
+ @Override
+ public InputStream getInputStream() {
+ return null;
+ }
+
+ @Override
+ public InputStream getErrorStream() {
+ return null;
+ }
+
+ @Override
+ public int waitFor() throws InterruptedException {
+ return 0;
+ }
+
+ @Override
+ public int exitValue() {
+ return 0;
+ }
+
+ @Override
+ public void destroy() {
+
+ }
+}
Added: trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java
===================================================================
--- trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java (rev 0)
+++ trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java 2009-07-22 10:07:29 UTC (rev 5616)
@@ -0,0 +1,66 @@
+package java.lang;
+
+import java.io.IOException;
+
+/**
+ *
+ */
+class NativeProcessImpl {
+ private NativeProcessImpl() {}
+ static Process start(String[] cmdarray, java.util.Map<String, String> environment, String dir,
+ boolean redirectErrorStream) throws IOException {
+ return JNodeProcess.start(cmdarray, environment, dir, redirectErrorStream);
+ }
+}
+
+/*
+private ProcessImpl() {} // Not instantiable
+
+ private static byte[] toCString(String s) {
+ if (s == null)
+ return null;
+ byte[] bytes = s.getBytes();
+ byte[] result = new byte[bytes.length + 1];
+ System.arraycopy(bytes, 0,
+ result, 0,
+ bytes.length);
+ result[result.length-1] = (byte)0;
+ return result;
+ }
+
+ // Only for use by ProcessBuilder.start()
+ static Process start(String[] cmdarray,
+ java.util.Map<String,String> environment,
+ String dir,
+ boolean redirectErrorStream)
+ throws IOException
+ {
+ assert cmdarray != null && cmdarray.length > 0;
+
+ // Convert arguments to a contiguous block; it's easier to do
+ // memory management in Java than in C.
+ byte[][] args = new byte[cmdarray.length-1][];
+ int size = args.length; // For added NUL bytes
+ for (int i = 0; i < args.length; i++) {
+ args[i] = cmdarray[i+1].getBytes();
+ size += args[i].length;
+ }
+ byte[] argBlock = new byte[size];
+ int i = 0;
+ for (byte[] arg : args) {
+ System.arraycopy(arg, 0, argBlock, i, arg.length);
+ i += arg.length + 1;
+ // No need to write NUL bytes explicitly
+ }
+
+ int[] envc = new int[1];
+ byte[] envBlock = ProcessEnvironment.toEnvironmentBlock(environment, envc);
+
+ return new UNIXProcess
+ (toCString(cmdarray[0]),
+ argBlock, args.length,
+ envBlock, envc[0],
+ toCString(dir),
+ redirectErrorStream);
+ }
+ */
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|