|
From: <cr...@us...> - 2009-01-17 15:03:11
|
Revision: 4877
http://jnode.svn.sourceforge.net/jnode/?rev=4877&view=rev
Author: crawley
Date: 2009-01-17 15:03:04 +0000 (Sat, 17 Jan 2009)
Log Message:
-----------
Rename the shell.command.unix package and plugin to ...posix
Modified Paths:
--------------
trunk/all/conf/full-plugin-list.xml
trunk/shell/build.xml
Added Paths:
-----------
trunk/shell/descriptors/org.jnode.shell.command.posix.xml
trunk/shell/src/shell/org/jnode/shell/command/posix/
trunk/shell/src/shell/org/jnode/shell/command/posix/FalseCommand.java
trunk/shell/src/shell/org/jnode/shell/command/posix/TrueCommand.java
trunk/shell/src/shell/org/jnode/shell/command/posix/UnixTestCommand.java
Removed Paths:
-------------
trunk/shell/descriptors/org.jnode.shell.command.unix.xml
trunk/shell/src/shell/org/jnode/shell/command/unix/FalseCommand.java
trunk/shell/src/shell/org/jnode/shell/command/unix/TrueCommand.java
trunk/shell/src/shell/org/jnode/shell/command/unix/UnixTestCommand.java
Modified: trunk/all/conf/full-plugin-list.xml
===================================================================
--- trunk/all/conf/full-plugin-list.xml 2009-01-17 07:56:28 UTC (rev 4876)
+++ trunk/all/conf/full-plugin-list.xml 2009-01-17 15:03:04 UTC (rev 4877)
@@ -31,7 +31,7 @@
<plugin id="thinlet"/>
- <plugin id="org.jnode.shell.command.unix"/>
+ <plugin id="org.jnode.shell.command.posix"/>
<plugin id="org.jnode.apps.jpartition"/>
Modified: trunk/shell/build.xml
===================================================================
--- trunk/shell/build.xml 2009-01-17 07:56:28 UTC (rev 4876)
+++ trunk/shell/build.xml 2009-01-17 15:03:04 UTC (rev 4877)
@@ -10,6 +10,7 @@
<!-- Subproject specific classpath -->
<path id="my-cp">
<pathelement location="${jnode-core.jar}"/>
+ <pathelement location="${basedir}/../builder/lib/nanoxml-2.2.3.jar"/>
<path refid="cp"/>
</path>
Added: trunk/shell/descriptors/org.jnode.shell.command.posix.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.command.posix.xml (rev 0)
+++ trunk/shell/descriptors/org.jnode.shell.command.posix.xml 2009-01-17 15:03:04 UTC (rev 4877)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<plugin id="org.jnode.shell.command.posix"
+ name="JNode System Commands"
+ version="@VERSION@"
+ license-name="lgpl"
+ provider-name="JNode.org">
+
+ <requires>
+ <import plugin="org.jnode.shell.help"/>
+ </requires>
+
+ <runtime>
+ <library name="jnode-shell.jar">
+ <export name="org.jnode.shell.command.posix.*"/>
+ </library>
+ </runtime>
+
+ <extension point="org.jnode.shell.aliases">
+ <alias name="false" class="org.jnode.shell.command.posix.FalseCommand"/>
+ <alias name="test" class="org.jnode.shell.command.posix.UnixTestCommand"/>
+ <alias name="true" class="org.jnode.shell.command.posix.TrueCommand"/>
+ <alias name="[" class="org.jnode.shell.command.posix.UnixTestCommand"/>
+ </extension>
+
+ <extension point="org.jnode.shell.syntaxes">
+ <syntax alias="false">
+ <empty description="Set a non-zero return code"/>
+ </syntax>
+ <syntax alias="true">
+ <empty description="Set a zero return code"/>
+ </syntax>
+ </extension>
+
+ <extension point="org.jnode.security.permissions">
+ <permission class="java.util.PropertyPermission" name="*" actions="read,write"/>
+ <permission class="java.lang.RuntimePermission" name="getProtectionDomain"/>
+ <permission class="java.lang.RuntimePermission" name="createClassLoader"/>
+ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/>
+ <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/>
+ <permission class="java.lang.RuntimePermission" name="setIO" actions="*" />
+ <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/>
+ <permission class="org.jnode.security.JNodePermission" name="getVmThread"/>
+ <permission class="org.jnode.security.JNodePermission" name="getVmClass"/>
+ <permission class="java.net.SocketPermission" name="*" actions="resolve"/>
+ <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/>
+ <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/>
+ <permission class="java.lang.RuntimePermission" name="readFileDescriptor"/>
+ </extension>
+
+</plugin>
Deleted: trunk/shell/descriptors/org.jnode.shell.command.unix.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.command.unix.xml 2009-01-17 07:56:28 UTC (rev 4876)
+++ trunk/shell/descriptors/org.jnode.shell.command.unix.xml 2009-01-17 15:03:04 UTC (rev 4877)
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plugin SYSTEM "jnode.dtd">
-
-<plugin id="org.jnode.shell.command.unix"
- name="JNode System Commands"
- version="@VERSION@"
- license-name="lgpl"
- provider-name="JNode.org">
-
- <requires>
- <import plugin="org.jnode.shell.help"/>
- </requires>
-
- <runtime>
- <library name="jnode-shell.jar">
- <export name="org.jnode.shell.command.unix.*"/>
- </library>
- </runtime>
-
- <extension point="org.jnode.shell.aliases">
- <alias name="false" class="org.jnode.shell.command.unix.FalseCommand"/>
- <alias name="test" class="org.jnode.shell.command.unix.UnixTestCommand"/>
- <alias name="true" class="org.jnode.shell.command.unix.TrueCommand"/>
- <alias name="[" class="org.jnode.shell.command.unix.UnixTestCommand"/>
- </extension>
-
- <extension point="org.jnode.shell.syntaxes">
- <syntax alias="false">
- <empty description="Set a non-zero return code"/>
- </syntax>
- <syntax alias="true">
- <empty description="Set a zero return code"/>
- </syntax>
- </extension>
-
- <extension point="org.jnode.security.permissions">
- <permission class="java.util.PropertyPermission" name="*" actions="read,write"/>
- <permission class="java.lang.RuntimePermission" name="getProtectionDomain"/>
- <permission class="java.lang.RuntimePermission" name="createClassLoader"/>
- <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/>
- <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/>
- <permission class="java.lang.RuntimePermission" name="setIO" actions="*" />
- <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" />
- <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/>
- <permission class="org.jnode.security.JNodePermission" name="getVmThread"/>
- <permission class="org.jnode.security.JNodePermission" name="getVmClass"/>
- <permission class="java.net.SocketPermission" name="*" actions="resolve"/>
- <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/>
- <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/>
- <permission class="java.lang.RuntimePermission" name="readFileDescriptor"/>
- </extension>
-
-</plugin>
Added: trunk/shell/src/shell/org/jnode/shell/command/posix/FalseCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/posix/FalseCommand.java (rev 0)
+++ trunk/shell/src/shell/org/jnode/shell/command/posix/FalseCommand.java 2009-01-17 15:03:04 UTC (rev 4877)
@@ -0,0 +1,47 @@
+/*
+ * $Id: EchoCommand.java 4694 2008-11-09 14:20:31Z crawley $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command.posix;
+
+import org.jnode.shell.AbstractCommand;
+
+/**
+ * Simply exit with rc of 1;
+ *
+ * @author cr...@jn...
+ */
+public class FalseCommand extends AbstractCommand {
+
+ public FalseCommand() {
+ super("Exit with a non-zero return code");
+ }
+
+ public static void main(String[] args) throws Exception {
+ new FalseCommand().execute(args);
+ }
+
+ /**
+ * Execute the command
+ */
+ public void execute() throws Exception {
+ exit(1);
+ }
+}
Added: trunk/shell/src/shell/org/jnode/shell/command/posix/TrueCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/posix/TrueCommand.java (rev 0)
+++ trunk/shell/src/shell/org/jnode/shell/command/posix/TrueCommand.java 2009-01-17 15:03:04 UTC (rev 4877)
@@ -0,0 +1,46 @@
+/*
+ * $Id: EchoCommand.java 4694 2008-11-09 14:20:31Z crawley $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command.posix;
+
+import org.jnode.shell.AbstractCommand;
+
+/**
+ * Simply exit with rc of 0;
+ *
+ * @author cr...@jn...
+ */
+public class TrueCommand extends AbstractCommand {
+
+ public TrueCommand() {
+ super("Exit with zero return code");
+ }
+
+ public static void main(String[] args) throws Exception {
+ new TrueCommand().execute(args);
+ }
+
+ /**
+ * Execute the command
+ */
+ public void execute() throws Exception {
+ }
+}
Added: trunk/shell/src/shell/org/jnode/shell/command/posix/UnixTestCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/posix/UnixTestCommand.java (rev 0)
+++ trunk/shell/src/shell/org/jnode/shell/command/posix/UnixTestCommand.java 2009-01-17 15:03:04 UTC (rev 4877)
@@ -0,0 +1,413 @@
+/*
+ * $Id: SetCommand.java 2945 2006-12-20 08:51:17Z qades $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command.posix;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Stack;
+
+import org.jnode.shell.AbstractCommand;
+import org.jnode.shell.CommandLine;
+import org.jnode.shell.help.SyntaxErrorException;
+
+
+/**
+ * JNode implementation of the UNIX 'test' command
+ *
+ * @author cr...@jn...
+ */
+public class UnixTestCommand extends AbstractCommand {
+ // FIXME convert to use the new commandline syntax mechanism so that
+ // we get command completion.
+ private static class Operator {
+ public final int opNo;
+ public final int priority;
+ public final int kind;
+ public Operator(final int opNo, final int priority, int kind) {
+ this.opNo = opNo;
+ this.priority = priority;
+ this.kind = kind;
+ }
+ }
+
+ private boolean bracketted;
+ private int pos;
+ private String[] args;
+ private int lastArg;
+ private Stack<Object> operandStack = new Stack<Object>();
+ private Stack<Operator> operatorStack = new Stack<Operator>();
+
+ private static final int OP_DIRECTORY = 1;
+ private static final int OP_EXISTS = 2;
+ private static final int OP_FILE = 3;
+ private static final int OP_STRING_LENGTH = 4;
+ private static final int OP_STRING_NONEMPTY = 5;
+ private static final int OP_STRING_EMPTY = 6;
+ private static final int OP_READABLE = 7;
+ private static final int OP_WRITEABLE = 8;
+ private static final int OP_NONEMPTY = 9;
+ private static final int OP_EQ = 10;
+ private static final int OP_NE = 11;
+ private static final int OP_GT = 12;
+ private static final int OP_GE = 13;
+ private static final int OP_LT = 14;
+ private static final int OP_LE = 15;
+ private static final int OP_AND = 16;
+ private static final int OP_OR = 17;
+ private static final int OP_NOT = 18;
+ private static final int OP_STRING_EQUALS = 19;
+ private static final int OP_STRING_NONEQUAL = 20;
+ private static final int OP_LPAREN = 21;
+ private static final int OP_RPAREN = 22;
+ private static final int OP_OLDER = 23;
+ private static final int OP_NEWER = 24;
+
+ private static final int OP_UNARY = 1;
+ private static final int OP_BINARY = 2;
+ private static final int OP_SPECIAL = 3;
+
+ private static final HashMap<String, Operator> OPERATOR_MAP;
+
+ static {
+ OPERATOR_MAP = new HashMap<String, Operator>();
+ OPERATOR_MAP.put("-d", new Operator(OP_DIRECTORY, 3, OP_UNARY));
+ OPERATOR_MAP.put("-e", new Operator(OP_EXISTS, 3, OP_UNARY));
+ OPERATOR_MAP.put("-f", new Operator(OP_FILE, 3, OP_UNARY));
+ OPERATOR_MAP.put("-l", new Operator(OP_STRING_LENGTH, 3, OP_UNARY));
+ OPERATOR_MAP.put("-n", new Operator(OP_STRING_NONEMPTY, 3, OP_UNARY));
+ OPERATOR_MAP.put("-z", new Operator(OP_STRING_EMPTY, 3, OP_UNARY));
+ OPERATOR_MAP.put("-r", new Operator(OP_READABLE, 3, OP_UNARY));
+ OPERATOR_MAP.put("-w", new Operator(OP_WRITEABLE, 3, OP_UNARY));
+ OPERATOR_MAP.put("-eq", new Operator(OP_EQ, 3, OP_BINARY));
+ OPERATOR_MAP.put("-ne", new Operator(OP_NE, 3, OP_BINARY));
+ OPERATOR_MAP.put("-lt", new Operator(OP_LT, 3, OP_BINARY));
+ OPERATOR_MAP.put("-le", new Operator(OP_LE, 3, OP_BINARY));
+ OPERATOR_MAP.put("-gt", new Operator(OP_GT, 3, OP_BINARY));
+ OPERATOR_MAP.put("-ge", new Operator(OP_GE, 3, OP_BINARY));
+ OPERATOR_MAP.put("-ot", new Operator(OP_OLDER, 3, OP_BINARY));
+ OPERATOR_MAP.put("-nt", new Operator(OP_NEWER, 3, OP_BINARY));
+ OPERATOR_MAP.put("-a", new Operator(OP_AND, 1, OP_BINARY));
+ OPERATOR_MAP.put("-o", new Operator(OP_OR, 0, OP_BINARY));
+ OPERATOR_MAP.put("!", new Operator(OP_NOT, 2, OP_UNARY));
+ OPERATOR_MAP.put("=", new Operator(OP_STRING_EQUALS, 5, OP_BINARY));
+ OPERATOR_MAP.put("!=", new Operator(OP_STRING_NONEQUAL, 5, OP_BINARY));
+ OPERATOR_MAP.put("(", new Operator(OP_LPAREN, -1, OP_SPECIAL));
+ OPERATOR_MAP.put(")", new Operator(OP_RPAREN, 6, OP_SPECIAL));
+ }
+
+ public void execute()
+ throws Exception {
+ boolean res = false;
+ CommandLine commandLine = getCommandLine();
+ String commandName = commandLine.getCommandName();
+ bracketted = (commandName != null && commandName.equals("["));
+ args = commandLine.getArguments();
+ try {
+ if (bracketted && args.length == 0) {
+ throw new SyntaxErrorException("missing ']'");
+ } else if (bracketted && !args[args.length - 1].equals("]")) {
+ processAsOptions(args);
+ res = true;
+ } else {
+ lastArg = bracketted ? args.length - 2 : args.length - 1;
+ if (lastArg == -1) {
+ res = false;
+ } else {
+ Object obj = evaluate();
+ if (pos <= lastArg) {
+ if (args[pos].equals(")")) {
+ throw new SyntaxErrorException("unmatched ')'");
+ } else {
+ throw new AssertionError("I'm confused! pos = " + pos +
+ ", lastArg = " + lastArg + ", next arg is " + args[pos]);
+ }
+ }
+ if (obj instanceof Boolean) {
+ res = obj == Boolean.TRUE;
+ } else if (obj instanceof Long) {
+ res = ((Long) obj).longValue() != 0;
+ } else {
+ res = obj.toString().length() > 0;
+ }
+ }
+ }
+ if (!res) {
+ exit(1);
+ }
+ } catch (SyntaxErrorException ex) {
+ getError().getPrintWriter().println(ex.getMessage());
+ exit(2);
+ }
+ }
+
+ private Object evaluate() throws SyntaxErrorException {
+ evaluateExpression(false);
+ while (!operatorStack.isEmpty()) {
+ reduce();
+ }
+ if (operandStack.size() != 1) {
+ throw new AssertionError("wrong nos operands left");
+ }
+ return operandStack.pop();
+ }
+
+ private void evaluateExpression(boolean nested) throws SyntaxErrorException {
+ evaluatePrimary(nested);
+ while (pos <= lastArg) {
+ String tok = next();
+ Operator op = OPERATOR_MAP.get(tok);
+ if (op == null) {
+ throw new SyntaxErrorException("expected an operator");
+ }
+ switch(op.kind) {
+ case OP_UNARY:
+ throw new SyntaxErrorException("misplaced unary operator");
+ case OP_BINARY:
+ evaluatePrimary(nested);
+ reduceAndPush(op, popOperand());
+ break;
+ case OP_SPECIAL:
+ if (op.opNo == OP_LPAREN) {
+ throw new SyntaxErrorException("misplaced '('");
+ } else if (op.opNo == OP_RPAREN) {
+ if (!nested) {
+ throw new SyntaxErrorException("misplaced ')'");
+ }
+ back();
+ return;
+ }
+ }
+ }
+ }
+
+ private void evaluatePrimary(boolean nested) throws SyntaxErrorException {
+ String tok = next();
+ Operator op = OPERATOR_MAP.get(tok);
+ if (op == null) {
+ pushOperand(tok);
+ } else {
+ switch (op.kind) {
+ case OP_UNARY:
+ operatorStack.push(op);
+ operandStack.push(next());
+ break;
+ case OP_BINARY:
+ throw new SyntaxErrorException("misplaced binary operator");
+ case OP_SPECIAL:
+ if (op.opNo == OP_LPAREN) {
+ operatorStack.push(op); // ... as a marker.
+ evaluateExpression(true);
+ if (!next().equals(")")) {
+ throw new SyntaxErrorException("missing ')'");
+ }
+ while (operatorStack.peek() != op) {
+ reduce();
+ }
+ if (operatorStack.pop() != op) {
+ throw new AssertionError("cannot find my marker!");
+ }
+ } else {
+ throw new SyntaxErrorException("unmatched ')'");
+ }
+ }
+ }
+ }
+
+ private void reduceAndPush(Operator operator, Object operand) throws SyntaxErrorException {
+ while (!operatorStack.isEmpty() && operator.priority <= operatorStack.peek().priority) {
+ reduce();
+ }
+ operatorStack.push(operator);
+ operandStack.push(operand);
+ }
+
+ private void reduce() throws SyntaxErrorException {
+ Operator operator = operatorStack.pop();
+ Object operand = null, operand2 = null;
+ if (operator.kind == OP_UNARY) {
+ operand = popOperand();
+ } else if (operator.kind == OP_BINARY) {
+ operand2 = popOperand();
+ operand = popOperand();
+ }
+ switch (operator.opNo) {
+ case OP_EXISTS:
+ pushOperand(toFile(operand).exists());
+ break;
+ case OP_DIRECTORY:
+ pushOperand(toFile(operand).isDirectory());
+ break;
+ case OP_FILE:
+ pushOperand(toFile(operand).isFile());
+ break;
+ case OP_NONEMPTY:
+ pushOperand(toFile(operand).length() > 0);
+ break;
+ case OP_READABLE:
+ pushOperand(toFile(operand).canRead());
+ break;
+ case OP_WRITEABLE:
+ pushOperand(toFile(popOperand()).canWrite());
+ break;
+ case OP_OLDER:
+ pushOperand(toFile(operand).lastModified() < toFile(operand2).lastModified());
+ break;
+ case OP_NEWER:
+ pushOperand(toFile(operand).lastModified() > toFile(operand2).lastModified());
+ break;
+ case OP_STRING_EMPTY:
+ pushOperand(toString().length() == 0);
+ break;
+ case OP_STRING_NONEMPTY:
+ pushOperand(toString(operand).length() > 0);
+ break;
+ case OP_STRING_LENGTH:
+ pushOperand(toString(operand).length());
+ break;
+ case OP_EQ:
+ pushOperand(toNumber(operand) == toNumber(operand2));
+ break;
+ case OP_NE:
+ pushOperand(toNumber(operand) != toNumber(operand2));
+ break;
+ case OP_LT:
+ pushOperand(toNumber(operand) < toNumber(operand2));
+ break;
+ case OP_LE:
+ pushOperand(toNumber(operand) <= toNumber(operand2));
+ break;
+ case OP_GT:
+ pushOperand(toNumber(operand) > toNumber(operand2));
+ break;
+ case OP_GE:
+ pushOperand(toNumber(operand) >= toNumber(operand2));
+ break;
+ case OP_AND:
+ pushOperand(toBoolean(operand) & toBoolean(operand2));
+ break;
+ case OP_OR:
+ pushOperand(toBoolean(operand) | toBoolean(operand2));
+ break;
+ case OP_NOT:
+ pushOperand(!toBoolean(operand));
+ break;
+ case OP_STRING_EQUALS:
+ pushOperand(toString(operand).equals(toString(operand2)));
+ break;
+ case OP_STRING_NONEQUAL:
+ pushOperand(!toString(operand).equals(toString(operand2)));
+ break;
+ default:
+ throw new AssertionError("bad operator");
+ }
+ }
+
+ private void processAsOptions(String[] args) throws SyntaxErrorException {
+ PrintWriter err = getError().getPrintWriter();
+ for (String option : args) {
+ if (option.equals("--help")) {
+ err.println("Don't panic!");
+ } else if (option.equals("--version")) {
+ err.println("JNode test 0.0");
+ } else {
+ throw new SyntaxErrorException("unknown option '" + option + "'");
+ }
+ }
+ }
+
+ private void pushOperand(Object value) {
+ operandStack.push(value);
+ }
+
+ private void pushOperand(boolean value) {
+ operandStack.push(value ? Boolean.TRUE : Boolean.FALSE);
+ }
+
+ private void pushOperand(long value) {
+ operandStack.push(new Long(value));
+ }
+
+ private Object popOperand() throws SyntaxErrorException {
+ if (operandStack.isEmpty()) {
+ throw new SyntaxErrorException("missing LHS for operator");
+ }
+ return operandStack.pop();
+ }
+
+ private long toNumber(Object obj) throws SyntaxErrorException {
+ if (obj instanceof Long) {
+ return ((Long) obj).longValue();
+ } else if (obj instanceof String) {
+ try {
+ return Long.parseLong((String) obj);
+ } catch (NumberFormatException ex) {
+ throw new SyntaxErrorException(
+ "operand is not a number: '" + obj.toString() + "'");
+ }
+ } else {
+ throw new SyntaxErrorException("subexpression is not an INTEGER");
+ }
+ }
+
+ private boolean toBoolean(Object obj) throws SyntaxErrorException {
+ if (obj instanceof Boolean) {
+ return obj == Boolean.TRUE;
+ } else if (obj instanceof String) {
+ return ((String) obj).length() > 0;
+ } else {
+ throw new SyntaxErrorException("operand is an INTEGER");
+ }
+ }
+
+ private String toString(Object obj) throws SyntaxErrorException {
+ if (obj instanceof String) {
+ return (String) obj;
+ } else {
+ throw new SyntaxErrorException("operand is not a STRING");
+ }
+ }
+
+ private File toFile(Object obj) throws SyntaxErrorException {
+ if (obj instanceof String) {
+ return new File((String) obj);
+ } else {
+ throw new SyntaxErrorException("operand is not a FILENAME");
+ }
+ }
+
+ private String next() {
+ if (pos > lastArg) {
+ return null;
+ }
+ return args[pos++];
+ }
+
+ private void back() throws SyntaxErrorException {
+ pos--;
+ }
+
+ public static void main(String[] args) throws Exception {
+ // If you invoke it this way you cannot distinguish 'test' from '['
+ new UnixTestCommand().execute(args);
+ }
+}
Deleted: trunk/shell/src/shell/org/jnode/shell/command/unix/FalseCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/unix/FalseCommand.java 2009-01-17 07:56:28 UTC (rev 4876)
+++ trunk/shell/src/shell/org/jnode/shell/command/unix/FalseCommand.java 2009-01-17 15:03:04 UTC (rev 4877)
@@ -1,47 +0,0 @@
-/*
- * $Id: EchoCommand.java 4694 2008-11-09 14:20:31Z crawley $
- *
- * JNode.org
- * Copyright (C) 2003-2006 JNode.org
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; If not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-package org.jnode.shell.command.unix;
-
-import org.jnode.shell.AbstractCommand;
-
-/**
- * Simply exit with rc of 1;
- *
- * @author cr...@jn...
- */
-public class FalseCommand extends AbstractCommand {
-
- public FalseCommand() {
- super("Exit with a non-zero return code");
- }
-
- public static void main(String[] args) throws Exception {
- new FalseCommand().execute(args);
- }
-
- /**
- * Execute the command
- */
- public void execute() throws Exception {
- exit(1);
- }
-}
Deleted: trunk/shell/src/shell/org/jnode/shell/command/unix/TrueCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/unix/TrueCommand.java 2009-01-17 07:56:28 UTC (rev 4876)
+++ trunk/shell/src/shell/org/jnode/shell/command/unix/TrueCommand.java 2009-01-17 15:03:04 UTC (rev 4877)
@@ -1,46 +0,0 @@
-/*
- * $Id: EchoCommand.java 4694 2008-11-09 14:20:31Z crawley $
- *
- * JNode.org
- * Copyright (C) 2003-2006 JNode.org
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; If not, write to the Free Software Foundation, Inc.,
- * 51 Franklin S...
[truncated message content] |
|
From: <cr...@us...> - 2009-01-18 13:23:25
|
Revision: 4887
http://jnode.svn.sourceforge.net/jnode/?rev=4887&view=rev
Author: crawley
Date: 2009-01-18 13:23:15 +0000 (Sun, 18 Jan 2009)
Log Message:
-----------
First checkin of a test harness for testing JNode commands and scripts.
(This entails moving most of Emu into the 'shell' project.)
Modified Paths:
--------------
trunk/shell/.classpath
trunk/shell/build.xml
trunk/shell/descriptors/org.jnode.test.shell.xml
trunk/shell/src/test/org/jnode/test/shell/Cassowary.java
Added Paths:
-----------
trunk/shell/src/emu/
trunk/shell/src/emu/org/
trunk/shell/src/emu/org/jnode/
trunk/shell/src/emu/org/jnode/emu/
trunk/shell/src/emu/org/jnode/emu/DeviceManager.java
trunk/shell/src/emu/org/jnode/emu/Emu.java
trunk/shell/src/emu/org/jnode/emu/EmuException.java
trunk/shell/src/test/org/jnode/test/shell/command/
trunk/shell/src/test/org/jnode/test/shell/command/posix/
trunk/shell/src/test/org/jnode/test/shell/command/posix/TrueTest.xml
trunk/shell/src/test/org/jnode/test/shell/harness/
trunk/shell/src/test/org/jnode/test/shell/harness/ClassTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/CommandTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/Test.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestHarness.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestRunnable.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestSpecification.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestSpecificationException.java
Removed Paths:
-------------
trunk/distr/src/emu/org/jnode/emu/DeviceManager.java
trunk/distr/src/emu/org/jnode/emu/Emu.java
trunk/distr/src/emu/org/jnode/emu/EmuException.java
Deleted: trunk/distr/src/emu/org/jnode/emu/DeviceManager.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/DeviceManager.java 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/distr/src/emu/org/jnode/emu/DeviceManager.java 2009-01-18 13:23:15 UTC (rev 4887)
@@ -1,105 +0,0 @@
-/*
- * $Id$
- */
-package org.jnode.emu;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.log4j.Logger;
-import org.jnode.driver.AbstractDeviceManager;
-import org.jnode.driver.Device;
-import org.jnode.driver.DeviceFinder;
-import org.jnode.driver.DeviceToDriverMapper;
-import org.jnode.driver.DriverException;
-
-/**
- * @author Levente S\u00e1ntha
- */
-public class DeviceManager extends AbstractDeviceManager {
- public static final Logger log = Logger.getLogger(DeviceManager.class);
-
- public static final DeviceManager INSTANCE = new DeviceManager();
-
- private List<DeviceFinder> finders = new ArrayList<DeviceFinder>();
-
- private List<DeviceToDriverMapper> mappers = new ArrayList<DeviceToDriverMapper>();
-
- private DeviceManager() {
- }
-
- public void removeAll() {
- finders.clear();
- mappers.clear();
-
- for (Device device : getDevices()) {
- try {
- unregister(device);
- } catch (DriverException e) {
- log.error("can't unregister " + device);
- }
- }
- }
-
- public void add(DeviceFinder finder, DeviceToDriverMapper mapper) {
- boolean doStart = false;
-
- if (!finders.contains(finder)) {
- finders.add(finder);
- doStart = true;
- }
-
- if (!mappers.contains(mapper)) {
- mappers.add(mapper);
- doStart = true;
- }
-
- if (doStart) {
- start();
- }
- }
-
- /**
- * Start this manager
- */
- public final void start() {
- // Thread thread = new Thread()
- // {
- // public void run()
- // {
- log.debug("Loading extensions ...");
- loadExtensions();
- log.debug("Extensions loaded !");
- // }
- // };
- // thread.start();
-
- try {
- // must be called before findDeviceDrivers
- log.debug("findDevices ...");
- findDevices();
-
- log.debug("findDeviceDrivers ...");
- findDeviceDrivers();
-
- log.debug("StubDeviceManager initialized !");
- } catch (InterruptedException e) {
- log.fatal("can't find devices", e);
- }
- }
-
- protected final void refreshFinders(List<DeviceFinder> finders) {
- log.info("refreshFinders");
- finders.clear();
- finders.addAll(this.finders);
- }
-
- protected final void refreshMappers(List<DeviceToDriverMapper> mappers) {
- log.info("refreshMappers");
- mappers.clear();
- mappers.addAll(this.mappers);
-
- // Now sort them
- Collections.sort(mappers, MapperComparator.INSTANCE);
- }
-}
Deleted: trunk/distr/src/emu/org/jnode/emu/Emu.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/Emu.java 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/distr/src/emu/org/jnode/emu/Emu.java 2009-01-18 13:23:15 UTC (rev 4887)
@@ -1,228 +0,0 @@
-/*
- * $Id: NameSpace.java 4564 2008-09-18 22:01:10Z fduminy $
- *
- * JNode.org
- * Copyright (C) 2003-2006 JNode.org
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; If not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-package org.jnode.emu;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import javax.naming.NamingException;
-
-import org.jnode.emu.naming.BasicNameSpace;
-import org.jnode.emu.plugin.model.DummyExtensionPoint;
-import org.jnode.naming.InitialNaming;
-import org.jnode.nanoxml.XMLElement;
-import org.jnode.shell.ShellManager;
-import org.jnode.shell.alias.AliasManager;
-import org.jnode.shell.alias.def.DefaultAliasManager;
-import org.jnode.shell.def.DefaultShellManager;
-import org.jnode.shell.help.HelpFactory;
-import org.jnode.shell.help.def.DefaultHelpFactory;
-import org.jnode.shell.syntax.DefaultSyntaxManager;
-import org.jnode.shell.syntax.SyntaxBundle;
-import org.jnode.shell.syntax.SyntaxManager;
-import org.jnode.shell.syntax.SyntaxSpecAdapter;
-import org.jnode.shell.syntax.SyntaxSpecLoader;
-import org.jnode.shell.syntax.XMLSyntaxSpecAdapter;
-
-/**
- * This class is the core of a light-weight JNode emulator that allows (some) JNode
- * applications to be run using a classic JVM in the context of a JNode development sandbox.
- *
- * @author Levente S\u00e1ntha
- * @author Stephen Crawley
- */
-public abstract class Emu {
- private static final String[] ALL_PROJECTS = new String[]{
- "core", "distr", "fs", "gui", "net", "shell", "sound", "textui"
- };
-
- private static final String[] PLUGIN_NAMES = new String[]{
- "org.jnode.shell.command",
- "org.jnode.shell.command.driver.console",
- "org.jnode.apps.editor",
- "org.jnode.apps.edit",
- "org.jnode.apps.console",
- };
-
- /**
- * Initialize a minimal subset of JNode services to allow us to run JNode commands.
- *
- * @param root the notional JNode sandbox root directory or <code>null</code>.
- * @throws EmuException
- */
- public static void initEnv(File root) throws EmuException {
- if (true) {
- if (root == null) {
- root = new File("").getAbsoluteFile();
- System.err.println("Assuming that the JNode root is '" + root + "'");
- }
- InitialNaming.setNameSpace(new BasicNameSpace());
-
- try {
- InitialNaming.bind(DeviceManager.NAME, DeviceManager.INSTANCE);
- AliasManager aliasMgr =
- new DefaultAliasManager(new DummyExtensionPoint()).createAliasManager();
- SyntaxManager syntaxMgr =
- new DefaultSyntaxManager(new DummyExtensionPoint()).createSyntaxManager();
- for (String pluginName : PLUGIN_NAMES) {
- configurePluginCommands(root, pluginName, aliasMgr, syntaxMgr);
- }
- System.setProperty("jnode.invoker", "thread");
- System.setProperty("jnode.interpreter", "redirecting");
- System.setProperty("jnode.debug", "true");
- InitialNaming.bind(AliasManager.NAME, aliasMgr);
- InitialNaming.bind(ShellManager.NAME, new DefaultShellManager());
- InitialNaming.bind(SyntaxManager.NAME, syntaxMgr);
- InitialNaming.bind(HelpFactory.NAME, new DefaultHelpFactory());
- } catch (NamingException ex) {
- throw new EmuException("Problem setting up InitialNaming bindings", ex);
- }
- }
- }
-
- /**
- * Configure any command classes specified by a given plugin's descriptor
- *
- * @param root the root directory for the JNode sandbox.
- * @param pluginName the plugin to be processed
- * @param aliasMgr the alias manager to be populated
- * @param syntaxMgr the syntax manager to be populated
- * @throws EmuException
- */
- private static void configurePluginCommands(File root, String pluginName, AliasManager aliasMgr,
- SyntaxManager syntaxMgr) throws EmuException {
- XMLElement pluginDescriptor = loadPluginDescriptor(root, pluginName);
- extractAliases(pluginDescriptor, aliasMgr);
- extractSyntaxBundles(pluginDescriptor, syntaxMgr);
- }
-
- /**
- * Populate the supplied syntax manager with syntax entries from a plugin descriptor.
- *
- * @param pluginDescriptor the plugin descriptor's root XML element
- * @param syntaxMgr the syntax manager to be populated.
- * @throws EmuException
- */
- private static void extractSyntaxBundles(XMLElement pluginDescriptor, SyntaxManager syntaxMgr)
- throws EmuException {
- XMLElement syntaxesDescriptor = findExtension(pluginDescriptor, SyntaxManager.SYNTAXES_EP_NAME);
- if (syntaxesDescriptor == null) {
- return;
- }
- SyntaxSpecLoader loader = new SyntaxSpecLoader();
- for (XMLElement syntaxDescriptor : syntaxesDescriptor.getChildren()) {
- if (!syntaxDescriptor.getName().equals("syntax")) {
- continue;
- }
- SyntaxSpecAdapter adaptedElement = new XMLSyntaxSpecAdapter(syntaxDescriptor);
- try {
- SyntaxBundle bundle = loader.loadSyntax(adaptedElement);
- if (bundle != null) {
- syntaxMgr.add(bundle);
- }
- } catch (Exception ex) {
- throw new EmuException("problem in syntax", ex);
- }
- }
- }
-
- /**
- * Populate the supplied alias manager with aliases from a plugin descriptor.
- *
- * @param pluginDescriptor the plugin descriptor's root XML element
- * @param aliasMgr the alias manager to be populated.
- * @throws EmuException
- */
- private static void extractAliases(XMLElement pluginDescriptor, AliasManager aliasMgr) {
- XMLElement aliasesDescriptor = findExtension(pluginDescriptor, AliasManager.ALIASES_EP_NAME);
- if (aliasesDescriptor == null) {
- return;
- }
- for (XMLElement aliasDescriptor : aliasesDescriptor.getChildren()) {
- if (aliasDescriptor.getName().equals("alias")) {
- String alias = aliasDescriptor.getStringAttribute("name");
- String className = aliasDescriptor.getStringAttribute("class");
- aliasMgr.add(alias, className);
- }
- }
- }
-
- /**
- * Locate the descriptor for a given extension point.
- *
- * @param pluginDescriptor the plugin descriptor
- * @param epName the extension point's name
- * @return
- */
- private static XMLElement findExtension(XMLElement pluginDescriptor, String epName) {
- for (XMLElement child : pluginDescriptor.getChildren()) {
- if (child.getName().equals("extension") &&
- epName.equals(child.getStringAttribute("point"))) {
- return child;
- }
- }
- return null;
- }
-
- /**
- * Locate and load a plugin descriptor. We search the "descriptors" directory of
- * each of the projects listed in ALL_PROJECTS
- *
- * @param root the notional root directory for the user's JNode sandbox.
- * @param pluginName the name of the plugin we're trying to locate
- * @return the loaded plugin descriptor or <code>null</code>
- * @throws EmuException
- */
- private static XMLElement loadPluginDescriptor(File root, String pluginName)
- throws EmuException {
- File file = null;
- for (String projectName : ALL_PROJECTS) {
- file = new File(new File(new File(root, projectName), "descriptors"), pluginName + ".xml");
- if (file.exists()) {
- break;
- }
- }
- if (!file.exists()) {
- throw new EmuException("Cannot find plugin descriptor file for '" +
- pluginName + "': " + file.getAbsolutePath());
- }
- BufferedReader br = null;
- try {
- XMLElement elem = new XMLElement();
- br = new BufferedReader(new FileReader(file));
- elem.parseFromReader(br);
- if (!elem.getName().equals("plugin")) {
- throw new EmuException("File does not contain a 'plugin' descriptor: " + file);
- }
- return elem;
- } catch (IOException ex) {
- throw new EmuException("Problem reading / parsing plugin descriptor file " + file, ex);
- } finally {
- try {
- br.close();
- } catch (IOException ex) {
- // ignore
- }
- }
- }
-}
Deleted: trunk/distr/src/emu/org/jnode/emu/EmuException.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/EmuException.java 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/distr/src/emu/org/jnode/emu/EmuException.java 2009-01-18 13:23:15 UTC (rev 4887)
@@ -1,12 +0,0 @@
-package org.jnode.emu;
-
-public class EmuException extends Exception {
-
- public EmuException(String message) {
- super(message);
- }
-
- public EmuException(String message, Throwable cause) {
- super(message, cause);
- }
-}
Modified: trunk/shell/.classpath
===================================================================
--- trunk/shell/.classpath 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/shell/.classpath 2009-01-18 13:23:15 UTC (rev 4887)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/shell"/>
+ <classpathentry kind="src" path="src/emu"/>
<classpathentry kind="src" path="src/test"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
@@ -9,5 +10,6 @@
<classpathentry kind="lib" path="/JNode-Core/lib/ant-launcher.jar"/>
<classpathentry exported="true" kind="lib" path="lib/bsh-2.0b5.jar"/>
<classpathentry kind="lib" path="lib/rhino1.6r5-jsr223.jar"/>
+ <classpathentry kind="lib" path="/JNode-Builder/lib/nanoxml-2.2.3.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/shell/build.xml
===================================================================
--- trunk/shell/build.xml 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/shell/build.xml 2009-01-18 13:23:15 UTC (rev 4887)
@@ -28,6 +28,7 @@
<jnode.compile>
<src path="${my-src.dir}/shell"/>
<src path="${my-src.dir}/test"/>
+ <src path="${my-src.dir}/emu"/>
<classpath refid="my-cp"/>
</jnode.compile>
</target>
Modified: trunk/shell/descriptors/org.jnode.test.shell.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.test.shell.xml 2009-01-18 11:04:39 UTC (rev 4886)
+++ trunk/shell/descriptors/org.jnode.test.shell.xml 2009-01-18 13:23:15 UTC (rev 4887)
@@ -20,9 +20,13 @@
<runtime>
<library name="jnode-shell.jar">
<export name="org.jnode.test.shell.*"/>
+ <export name="org.jnode.test.shell.bjorne.*"/>
+ <export name="org.jnode.test.shell.harness.*"/>
<export name="org.jnode.test.shell.help.*"/>
+ <export name="org.jnode.test.shell.proclet.*"/>
+ <export name="org.jnode.test.shell.io.*"/>
+ <export name="org.jnode.test.shell.proclet.*"/>
<export name="org.jnode.test.shell.syntax.*"/>
- <export name="org.jnode.test.shell.proclet.*"/>
</library>
</runtime>
@@ -34,5 +38,6 @@
<extension point="org.jnode.security.permissions">
<permission class="java.lang.RuntimePermission" name="setIO"/>
+ <permission class="java.lang.RuntimePermission" name="exitVM"/>
</extension>
</plugin>
Added: trunk/shell/src/emu/org/jnode/emu/DeviceManager.java
===================================================================
--- trunk/shell/src/emu/org/jnode/emu/DeviceManager.java (rev 0)
+++ trunk/shell/src/emu/org/jnode/emu/DeviceManager.java 2009-01-18 13:23:15 UTC (rev 4887)
@@ -0,0 +1,105 @@
+/*
+ * $Id$
+ */
+package org.jnode.emu;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.log4j.Logger;
+import org.jnode.driver.AbstractDeviceManager;
+import org.jnode.driver.Device;
+import org.jnode.driver.DeviceFinder;
+import org.jnode.driver.DeviceToDriverMapper;
+import org.jnode.driver.DriverException;
+
+/**
+ * @author Levente S\u00e1ntha
+ */
+public class DeviceManager extends AbstractDeviceManager {
+ public static final Logger log = Logger.getLogger(DeviceManager.class);
+
+ public static final DeviceManager INSTANCE = new DeviceManager();
+
+ private List<DeviceFinder> finders = new ArrayList<DeviceFinder>();
+
+ private List<DeviceToDriverMapper> mappers = new ArrayList<DeviceToDriverMapper>();
+
+ private DeviceManager() {
+ }
+
+ public void removeAll() {
+ finders.clear();
+ mappers.clear();
+
+ for (Device device : getDevices()) {
+ try {
+ unregister(device);
+ } catch (DriverException e) {
+ log.error("can't unregister " + device);
+ }
+ }
+ }
+
+ public void add(DeviceFinder finder, DeviceToDriverMapper mapper) {
+ boolean doStart = false;
+
+ if (!finders.contains(finder)) {
+ finders.add(finder);
+ doStart = true;
+ }
+
+ if (!mappers.contains(mapper)) {
+ mappers.add(mapper);
+ doStart = true;
+ }
+
+ if (doStart) {
+ start();
+ }
+ }
+
+ /**
+ * Start this manager
+ */
+ public final void start() {
+ // Thread thread = new Thread()
+ // {
+ // public void run()
+ // {
+ log.debug("Loading extensions ...");
+ loadExtensions();
+ log.debug("Extensions loaded !");
+ // }
+ // };
+ // thread.start();
+
+ try {
+ // must be called before findDeviceDrivers
+ log.debug("findDevices ...");
+ findDevices();
+
+ log.debug("findDeviceDrivers ...");
+ findDeviceDrivers();
+
+ log.debug("StubDeviceManager initialized !");
+ } catch (InterruptedException e) {
+ log.fatal("can't find devices", e);
+ }
+ }
+
+ protected final void refreshFinders(List<DeviceFinder> finders) {
+ log.info("refreshFinders");
+ finders.clear();
+ finders.addAll(this.finders);
+ }
+
+ protected final void refreshMappers(List<DeviceToDriverMapper> mappers) {
+ log.info("refreshMappers");
+ mappers.clear();
+ mappers.addAll(this.mappers);
+
+ // Now sort them
+ Collections.sort(mappers, MapperComparator.INSTANCE);
+ }
+}
Added: trunk/shell/src/emu/org/jnode/emu/Emu.java
===================================================================
--- trunk/shell/src/emu/org/jnode/emu/Emu.java (rev 0)
+++ trunk/shell/src/emu/org/jnode/emu/Emu.java 2009-01-18 13:23:15 UTC (rev 4887)
@@ -0,0 +1,232 @@
+/*
+ * $Id: NameSpace.java 4564 2008-09-18 22:01:10Z fduminy $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+package org.jnode.emu;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+import javax.naming.NamingException;
+
+import org.jnode.emu.naming.BasicNameSpace;
+import org.jnode.emu.plugin.model.DummyExtensionPoint;
+import org.jnode.naming.InitialNaming;
+import org.jnode.nanoxml.XMLElement;
+import org.jnode.shell.ShellManager;
+import org.jnode.shell.alias.AliasManager;
+import org.jnode.shell.alias.def.DefaultAliasManager;
+import org.jnode.shell.def.DefaultShellManager;
+import org.jnode.shell.help.HelpFactory;
+import org.jnode.shell.help.def.DefaultHelpFactory;
+import org.jnode.shell.syntax.DefaultSyntaxManager;
+import org.jnode.shell.syntax.SyntaxBundle;
+import org.jnode.shell.syntax.SyntaxManager;
+import org.jnode.shell.syntax.SyntaxSpecAdapter;
+import org.jnode.shell.syntax.SyntaxSpecLoader;
+import org.jnode.shell.syntax.XMLSyntaxSpecAdapter;
+
+/**
+ * Emu is the core of a light-weight JNode emulator that allows (some) JNode
+ * applications to be run using a classic JVM in the context of a JNode development sandbox.
+ * <p>
+ * An Emu is also a large flightless bird ... which seems kind of appropriate.
+ *
+ * @author Levente S\u00e1ntha
+ * @author Stephen Crawley
+ */
+public abstract class Emu {
+ private static final String[] ALL_PROJECTS = new String[]{
+ "core", "distr", "fs", "gui", "net", "shell", "sound", "textui"
+ };
+
+ // FIXME configuring a hard-coded list of command plugins is a bad idea.
+ private static final String[] PLUGIN_NAMES = new String[]{
+ "org.jnode.shell.command",
+ "org.jnode.shell.command.posix",
+ "org.jnode.shell.command.driver.console",
+ "org.jnode.apps.editor",
+ "org.jnode.apps.edit",
+ "org.jnode.apps.console",
+ };
+
+ /**
+ * Initialize a minimal subset of JNode services to allow us to run JNode commands.
+ *
+ * @param root the notional JNode sandbox root directory or <code>null</code>.
+ * @throws EmuException
+ */
+ public static void initEnv(File root) throws EmuException {
+ if (true) {
+ if (root == null) {
+ root = new File("").getAbsoluteFile();
+ System.err.println("Assuming that the JNode root is '" + root + "'");
+ }
+ InitialNaming.setNameSpace(new BasicNameSpace());
+
+ try {
+ InitialNaming.bind(DeviceManager.NAME, DeviceManager.INSTANCE);
+ AliasManager aliasMgr =
+ new DefaultAliasManager(new DummyExtensionPoint()).createAliasManager();
+ SyntaxManager syntaxMgr =
+ new DefaultSyntaxManager(new DummyExtensionPoint()).createSyntaxManager();
+ for (String pluginName : PLUGIN_NAMES) {
+ configurePluginCommands(root, pluginName, aliasMgr, syntaxMgr);
+ }
+ System.setProperty("jnode.invoker", "thread");
+ System.setProperty("jnode.interpreter", "redirecting");
+ System.setProperty("jnode.debug", "true");
+ InitialNaming.bind(AliasManager.NAME, aliasMgr);
+ InitialNaming.bind(ShellManager.NAME, new DefaultShellManager());
+ InitialNaming.bind(SyntaxManager.NAME, syntaxMgr);
+ InitialNaming.bind(HelpFactory.NAME, new DefaultHelpFactory());
+ } catch (NamingException ex) {
+ throw new EmuException("Problem setting up InitialNaming bindings", ex);
+ }
+ }
+ }
+
+ /**
+ * Configure any command classes specified by a given plugin's descriptor
+ *
+ * @param root the root directory for the JNode sandbox.
+ * @param pluginName the plugin to be processed
+ * @param aliasMgr the alias manager to be populated
+ * @param syntaxMgr the syntax manager to be populated
+ * @throws EmuException
+ */
+ private static void configurePluginCommands(File root, String pluginName, AliasManager aliasMgr,
+ SyntaxManager syntaxMgr) throws EmuException {
+ XMLElement pluginDescriptor = loadPluginDescriptor(root, pluginName);
+ extractAliases(pluginDescriptor, aliasMgr);
+ extractSyntaxBundles(pluginDescriptor, syntaxMgr);
+ }
+
+ /**
+ * Populate the supplied syntax manager with syntax entries from a plugin descriptor.
+ *
+ * @param pluginDescriptor the plugin descriptor's root XML element
+ * @param syntaxMgr the syntax manager to be populated.
+ * @throws EmuException
+ */
+ private static void extractSyntaxBundles(XMLElement pluginDescriptor, SyntaxManager syntaxMgr)
+ throws EmuException {
+ XMLElement syntaxesDescriptor = findExtension(pluginDescriptor, SyntaxManager.SYNTAXES_EP_NAME);
+ if (syntaxesDescriptor == null) {
+ return;
+ }
+ SyntaxSpecLoader loader = new SyntaxSpecLoader();
+ for (XMLElement syntaxDescriptor : syntaxesDescriptor.getChildren()) {
+ if (!syntaxDescriptor.getName().equals("syntax")) {
+ continue;
+ }
+ SyntaxSpecAdapter adaptedElement = new XMLSyntaxSpecAdapter(syntaxDescriptor);
+ try {
+ SyntaxBundle bundle = loader.loadSyntax(adaptedElement);
+ if (bundle != null) {
+ syntaxMgr.add(bundle);
+ }
+ } catch (Exception ex) {
+ throw new EmuException("problem in syntax", ex);
+ }
+ }
+ }
+
+ /**
+ * Populate the supplied alias manager with aliases from a plugin descriptor.
+ *
+ * @param pluginDescriptor the plugin descriptor's root XML element
+ * @param aliasMgr the alias manager to be populated.
+ * @throws EmuException
+ */
+ private static void extractAliases(XMLElement pluginDescriptor, AliasManager aliasMgr) {
+ XMLElement aliasesDescriptor = findExtension(pluginDescriptor, AliasManager.ALIASES_EP_NAME);
+ if (aliasesDescriptor == null) {
+ return;
+ }
+ for (XMLElement aliasDescriptor : aliasesDescriptor.getChildren()) {
+ if (aliasDescriptor.getName().equals("alias")) {
+ String alias = aliasDescriptor.getStringAttribute("name");
+ String className = aliasDescriptor.getStringAttribute("class");
+ aliasMgr.add(alias, className);
+ }
+ }
+ }
+
+ /**
+ * Locate the descriptor for a given extension point.
+ *
+ * @param pluginDescriptor the plugin descriptor
+ * @param epName the extension point's name
+ * @return
+ */
+ private static XMLElement findExtension(XMLElement pluginDescriptor, String epName) {
+ for (XMLElement child : pluginDescriptor.getChildren()) {
+ if (child.getName().equals("extension") &&
+ epName.equals(child.getStringAttribute("point"))) {
+ return child;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Locate and load a plugin descriptor. We search the "descriptors" directory of
+ * each of the projects listed in ALL_PROJECTS
+ *
+ * @param root the notional root directory for the user's JNode sandbox.
+ * @param pluginName the name of the plugin we're trying to locate
+ * @return the loaded plugin descriptor or <code>null</code>
+ * @throws EmuException
+ */
+ private static XMLElement loadPluginDescriptor(File root, String pluginName)
+ throws EmuException {
+ File file = null;
+ for (String projectName : ALL_PROJECTS) {
+ file = new File(new File(new File(root, projectName), "descriptors"), pluginName + ".xml");
+ if (file.exists()) {
+ break;
+ }
+ }
+ if (!file.exists()) {
+ throw new EmuException("Cannot find plugin descriptor file for '" +
+ pluginName + "': " + file.getAbsolutePath());
+ }
+ BufferedReader br = null;
+ try {
+ XMLElement elem = new XMLElement();
+ ...
[truncated message content] |
|
From: <cr...@us...> - 2009-01-21 13:33:57
|
Revision: 4898
http://jnode.svn.sourceforge.net/jnode/?rev=4898&view=rev
Author: crawley
Date: 2009-01-21 13:33:53 +0000 (Wed, 21 Jan 2009)
Log Message:
-----------
Tidy up CommandShell's resource script execution + de-static'd Emu and friends.
Modified Paths:
--------------
trunk/distr/src/emu/org/jnode/emu/EditEmu.java
trunk/distr/src/emu/org/jnode/emu/ShellEmu.java
trunk/shell/src/emu/org/jnode/emu/Emu.java
trunk/shell/src/shell/org/jnode/shell/CommandShell.java
Modified: trunk/distr/src/emu/org/jnode/emu/EditEmu.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/EditEmu.java 2009-01-21 13:32:57 UTC (rev 4897)
+++ trunk/distr/src/emu/org/jnode/emu/EditEmu.java 2009-01-21 13:33:53 UTC (rev 4898)
@@ -10,14 +10,21 @@
* @author Levente S\u00e1ntha
*/
public class EditEmu extends Emu {
+
+ public EditEmu(File root) throws EmuException {
+ super(root);
+ }
+
public static void main(String[] argv) throws Exception {
if (argv.length == 0 || argv[0].startsWith("-")) {
System.err.println("Usage: editEmu <file> [<jnode-home>]");
return;
}
- initEnv(argv.length > 1 ? new File(argv[1]) : null);
-
+ new EditEmu(argv.length > 1 ? new File(argv[1]) : null).run(new File(argv[0]));
+ }
+
+ private void run(File file) throws Exception {
SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager();
final TextScreenConsole console = cm.createConsole(
null,
@@ -26,7 +33,6 @@
ConsoleManager.CreateOptions.NO_LINE_EDITTING));
TextEditor te = new TextEditor(console);
- File f = new File(argv[0]);
- te.loadFile(f);
+ te.loadFile(file);
}
}
Modified: trunk/distr/src/emu/org/jnode/emu/ShellEmu.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/ShellEmu.java 2009-01-21 13:32:57 UTC (rev 4897)
+++ trunk/distr/src/emu/org/jnode/emu/ShellEmu.java 2009-01-21 13:33:53 UTC (rev 4898)
@@ -11,13 +11,20 @@
* @author Levente S\u00e1ntha
*/
public class ShellEmu extends Emu {
+
+ public ShellEmu(File root) throws EmuException {
+ super(root);
+ }
public static void main(String[] argv) throws Exception {
if (argv.length > 0 && argv[0].startsWith("-")) {
System.err.println("Usage: shellemu [<jnode-home>]");
return;
}
- initEnv(argv.length > 0 ? new File(argv[0]) : null);
+ new ShellEmu(argv.length > 0 ? new File(argv[0]) : null).run();
+ }
+
+ private void run() throws Exception {
TextScreenConsoleManager cm = new SwingTextScreenConsoleManager();
new Thread(new CommandShell(cm.createConsole(
"Console 1",
Modified: trunk/shell/src/emu/org/jnode/emu/Emu.java
===================================================================
--- trunk/shell/src/emu/org/jnode/emu/Emu.java 2009-01-21 13:32:57 UTC (rev 4897)
+++ trunk/shell/src/emu/org/jnode/emu/Emu.java 2009-01-21 13:33:53 UTC (rev 4898)
@@ -59,7 +59,7 @@
};
// FIXME configuring a hard-coded list of command plugins is a bad idea.
- private static final String[] PLUGIN_NAMES = new String[]{
+ private static final String[] PLUGIN_NAMES = new String[] {
"org.jnode.shell.command",
"org.jnode.shell.command.posix",
"org.jnode.shell.command.driver.console",
@@ -69,38 +69,36 @@
};
/**
- * Initialize a minimal subset of JNode services to allow us to run JNode commands.
+ * The constructor initializes a minimal subset of JNode services to allow us to run JNode commands.
*
* @param root the notional JNode sandbox root directory or <code>null</code>.
* @throws EmuException
*/
- public static void initEnv(File root) throws EmuException {
- if (true) {
- if (root == null) {
- root = new File("").getAbsoluteFile();
- System.err.println("Assuming that the JNode root is '" + root + "'");
- }
- InitialNaming.setNameSpace(new BasicNameSpace());
+ public Emu(File root) throws EmuException {
+ if (root == null) {
+ root = new File("").getAbsoluteFile();
+ System.err.println("Assuming that the JNode root is '" + root + "'");
+ }
+ InitialNaming.setNameSpace(new BasicNameSpace());
- try {
- InitialNaming.bind(DeviceManager.NAME, DeviceManager.INSTANCE);
- AliasManager aliasMgr =
- new DefaultAliasManager(new DummyExtensionPoint()).createAliasManager();
- SyntaxManager syntaxMgr =
- new DefaultSyntaxManager(new DummyExtensionPoint()).createSyntaxManager();
- for (String pluginName : PLUGIN_NAMES) {
- configurePluginCommands(root, pluginName, aliasMgr, syntaxMgr);
- }
- System.setProperty("jnode.invoker", "thread");
- System.setProperty("jnode.interpreter", "redirecting");
- System.setProperty("jnode.debug", "true");
- InitialNaming.bind(AliasManager.NAME, aliasMgr);
- InitialNaming.bind(ShellManager.NAME, new DefaultShellManager());
- InitialNaming.bind(SyntaxManager.NAME, syntaxMgr);
- InitialNaming.bind(HelpFactory.NAME, new DefaultHelpFactory());
- } catch (NamingException ex) {
- throw new EmuException("Problem setting up InitialNaming bindings", ex);
+ try {
+ InitialNaming.bind(DeviceManager.NAME, DeviceManager.INSTANCE);
+ AliasManager aliasMgr =
+ new DefaultAliasManager(new DummyExtensionPoint()).createAliasManager();
+ SyntaxManager syntaxMgr =
+ new DefaultSyntaxManager(new DummyExtensionPoint()).createSyntaxManager();
+ for (String pluginName : PLUGIN_NAMES) {
+ configurePluginCommands(root, pluginName, aliasMgr, syntaxMgr);
}
+ System.setProperty("jnode.invoker", "thread");
+ System.setProperty("jnode.interpreter", "redirecting");
+ System.setProperty("jnode.debug", "true");
+ InitialNaming.bind(AliasManager.NAME, aliasMgr);
+ InitialNaming.bind(ShellManager.NAME, new DefaultShellManager());
+ InitialNaming.bind(SyntaxManager.NAME, syntaxMgr);
+ InitialNaming.bind(HelpFactory.NAME, new DefaultHelpFactory());
+ } catch (NamingException ex) {
+ throw new EmuException("Problem setting up InitialNaming bindings", ex);
}
}
@@ -113,7 +111,7 @@
* @param syntaxMgr the syntax manager to be populated
* @throws EmuException
*/
- private static void configurePluginCommands(File root, String pluginName, AliasManager aliasMgr,
+ private void configurePluginCommands(File root, String pluginName, AliasManager aliasMgr,
SyntaxManager syntaxMgr) throws EmuException {
XMLElement pluginDescriptor = loadPluginDescriptor(root, pluginName);
extractAliases(pluginDescriptor, aliasMgr);
@@ -127,7 +125,7 @@
* @param syntaxMgr the syntax manager to be populated.
* @throws EmuException
*/
- private static void extractSyntaxBundles(XMLElement pluginDescriptor, SyntaxManager syntaxMgr)
+ private void extractSyntaxBundles(XMLElement pluginDescriptor, SyntaxManager syntaxMgr)
throws EmuException {
XMLElement syntaxesDescriptor = findExtension(pluginDescriptor, SyntaxManager.SYNTAXES_EP_NAME);
if (syntaxesDescriptor == null) {
@@ -157,7 +155,7 @@
* @param aliasMgr the alias manager to be populated.
* @throws EmuException
*/
- private static void extractAliases(XMLElement pluginDescriptor, AliasManager aliasMgr) {
+ private void extractAliases(XMLElement pluginDescriptor, AliasManager aliasMgr) {
XMLElement aliasesDescriptor = findExtension(pluginDescriptor, AliasManager.ALIASES_EP_NAME);
if (aliasesDescriptor == null) {
return;
@@ -178,7 +176,7 @@
* @param epName the extension point's name
* @return
*/
- private static XMLElement findExtension(XMLElement pluginDescriptor, String epName) {
+ private XMLElement findExtension(XMLElement pluginDescriptor, String epName) {
for (XMLElement child : pluginDescriptor.getChildren()) {
if (child.getName().equals("extension") &&
epName.equals(child.getStringAttribute("point"))) {
@@ -197,7 +195,7 @@
* @return the loaded plugin descriptor or <code>null</code>
* @throws EmuException
*/
- private static XMLElement loadPluginDescriptor(File root, String pluginName)
+ private XMLElement loadPluginDescriptor(File root, String pluginName)
throws EmuException {
File file = null;
for (String projectName : ALL_PROJECTS) {
Modified: trunk/shell/src/shell/org/jnode/shell/CommandShell.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-01-21 13:32:57 UTC (rev 4897)
+++ trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-01-21 13:33:53 UTC (rev 4898)
@@ -267,31 +267,9 @@
// Here, we are running in the CommandShell (main) Thread
// so, we can register ourself as the current shell
// (it will also be the current shell for all children Thread)
+
+ configureShell();
- // FIXME - At one point, the 'current shell' had something to do with
- // dispatching keyboard input to the right application. Now this is
- // handled by the console layer. Is 'current shell' a meaningful /
- // useful concept anymore?
- try {
- ShellUtils.getShellManager().registerShell(this);
-
- ShellUtils.registerCommandInvoker(DefaultCommandInvoker.FACTORY);
- ShellUtils.registerCommandInvoker(ThreadCommandInvoker.FACTORY);
- ShellUtils.registerCommandInvoker(ProcletCommandInvoker.FACTORY);
- ShellUtils.registerCommandInvoker(IsolateCommandInvoker.FACTORY);
- ShellUtils.registerCommandInterpreter(DefaultInterpreter.FACTORY);
- ShellUtils
- .registerCommandInterpreter(RedirectingInterpreter.FACTORY);
- } catch (NameNotFoundException e1) {
- e1.printStackTrace();
- }
-
- // Configure the shell based on Syetsm properties.
- setupFromProperties();
-
- // Now become interactive
- ownThread = Thread.currentThread();
-
// Run commands from the JNode command line first
final String cmdLine = System.getProperty(CMDLINE_PROPERTY_NAME, "");
final StringTokenizer tok = new StringTokenizer(cmdLine);
@@ -320,7 +298,7 @@
try {
if (jnode_ini.exists()) {
runCommandFile(jnode_ini);
- } else {
+ } else if (getClass().getResource(name) != null) {
runCommandResource(name);
}
} catch (ShellException ex) {
@@ -340,7 +318,7 @@
try {
if (shell_ini.exists()) {
runCommandFile(shell_ini);
- } else {
+ } else if (getClass().getResource(name) != null) {
runCommandResource(name);
}
} catch (ShellException ex) {
@@ -374,6 +352,28 @@
}
}
+ public void configureShell() {
+ try {
+ ShellUtils.getShellManager().registerShell(this);
+
+ ShellUtils.registerCommandInvoker(DefaultCommandInvoker.FACTORY);
+ ShellUtils.registerCommandInvoker(ThreadCommandInvoker.FACTORY);
+ ShellUtils.registerCommandInvoker(ProcletCommandInvoker.FACTORY);
+ ShellUtils.registerCommandInvoker(IsolateCommandInvoker.FACTORY);
+ ShellUtils.registerCommandInterpreter(DefaultInterpreter.FACTORY);
+ ShellUtils
+ .registerCommandInterpreter(RedirectingInterpreter.FACTORY);
+ } catch (NameNotFoundException e1) {
+ e1.printStackTrace();
+ }
+
+ // Configure the shell based on System properties.
+ setupFromProperties();
+
+ // Now become interactive
+ ownThread = Thread.currentThread();
+ }
+
private void setupFromProperties() {
debugEnabled = Boolean.parseBoolean(System.getProperty(
DEBUG_PROPERTY_NAME, DEBUG_DEFAULT));
@@ -819,8 +819,7 @@
boolean enabled = setHistoryEnabled(false);
try {
CommandInterpreter interpreter = createInterpreter(new FileReader(file));
- // FIXME throw ShellException if interpreter not found
- return (interpreter == null) ? -1 : interpreter.interpret(this, file);
+ return interpreter.interpret(this, file);
} catch (IOException ex) {
throw new ShellException("Cannot open command file: " + ex.getMessage(), ex);
} finally {
@@ -835,15 +834,11 @@
// FIXME throw ShellException if resource or interpreter not found
InputStream input = getClass().getResourceAsStream(resource);
if (input == null) {
- result = -1; // resource doesn't exist
+ throw new ShellException("Cannot find resource '" + resource + "'");
} else {
CommandInterpreter interpreter = createInterpreter(new InputStreamReader(input));
- if (interpreter == null) {
- result = -1; // no interpreter !
- } else {
- Reader reader = new InputStreamReader(getClass().getResourceAsStream(resource));
- result = interpreter.interpret(this, reader);
- }
+ Reader reader = new InputStreamReader(getClass().getResourceAsStream(resource));
+ result = interpreter.interpret(this, reader);
}
return result;
} finally {
@@ -856,11 +851,13 @@
final BufferedReader br = new BufferedReader(reader);
CommandInterpreter interpreter;
String line = br.readLine();
- if (line == null) {
- interpreter = null; // stream is empty
- } else if (line.startsWith("#!")) {
+ if (line != null && line.startsWith("#!")) {
String name = line.substring(2);
interpreter = ShellUtils.createInterpreter(name);
+ if (interpreter == null) {
+ throw new ShellException("Cannot execute script: no '" +
+ name + "' interpreter is registered");
+ }
} else {
interpreter = this.interpreter;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-01-21 14:11:59
|
Revision: 4901
http://jnode.svn.sourceforge.net/jnode/?rev=4901&view=rev
Author: crawley
Date: 2009-01-21 14:11:55 +0000 (Wed, 21 Jan 2009)
Log Message:
-----------
Tweaking a couple of @author tags
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
trunk/shell/src/shell/org/jnode/shell/io/NullInputStream.java
Modified: trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2009-01-21 13:34:29 UTC (rev 4900)
+++ trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2009-01-21 14:11:55 UTC (rev 4901)
@@ -46,7 +46,7 @@
*
* @author epr
* @author Andreas H\u00e4nel
- * @author Stephen Crawley
+ * @author cr...@jn...
* @author Fabien DUMINY (fd...@jn...)
*/
public class CatCommand extends AbstractCommand {
Modified: trunk/shell/src/shell/org/jnode/shell/io/NullInputStream.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/io/NullInputStream.java 2009-01-21 13:34:29 UTC (rev 4900)
+++ trunk/shell/src/shell/org/jnode/shell/io/NullInputStream.java 2009-01-21 14:11:55 UTC (rev 4901)
@@ -27,7 +27,7 @@
* A NullInputStream instance is the logical equivalent of "/dev/null". Calling
* a read method returns -1 to indicate EOF.
*
- * @author Stephen Crawley
+ * @author cr...@jn...
*/
public class NullInputStream extends InputStream {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-01-24 02:22:13
|
Revision: 4904
http://jnode.svn.sourceforge.net/jnode/?rev=4904&view=rev
Author: crawley
Date: 2009-01-24 02:16:41 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
Some incremental tidyups for the CommandShell and Shell APIs.
Modified Paths:
--------------
trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java
trunk/shell/src/shell/org/jnode/shell/CommandLine.java
trunk/shell/src/shell/org/jnode/shell/CommandShell.java
trunk/shell/src/shell/org/jnode/shell/Shell.java
trunk/shell/src/shell/org/jnode/shell/command/HelpCommand.java
Modified: trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java 2009-01-24 01:56:00 UTC (rev 4903)
+++ trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java 2009-01-24 02:16:41 UTC (rev 4904)
@@ -420,7 +420,7 @@
if (shell instanceof CommandShell) {
CommandShell cs = (CommandShell) shell;
try {
- cs.invokeCommand(command);
+ cs.runCommand(command);
} catch (ShellException ex) {
System.err.println("Command invocation failed: " + ex.getMessage());
}
Modified: trunk/shell/src/shell/org/jnode/shell/CommandLine.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandLine.java 2009-01-24 01:56:00 UTC (rev 4903)
+++ trunk/shell/src/shell/org/jnode/shell/CommandLine.java 2009-01-24 02:16:41 UTC (rev 4904)
@@ -573,7 +573,7 @@
* @throws CommandSyntaxException if the chosen syntax doesn't match the command
* line arguments.
*/
- public CommandInfo parseCommandLine(CommandShell shell) throws ShellException {
+ public CommandInfo parseCommandLine(Shell shell) throws ShellException {
String cmd = (commandToken == null) ? "" : commandToken.text.trim();
if (cmd.equals("")) {
throw new ShellFailureException("no command name");
@@ -595,8 +595,6 @@
bundle.parse(this, syntaxes);
}
return cmdInfo;
- } catch (ClassNotFoundException ex) {
- throw new ShellException("Command class not found", ex);
} catch (InstantiationException ex) {
throw new ShellException("Command class cannot be instantiated", ex);
} catch (IllegalAccessException ex) {
@@ -610,8 +608,8 @@
CommandInfo cmdClass;
try {
cmdClass = shell.getCommandInfo(cmd);
- } catch (ClassNotFoundException ex) {
- throw new CompletionException("Command class not found", ex);
+ } catch (ShellException ex) {
+ throw new CompletionException(ex.getMessage(), ex);
}
Command command;
@@ -652,15 +650,11 @@
}
}
- public CommandInfo getCommandInfo(CommandShell shell) {
+ public CommandInfo getCommandInfo(CommandShell shell) throws ShellException {
String cmd = (commandToken == null) ? "" : commandToken.text.trim();
if (cmd.equals("")) {
return null;
}
- try {
- return shell.getCommandInfo(cmd);
- } catch (ClassNotFoundException ex) {
- return null;
- }
+ return shell.getCommandInfo(cmd);
}
}
Modified: trunk/shell/src/shell/org/jnode/shell/CommandShell.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-01-24 01:56:00 UTC (rev 4903)
+++ trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-01-24 02:16:41 UTC (rev 4904)
@@ -280,7 +280,7 @@
if (e.startsWith(COMMAND_KEY)) {
final String cmd = e.substring(COMMAND_KEY.length());
outPW.println(prompt() + cmd);
- processCommand(cmd, false);
+ runCommand(cmd, false, this.interpreter);
}
} catch (Throwable ex) {
errPW.println("Error while processing bootarg commands: "
@@ -338,7 +338,7 @@
readingCommand = true;
String line = readInputLine().trim();
if (line.length() > 0) {
- processCommand(line, true);
+ runCommand(line, true, this.interpreter);
}
if (VmSystem.isShuttingDown()) {
@@ -464,12 +464,8 @@
((KeyboardReader) in).clearSoftEOF();
}
}
-
- protected int processCommand(String cmdLineStr, boolean interactive) {
- return processCommand(cmdLineStr, interactive, this.interpreter);
- }
- private int processCommand(String cmdLineStr, boolean interactive,
+ private int runCommand(String cmdLineStr, boolean interactive,
CommandInterpreter interpreter) {
if (interactive) {
clearEof();
@@ -536,8 +532,8 @@
* @param command the command line.
* @throws ShellException
*/
- public int invokeCommand(String command) throws ShellException {
- return processCommand(command, false);
+ public int runCommand(String command) throws ShellException {
+ return runCommand(command, false, this.interpreter);
}
/**
@@ -567,14 +563,20 @@
return this.invoker.invokeAsynchronous(cmdLine, cmdInfo);
}
- public CommandInfo getCommandInfo(String cmd) throws ClassNotFoundException {
+ public CommandInfo getCommandInfo(String cmd) throws ShellException {
try {
Class<?> cls = aliasMgr.getAliasClass(cmd);
return new CommandInfo(cls, aliasMgr.isInternal(cmd));
+ } catch (ClassNotFoundException ex) {
+ throw new ShellException("Cannot the load command class for alias '" + cmd + "'", ex);
} catch (NoSuchAliasException ex) {
- final ClassLoader cl =
- Thread.currentThread().getContextClassLoader();
- return new CommandInfo(cl.loadClass(cmd), false);
+ try {
+ final ClassLoader cl =
+ Thread.currentThread().getContextClassLoader();
+ return new CommandInfo(cl.loadClass(cmd), false);
+ } catch (ClassNotFoundException ex2) {
+ throw new ShellException("Cannot find an alias or load a command class for '" + cmd + "'", ex);
+ }
}
}
Modified: trunk/shell/src/shell/org/jnode/shell/Shell.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/Shell.java 2009-01-24 01:56:00 UTC (rev 4903)
+++ trunk/shell/src/shell/org/jnode/shell/Shell.java 2009-01-24 02:16:41 UTC (rev 4904)
@@ -75,4 +75,14 @@
*/
public int runCommandFile(File file) throws ShellException;
+ /**
+ * Resolve a command name to a CommandInfo object.
+ *
+ * @param commmandName this could be a command class name, an alias or some other
+ * supported by the shell.
+ * @return the resolved CommandInfo or <code>null</code>.
+ * @throws ShellException
+ */
+ public CommandInfo getCommandInfo(String commmandName) throws ShellException;
+
}
Modified: trunk/shell/src/shell/org/jnode/shell/command/HelpCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/HelpCommand.java 2009-01-24 01:56:00 UTC (rev 4903)
+++ trunk/shell/src/shell/org/jnode/shell/command/HelpCommand.java 2009-01-24 02:16:41 UTC (rev 4904)
@@ -29,6 +29,7 @@
import org.jnode.shell.CommandInfo;
import org.jnode.shell.CommandLine;
import org.jnode.shell.CommandShell;
+import org.jnode.shell.ShellException;
import org.jnode.shell.ShellUtils;
import org.jnode.shell.alias.AliasManager;
import org.jnode.shell.alias.NoSuchAliasException;
@@ -58,8 +59,7 @@
}
@Override
- public void execute() throws NameNotFoundException, ClassNotFoundException,
- HelpException, NoSuchAliasException {
+ public void execute() throws NameNotFoundException, ShellException, HelpException {
// The above exceptions are either bugs or configuration errors and should be allowed
// to propagate so that the shell can diagnose them appropriately.
String alias;
@@ -87,13 +87,8 @@
} catch (HelpException ex) {
err.println("Error getting help for alias / class '" + alias + "': " + ex.getMessage());
throw ex;
- } catch (ClassNotFoundException ex) {
- try {
- String className = shell.getAliasManager().getAliasClassName(alias);
- err.println("Cannot load class '" + className + "' for alias '" + alias + "'");
- } catch (NoSuchAliasException ex2) {
- err.println("'" + alias + "' is neither an alias or a loadable class name");
- }
+ } catch (ShellException ex) {
+ err.println(ex.getMessage());
throw ex;
} catch (SecurityException ex) {
err.println("Security exception while loading the class associated with alias '" + alias + "'");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-01-26 06:47:47
|
Revision: 4909
http://jnode.svn.sourceforge.net/jnode/?rev=4909&view=rev
Author: crawley
Date: 2009-01-26 06:47:42 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
Explicitly exclude '.svn' directories to stop Eclipse warnings about
duplicate resources. (This may be redundant if you are using an SVN plugin.)
Modified Paths:
--------------
trunk/builder/.classpath
trunk/core/.classpath
trunk/distr/.classpath
trunk/fs/.classpath
trunk/gui/.classpath
trunk/net/.classpath
trunk/shell/.classpath
Modified: trunk/builder/.classpath
===================================================================
--- trunk/builder/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/builder/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/builder"/>
- <classpathentry kind="src" path="src/configure"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/builder"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/configure"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="src" path="/JNode-FS"/>
<classpathentry kind="lib" path="/JNode-Core/lib/ant.jar"/>
Modified: trunk/core/.classpath
===================================================================
--- trunk/core/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/core/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/openjdk/vm"/>
- <classpathentry kind="src" path="src/emu"/>
- <classpathentry kind="src" path="src/endorsed/nanoxml"/>
- <classpathentry excluding="**/*-template.java" kind="src" path="src/openjdk/sun"/>
- <classpathentry kind="src" path="src/openjdk/org"/>
- <classpathentry excluding="**/*-template.java" kind="src" path="src/openjdk/com"/>
- <classpathentry kind="src" path="src/icedtea"/>
- <classpathentry kind="src" path="src/classpath/gnu"/>
- <classpathentry kind="src" path="src/openjdk/java"/>
- <classpathentry kind="src" path="src/openjdk/javax"/>
- <classpathentry kind="src" path="src/classpath/tools"/>
- <classpathentry kind="src" path="src/classpath/java"/>
- <classpathentry kind="src" path="src/classpath/javax"/>
- <classpathentry kind="src" path="src/classpath/ext"/>
- <classpathentry kind="src" path="src/classpath/vm"/>
- <classpathentry kind="src" path="src/core"/>
- <classpathentry kind="src" path="src/vmmagic"/>
- <classpathentry kind="src" path="src/mmtk-vm"/>
- <classpathentry kind="src" path="src/driver"/>
- <classpathentry kind="src" path="src/test"/>
- <classpathentry kind="src" path="src/template"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/openjdk/vm"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/emu"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/endorsed/nanoxml"/>
+ <classpathentry excluding="**/*-template.java|**/.svn/**" kind="src" path="src/openjdk/sun"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/openjdk/org"/>
+ <classpathentry excluding="**/*-template.java|**/.svn/**" kind="src" path="src/openjdk/com"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/icedtea"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/gnu"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/openjdk/java"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/openjdk/javax"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/tools"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/java"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/javax"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/ext"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/classpath/vm"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/core"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/vmmagic"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/mmtk-vm"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/template"/>
<classpathentry kind="lib" path="lib/ant.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="lib/junit.jar"/>
Modified: trunk/distr/.classpath
===================================================================
--- trunk/distr/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/distr/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/install"/>
- <classpathentry kind="src" path="src/emu"/>
- <classpathentry kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/install"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/emu"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
<classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="src" path="src/apps"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/apps"/>
<classpathentry kind="src" path="/JNode-GUI"/>
<classpathentry kind="lib" path="lib/telnetd.jar"/>
<classpathentry kind="lib" path="lib/jetty-6.1.5.jar"/>
Modified: trunk/fs/.classpath
===================================================================
--- trunk/fs/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/fs/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/fs"/>
- <classpathentry kind="src" path="src/driver"/>
- <classpathentry kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/fs"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="src" path="/JNode-Shell"/>
Modified: trunk/gui/.classpath
===================================================================
--- trunk/gui/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/gui/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/awt"/>
- <classpathentry kind="src" path="src/font"/>
- <classpathentry kind="src" path="src/desktop"/>
- <classpathentry kind="src" path="src/driver"/>
- <classpathentry kind="src" path="src/test"/>
- <classpathentry kind="src" path="src/thinlet"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/awt"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/font"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/desktop"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/thinlet"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="src" path="/JNode-Shell"/>
Modified: trunk/net/.classpath
===================================================================
--- trunk/net/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/net/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/net"/>
- <classpathentry kind="src" path="src/driver"/>
- <classpathentry kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/net"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="lib/oncrpc.jar"/>
Modified: trunk/shell/.classpath
===================================================================
--- trunk/shell/.classpath 2009-01-25 01:04:36 UTC (rev 4908)
+++ trunk/shell/.classpath 2009-01-26 06:47:42 UTC (rev 4909)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/shell"/>
- <classpathentry kind="src" path="src/emu"/>
- <classpathentry kind="src" path="src/test"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/shell"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/emu"/>
+ <classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
<classpathentry kind="src" path="/JNode-Core"/>
<classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="/JNode-Core/lib/junit.jar"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-01-31 09:52:57
|
Revision: 4932
http://jnode.svn.sourceforge.net/jnode/?rev=4932&view=rev
Author: lsantha
Date: 2009-01-31 09:52:51 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Fixed code style.
Modified Paths:
--------------
trunk/core/src/test/org/jtestserver/tests/TestVMware.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNodeRecord.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/LeafRecord.java
trunk/shell/src/test/org/jnode/test/shell/harness/ClassTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/CommandTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/PluginSpecification.java
trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestCommandShell.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestHarness.java
trunk/shell/src/test/org/jnode/test/shell/harness/TextContent.java
Modified: trunk/core/src/test/org/jtestserver/tests/TestVMware.java
===================================================================
--- trunk/core/src/test/org/jtestserver/tests/TestVMware.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/core/src/test/org/jtestserver/tests/TestVMware.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -28,7 +28,6 @@
import org.jtestserver.client.process.vmware.VMware;
import org.jtestserver.client.process.vmware.VMwareConfig;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
public class TestVMware extends TestVmManager {
@@ -36,12 +35,12 @@
public void setUp() throws IOException {
Config config = new CustomConfigReader(ConfigReader.VMWARE_TYPE).readConfig();
VMwareConfig vmwareConfig = (VMwareConfig) config.getVMConfig();
-
+
vmManager = new VMware(vmwareConfig);
- vmName = vmwareConfig.getVmName();
+ vmName = vmwareConfig.getVmName();
}
-
- @Test(expected = IOException.class)
+
+ @Test(expected = IOException.class)
public void testGetRunningVMsWithWrongAuthentification() throws IOException {
CustomConfigReader reader = new CustomConfigReader(ConfigReader.VMWARE_TYPE) {
@Override
@@ -49,14 +48,14 @@
throws IOException {
vmProperties.put(VMwareConfig.USERNAME, "anObviouslyWrongLogin");
vmProperties.put(VMwareConfig.PASSWORD, "ThisIsNotAValidPassword");
-
+
return super.createVMConfig(vmProperties, vm);
}
};
-
+
Config config = reader.readConfig();
VMwareConfig vmwareConfig = (VMwareConfig) config.getVMConfig();
-
+
VMware vmware = new VMware(vmwareConfig);
vmware.getRunningVMs();
}
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -16,16 +16,19 @@
import org.jnode.fs.hfsplus.tree.IndexRecord;
import org.jnode.fs.hfsplus.tree.LeafRecord;
import org.jnode.fs.hfsplus.tree.NodeDescriptor;
-import org.jnode.fs.hfsplus.tree.NodeRecord;
import org.jnode.util.ByteBufferUtils;
public class Catalog {
-
+
private final Logger log = Logger.getLogger(getClass());
private HfsPlusFileSystem fs;
- /** B-Tree node descriptor */
+ /**
+ * B-Tree node descriptor
+ */
private NodeDescriptor btnd;
- /** B-Tree Header record */
+ /**
+ * B-Tree Header record
+ */
private BTHeaderRecord bthr;
/** */
private int catalogHeaderNodeOffset;
@@ -34,9 +37,8 @@
/**
* Create Catalog based on meta-data that exist on the file system.
- *
+ *
* @param fs HFS+ file system that contains catalog informations.
- *
* @throws IOException
*/
public Catalog(final HfsPlusFileSystem fs) throws IOException {
@@ -46,27 +48,27 @@
ExtentDescriptor firstExtent = sb.getCatalogFile().getExtents()[0];
catalogHeaderNodeOffset = firstExtent.getStartBlock() * sb.getBlockSize();
if (firstExtent.getStartBlock() != 0 && firstExtent.getBlockCount() != 0) {
- buffer = ByteBuffer.allocate(NodeDescriptor.BT_NODE_DESCRIPTOR_LENGTH
- + BTHeaderRecord.BT_HEADER_RECORD_LENGTH);
+ buffer = ByteBuffer.allocate(NodeDescriptor.BT_NODE_DESCRIPTOR_LENGTH
+ + BTHeaderRecord.BT_HEADER_RECORD_LENGTH);
fs.getApi().read(catalogHeaderNodeOffset, buffer);
buffer.rewind();
byte[] data = ByteBufferUtils.toArray(buffer);
btnd = new NodeDescriptor(data, 0);
bthr = new BTHeaderRecord(data, NodeDescriptor.BT_NODE_DESCRIPTOR_LENGTH);
-
+
}
}
-
+
/**
* Create new Catalog
- *
+ *
* @param params
*/
public Catalog(HFSPlusParams params) {
log.debug("Create B-Tree catalog file.\n");
-
+
int nodeSize = params.getCatalogNodeSize();
-
+
int bufferLength = 0;
btnd = new NodeDescriptor();
btnd.setKind(HfsPlusConstants.BT_HEADER_NODE);
@@ -108,7 +110,7 @@
offset = offset + ck.getKeyLength() + CatalogFolder.CATALOG_FOLDER_SIZE;
CatalogKey tck = new CatalogKey(CatalogNodeId.HFSPLUS_ROOT_CNID, name);
CatalogThread ct = new CatalogThread(HfsPlusConstants.RECORD_TYPE_FOLDER_THREAD,
- CatalogNodeId.HFSPLUS_ROOT_CNID, new HFSUnicodeString(""));
+ CatalogNodeId.HFSPLUS_ROOT_CNID, new HFSUnicodeString(""));
record = new LeafRecord(tck, ct.getBytes());
rootNode.addNodeRecord(1, record, offset);
buffer = ByteBuffer.allocate(bufferLength + bthr.getNodeSize());
@@ -118,9 +120,8 @@
buffer.put(rootNode.getBytes());
buffer.rewind();
}
-
+
/**
- *
* @param parentID
* @return
* @throws IOException
@@ -136,7 +137,7 @@
byte[] data = ByteBufferUtils.toArray(nodeData);
CatalogNode node = new CatalogNode(data, nodeSize);
while (node.isIndexNode()) {
- IndexRecord record = (IndexRecord)node.find(parentID);
+ IndexRecord record = (IndexRecord) node.find(parentID);
currentOffset = catalogHeaderNodeOffset + (record.getIndex() * nodeSize);
nodeData = ByteBuffer.allocate(nodeSize);
fs.getApi().read(currentOffset, nodeData);
@@ -144,20 +145,18 @@
data = ByteBufferUtils.toArray(nodeData);
node = new CatalogNode(data, nodeSize);
}
-
+
if (node.isLeafNode()) {
- lr = (LeafRecord)node.find(parentID);
+ lr = (LeafRecord) node.find(parentID);
}
return lr;
}
/**
* Find leaf records corresponding to parentID. The search begin at the root node of the tree.
- *
+ *
* @param parentID Parent node id
- *
* @return Array of LeafRecord
- *
* @throws IOException
*/
public final LeafRecord[] getRecords(final CatalogNodeId parentID)
@@ -166,14 +165,12 @@
}
/**
- * Find leaf records corresponding to parentID. The search begin at the node correspding
+ * Find leaf records corresponding to parentID. The search begin at the node correspding
* to the index passed as parameter.
- *
- * @param parentID Parent node id
+ *
+ * @param parentID Parent node id
* @param nodeNumber Index of node where the search begin.
- *
* @return Array of LeafRecord
- *
* @throws IOException
*/
public final LeafRecord[] getRecords(final CatalogNodeId parentID, final int nodeNumber)
@@ -185,7 +182,7 @@
fs.getApi().read(catalogHeaderNodeOffset + (currentNodeNumber * nodeSize), nodeData);
CatalogNode node = new CatalogNode(nodeData.array(), nodeSize);
if (node.isIndexNode()) {
- IndexRecord[] records = (IndexRecord[])node.findChilds(parentID);
+ IndexRecord[] records = (IndexRecord[]) node.findChilds(parentID);
List<LeafRecord> lfList = new LinkedList<LeafRecord>();
for (IndexRecord rec : records) {
LeafRecord[] lfr = getRecords(parentID, rec.getIndex());
@@ -195,7 +192,7 @@
}
return lfList.toArray(new LeafRecord[lfList.size()]);
} else if (node.isLeafNode()) {
- return (LeafRecord[])node.findAll(parentID);
+ return (LeafRecord[]) node.findAll(parentID);
} else {
return null;
}
@@ -207,7 +204,6 @@
}
/**
- *
* @param parentID
* @param nodeName
* @return
@@ -223,7 +219,7 @@
int currentOffset = 0;
CatalogKey cKey = new CatalogKey(parentID, nodeName);
while (node.isIndexNode()) {
- IndexRecord record = (IndexRecord)node.find(cKey);
+ IndexRecord record = (IndexRecord) node.find(cKey);
currentNodeNumber = record.getIndex();
currentOffset = catalogHeaderNodeOffset + record.getIndex() * nodeSize;
nodeData = ByteBuffer.allocate(nodeSize);
@@ -232,7 +228,7 @@
}
LeafRecord lr = null;
if (node.isLeafNode()) {
- lr = (LeafRecord)node.find(parentID);
+ lr = (LeafRecord) node.find(parentID);
}
return lr;
}
@@ -244,9 +240,9 @@
public final BTHeaderRecord getBTHeaderRecord() {
return bthr;
}
-
+
public ByteBuffer getBytes() {
return buffer;
}
-
+
}
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -30,7 +30,7 @@
int recordSize = offset2 - offset;
NodeRecord record = null;
Key key = new CatalogKey(datas, offset);
- if(isIndexNode()){
+ if (isIndexNode()) {
record = new IndexRecord(key, datas, offset);
} else {
record = new LeafRecord(key, datas, offset, recordSize);
@@ -39,7 +39,6 @@
}
/**
- *
* @param parentId
* @return
*/
@@ -57,7 +56,6 @@
}
/**
- *
* @param key
* @return
*/
@@ -66,7 +64,7 @@
for (int index = 0; index < this.getNodeDescriptor().getNumRecords(); index++) {
NodeRecord record = this.getNodeRecord(index);
if ((record.getKey().compareTo(key) <= 0)
- && (record.getKey().compareTo(largestMatchingRecord.getKey()) > 0)) {
+ && (record.getKey().compareTo(largestMatchingRecord.getKey()) > 0)) {
largestMatchingRecord = record;
}
}
@@ -74,7 +72,6 @@
}
/**
- *
* @param parentId
* @return
*/
@@ -86,7 +83,7 @@
NodeRecord record = this.getNodeRecord(index);
CatalogKey key = (CatalogKey) record.getKey();
if (key.getParentId().getId() < parentId.getId()
- && (largestMatchingKey == null || key.compareTo(largestMatchingKey) > 0)) {
+ && (largestMatchingKey == null || key.compareTo(largestMatchingKey) > 0)) {
largestMatchingKey = key;
largestMatchingRecord = record;
} else if (key.getParentId().getId() == parentId.getId()) {
@@ -101,7 +98,6 @@
}
/**
- *
* @param parentId
* @return
*/
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -4,7 +4,7 @@
import org.jnode.util.BigEndian;
public abstract class AbstractNode implements Node {
-
+
protected byte[] datas;
protected int size;
@@ -12,15 +12,15 @@
public NodeDescriptor getNodeDescriptor() {
return new NodeDescriptor(datas, 0);
}
-
- public boolean isIndexNode(){
+
+ public boolean isIndexNode() {
return this.getNodeDescriptor().getKind() == HfsPlusConstants.BT_INDEX_NODE;
}
-
- public boolean isLeafNode(){
+
+ public boolean isLeafNode() {
return this.getNodeDescriptor().getKind() == HfsPlusConstants.BT_LEAF_NODE;
}
-
+
@Override
public int getRecordOffset(int index) {
return BigEndian.getInt16(datas, size - ((index + 1) * 2));
@@ -28,14 +28,14 @@
@Override
public abstract NodeRecord getNodeRecord(int index);
-
+
@Override
public void addNodeRecord(int index, NodeRecord record, int offset) {
BigEndian.setInt16(datas, size - ((index + 1) * 2), offset);
System.arraycopy(record.getBytes(), 0, datas, offset, record.getSize());
}
-
- public byte[] getBytes(){
+
+ public byte[] getBytes() {
return datas;
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNodeRecord.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNodeRecord.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNodeRecord.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -1,21 +1,21 @@
package org.jnode.fs.hfsplus.tree;
public abstract class AbstractNodeRecord implements NodeRecord {
-
+
protected Key key = null;
protected byte[] recordData = null;
-
+
public Key getKey() {
return key;
}
-
+
public byte[] getData() {
return recordData;
}
-
- public int getSize(){
+
+ public int getSize() {
return key.getKeyLength() + recordData.length;
}
-
+
public abstract byte[] getBytes();
}
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/LeafRecord.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/LeafRecord.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/LeafRecord.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -3,13 +3,13 @@
import org.jnode.util.BigEndian;
public class LeafRecord extends AbstractNodeRecord {
-
- public LeafRecord(final Key key, final byte[] recordData){
+
+ public LeafRecord(final Key key, final byte[] recordData) {
this.key = key;
this.recordData = new byte[recordData.length];
- System.arraycopy(recordData,0, this.recordData, 0, recordData.length);
+ System.arraycopy(recordData, 0, this.recordData, 0, recordData.length);
}
-
+
public LeafRecord(final Key key, final byte[] nodeData, final int offset, final int recordDataSize) {
this.key = key;
this.recordData = new byte[recordDataSize];
@@ -27,9 +27,9 @@
System.arraycopy(data, key.getKeyLength(), this.recordData, 0, this.recordData.length);
return data;
}
-
+
public final String toString() {
return "Type : " + getType() + "\nKey : " + getKey().toString() + "\n";
}
-
+
}
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/ClassTestRunner.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/ClassTestRunner.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/ClassTestRunner.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -28,17 +28,17 @@
/**
* This TestRunner runs a a class by calling its 'static void main(Sting[])' entry
* point. Note that classes that call System.exit(status) are problematic.
- *
+ *
* @author cr...@jn...
*/
class ClassTestRunner implements TestRunnable {
private ByteArrayOutputStream outBucket;
private ByteArrayOutputStream errBucket;
-
+
private final TestSpecification spec;
private final TestHarness harness;
-
+
public ClassTestRunner(TestSpecification spec, TestHarness harness) {
this.spec = spec;
this.harness = harness;
@@ -55,11 +55,11 @@
private boolean check() {
// When a class is run this way we cannot capture the RC.
- return
+ return
harness.expect(outBucket.toString(), spec.getOutputContent(), "output content") &
- harness.expect(errBucket.toString(), spec.getErrorContent(), "err content");
+ harness.expect(errBucket.toString(), spec.getErrorContent(), "err content");
}
-
+
@Override
public void cleanup() {
}
@@ -72,5 +72,5 @@
System.setOut(new PrintStream(outBucket));
System.setErr(new PrintStream(errBucket));
}
-
-}
\ No newline at end of file
+
+}
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/CommandTestRunner.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/CommandTestRunner.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/CommandTestRunner.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -30,15 +30,15 @@
/**
* This TestRunner runs a class by calling its 'static void main(String[])' entry
* point. Note that classes that call System.exit(status) are problematic.
- *
+ *
* @author cr...@jn...
*/
class CommandTestRunner extends JNodeTestRunnerBase implements TestRunnable {
private ByteArrayOutputStream outBucket;
private ByteArrayOutputStream errBucket;
-
-
+
+
public CommandTestRunner(TestSpecification spec, TestHarness harness) {
super(spec, harness);
}
@@ -56,12 +56,12 @@
}
private boolean check(int rc) {
- return
+ return
harness.expect(rc, spec.getRc(), "return code") &
- harness.expect(outBucket.toString(), spec.getOutputContent(), "output content") &
- harness.expect(errBucket.toString(), spec.getErrorContent(), "err content");
+ harness.expect(outBucket.toString(), spec.getOutputContent(), "output content") &
+ harness.expect(errBucket.toString(), spec.getErrorContent(), "err content");
}
-
+
@Override
public void cleanup() {
}
@@ -74,5 +74,5 @@
System.setOut(new PrintStream(outBucket));
System.setErr(new PrintStream(errBucket));
}
-
-}
\ No newline at end of file
+
+}
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/PluginSpecification.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/PluginSpecification.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/PluginSpecification.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -22,16 +22,16 @@
/**
* This class holds a simple specification for a plugin required by a test or test set.
- *
+ *
* @author crawley@jnode
*/
public class PluginSpecification {
private final String pluginId;
private final String pluginVersion;
private final String pseudoPluginClassName;
-
+
public PluginSpecification(String pluginId, String pluginVersion,
- String pseudoPluginClassName) {
+ String pseudoPluginClassName) {
super();
this.pluginId = pluginId;
this.pluginVersion = pluginVersion;
@@ -47,13 +47,13 @@
}
/**
- * This method returns the classname of a 'pseudo plugin' class that can perform
+ * This method returns the classname of a 'pseudo plugin' class that can perform
* minimal plugin specific initialization when a plugin is 'required' in
* a context where Plugin loading is not possible.
- *
+ *
* @return the class name.
*/
public String getClassName() {
return pseudoPluginClassName;
}
-}
\ No newline at end of file
+}
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -71,4 +71,4 @@
super.cleanup();
}
-}
\ No newline at end of file
+}
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/TestCommandShell.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/TestCommandShell.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/TestCommandShell.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -35,20 +35,20 @@
import org.jnode.shell.io.NullOutputStream;
/**
- * This class extends CommandShell to modify the shell's stream resolution mechanism.
- * The modified resolveStream resolves in/out/err to streams that are supplied in the
- * constructor.
- *
+ * This class extends CommandShell to modify the shell's stream resolution mechanism.
+ * The modified resolveStream resolves in/out/err to streams that are supplied in the
+ * constructor.
+ *
* @author cr...@jn...
*/
public class TestCommandShell extends CommandShell {
-
+
private final CommandInput cin;
private final CommandOutput cout;
private final CommandOutput cerr;
- public TestCommandShell(InputStream in, PrintStream out, PrintStream err)
- throws ShellException {
+ public TestCommandShell(InputStream in, PrintStream out, PrintStream err)
+ throws ShellException {
super();
this.cin = new CommandInput(in);
this.cout = new CommandOutput(out);
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/TestHarness.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/TestHarness.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/TestHarness.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -32,18 +32,18 @@
/**
* This is the entry point class for the command test harness. Its
* purpose is to run 'black box' tests on commands and the like.
- *
+ *
* @author crawley@jnode
*/
public class TestHarness {
// TODO - if someone feels motivated, they could replace the error
// reporting with something that generates (say) XML that can be
// processed by a fancy error report generator.
-
+
private final String commandName = this.getClass().getCanonicalName();
private final String[] args;
-
+
private PrintWriter reportWriter;
private int testCount;
private int failureCount;
@@ -78,7 +78,7 @@
if (args.length == 0) {
usage();
return;
- }
+ }
for (int i = 0; i < args.length && args[i].startsWith("-"); i++) {
String optName = args[i];
if (optName.equals("-r") || optName.equals("--resource") || optName.equals("--resources")) {
@@ -93,9 +93,9 @@
}
root = new File(args[i]);
} else {
- System.err.println("Unrecognized option '" + optName + "'");
- usage();
- return;
+ System.err.println("Unrecognized option '" + optName + "'");
+ usage();
+ return;
}
firstArg = i + 1;
}
@@ -123,8 +123,7 @@
execute(specs);
} catch (Exception ex) {
diagnose(ex, arg);
- }
- finally {
+ } finally {
if (is != null) {
try {
is.close();
@@ -134,10 +133,10 @@
}
}
}
- report("Ran " + testCount + " tests with " + failureCount +
- " test failures and " + exceptionCount + " errors (exceptions)");
+ report("Ran " + testCount + " tests with " + failureCount +
+ " test failures and " + exceptionCount + " errors (exceptions)");
}
-
+
private void usage() {
System.err.println(commandName + " [ <opt> ...] <spec-file> ... ");
System.err.println("where <opt> is one of: ");
@@ -145,7 +144,7 @@
System.err.println(" --sandbox | -s <dir-name> specifies the dev't sandbox root directory");
System.err.println(" --resource | -r looks for <spec-file> as a resource on the CLASSPATH");
}
-
+
private void execute(TestSetSpecification specs) {
for (TestSpecification spec : specs.getSpecs()) {
execute(spec);
@@ -226,7 +225,7 @@
reportWriter.println(message);
reportWriter.flush();
}
-
+
public void reportVerbose(String message) {
if (verbose) {
report(message);
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/TextContent.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/TextContent.java 2009-01-31 09:43:18 UTC (rev 4931)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/TextContent.java 2009-01-31 09:52:51 UTC (rev 4932)
@@ -4,7 +4,7 @@
private final String rawText;
private final boolean trim;
private final String processedText;
-
+
public TextContent(String rawText, boolean trim) {
super();
this.rawText = rawText;
@@ -19,7 +19,7 @@
public boolean isTrim() {
return trim;
}
-
+
@Override
public String toString() {
return processedText;
@@ -38,8 +38,8 @@
* <li>Count the number of leading spaces on the (now) first line.
* <li>Remove this number of leading spaces from all lines.
* <li>Make sure that the last line has a final newline.
- * </ol>
- *
+ * </ol>
+ *
* @param text
* @return
*/
@@ -62,7 +62,7 @@
int count;
int len = tmp.length();
for (count = 0; count < len && tmp.charAt(count) == ' '; count++) {
- /**/
+ /**/
}
if (count > 0) {
StringBuilder sb = new StringBuilder(len);
@@ -70,18 +70,18 @@
for (int i = 0; i < len; i++) {
char ch = tmp.charAt(i);
switch (ch) {
- case ' ':
- if (pos++ >= count) {
- sb.append(' ');
- }
- break;
- case '\n':
- sb.append('\n');
- pos = 0;
- break;
- default:
- pos = count + 1;
- sb.append(ch);
+ case ' ':
+ if (pos++ >= count) {
+ sb.append(' ');
+ }
+ break;
+ case '\n':
+ sb.append('\n');
+ pos = 0;
+ break;
+ default:
+ pos = count + 1;
+ sb.append(ch);
}
}
tmp = sb.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-02-01 23:22:02
|
Revision: 4967
http://jnode.svn.sourceforge.net/jnode/?rev=4967&view=rev
Author: lsantha
Date: 2009-02-01 22:13:30 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
Fixed code style.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/BigEndian.java
trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusDirectory.java
Modified: trunk/core/src/core/org/jnode/util/BigEndian.java
===================================================================
--- trunk/core/src/core/org/jnode/util/BigEndian.java 2009-02-01 22:03:50 UTC (rev 4966)
+++ trunk/core/src/core/org/jnode/util/BigEndian.java 2009-02-01 22:13:30 UTC (rev 4967)
@@ -18,7 +18,7 @@
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
+
package org.jnode.util;
@@ -248,16 +248,16 @@
final int v0 = data[offset + 1] & 0xFF;
return (char) ((v1 << 8) | v0);
}
-
+
/**
* Set char as byte in the given byte array at the given offset.
- *
+ *
* @param dst
* @param offset
* @param value
*/
public static void setChar(byte[] dst, int offset, char value) {
- dst[offset + 1] = (byte)(value & 0xFF);
- dst[offset + 0] = (byte)((value >>> 8) & 0xFF);
+ dst[offset + 1] = (byte) (value & 0xFF);
+ dst[offset + 0] = (byte) ((value >>> 8) & 0xFF);
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusDirectory.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusDirectory.java 2009-02-01 22:03:50 UTC (rev 4966)
+++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusDirectory.java 2009-02-01 22:13:30 UTC (rev 4967)
@@ -18,7 +18,7 @@
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
+
package org.jnode.fs.hfsplus;
import java.io.IOException;
@@ -30,7 +30,6 @@
import org.apache.log4j.Logger;
import org.jnode.fs.FSEntry;
import org.jnode.fs.ReadOnlyFileSystemException;
-import org.jnode.fs.hfsplus.catalog.Catalog;
import org.jnode.fs.hfsplus.catalog.CatalogFolder;
import org.jnode.fs.hfsplus.catalog.CatalogKey;
import org.jnode.fs.hfsplus.catalog.CatalogNodeId;
@@ -63,21 +62,21 @@
throw new ReadOnlyFileSystemException();
}
Superblock volumeHeader = ((HfsPlusFileSystem) getFileSystem())
- .getVolumeHeader();
+ .getVolumeHeader();
Calendar now = Calendar.getInstance();
now.setTime(new Date());
int macDate = (int) HFSUtils
- .getDate(now.getTimeInMillis() / 1000, true);
+ .getDate(now.getTimeInMillis() / 1000, true);
HFSUnicodeString dirName = new HFSUnicodeString(name);
CatalogThread thread = new CatalogThread(
- HfsPlusConstants.RECORD_TYPE_FOLDER_THREAD, this.folder
- .getFolderId(), dirName);
+ HfsPlusConstants.RECORD_TYPE_FOLDER_THREAD, this.folder
+ .getFolderId(), dirName);
CatalogFolder newFolder = new CatalogFolder();
newFolder
- .setFolderId(new CatalogNodeId(volumeHeader.getNextCatalogId()));
+ .setFolderId(new CatalogNodeId(volumeHeader.getNextCatalogId()));
newFolder.setCreateDate(macDate);
newFolder.setContentModDate(macDate);
newFolder.setAttrModDate(macDate);
@@ -90,8 +89,8 @@
log.debug("New record folder :\n" + folderRecord.toString());
HFSPlusEntry newEntry = new HFSPlusEntry(
- (HfsPlusFileSystem) getFileSystem(), null, this, name,
- folderRecord);
+ (HfsPlusFileSystem) getFileSystem(), null, this, name,
+ folderRecord);
volumeHeader.setFolderCount(volumeHeader.getFolderCount() + 1);
log.debug("New volume header :\n" + volumeHeader.toString());
@@ -113,21 +112,21 @@
@Override
protected final FSEntryTable readEntries() throws IOException {
List<FSEntry> pathList = new LinkedList<FSEntry>();
- HfsPlusFileSystem fs = (HfsPlusFileSystem)getFileSystem();
- if(fs.getVolumeHeader().getFolderCount() > 0) {
- LeafRecord[] records = fs.getCatalog().getRecords(folder.getFolderId());
- for (LeafRecord rec : records) {
- if (rec.getType() == HfsPlusConstants.RECORD_TYPE_FOLDER
- || rec.getType() == HfsPlusConstants.RECORD_TYPE_FILE) {
- String name = ((CatalogKey) rec.getKey()).getNodeName()
+ HfsPlusFileSystem fs = (HfsPlusFileSystem) getFileSystem();
+ if (fs.getVolumeHeader().getFolderCount() > 0) {
+ LeafRecord[] records = fs.getCatalog().getRecords(folder.getFolderId());
+ for (LeafRecord rec : records) {
+ if (rec.getType() == HfsPlusConstants.RECORD_TYPE_FOLDER
+ || rec.getType() == HfsPlusConstants.RECORD_TYPE_FILE) {
+ String name = ((CatalogKey) rec.getKey()).getNodeName()
.getUnicodeString();
- HFSPlusEntry e = new HFSPlusEntry(
- (HfsPlusFileSystem) getFileSystem(), null, this, name,
- rec);
- pathList.add(e);
- }
+ HFSPlusEntry e = new HFSPlusEntry(
+ (HfsPlusFileSystem) getFileSystem(), null, this, name,
+ rec);
+ pathList.add(e);
}
}
+ }
return new FSEntryTable(((HfsPlusFileSystem) getFileSystem()), pathList);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-02-14 05:22:32
|
Revision: 5021
http://jnode.svn.sourceforge.net/jnode/?rev=5021&view=rev
Author: crawley
Date: 2009-02-14 05:22:25 +0000 (Sat, 14 Feb 2009)
Log Message:
-----------
Implemented a 'printenv' command to print the environment variables.
(Currently does nothing useful, but some day you will be able to set
environment variables using the bjorne interpreter, etc.)
Modified Paths:
--------------
trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java
trunk/shell/descriptors/org.jnode.shell.command.xml
trunk/shell/src/shell/org/jnode/shell/command/EnvCommand.java
Added Paths:
-----------
trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java
trunk/shell/src/shell/org/jnode/shell/command/PrintEnvCommand.java
Added: trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java
===================================================================
--- trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java (rev 0)
+++ trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java 2009-02-14 05:22:25 UTC (rev 5021)
@@ -0,0 +1,41 @@
+/*
+ * $Id: GetPropertiesAction.java 4973 2009-02-02 07:52:47Z lsantha $
+ *
+ * Copyright (C) 2003-2009 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package gnu.java.security.action;
+
+import java.security.PrivilegedAction;
+import java.util.Map;
+import java.util.Properties;
+
+
+/**
+ * Utility class for getting the map containing the environment variables in a privileged action.
+ *
+ * @author cr...@jn...
+ */
+public class GetEnvAction implements PrivilegedAction<Map<String, String>> {
+
+ /**
+ * @see java.security.PrivilegedAction#run()
+ */
+ public Map<String, String> run() {
+ return System.getenv();
+ }
+}
Modified: trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java
===================================================================
--- trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java 2009-02-13 07:58:01 UTC (rev 5020)
+++ trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java 2009-02-14 05:22:25 UTC (rev 5021)
@@ -21,9 +21,11 @@
package gnu.java.security.action;
import java.security.PrivilegedAction;
+import java.util.Map;
import java.util.Properties;
+
/**
* Utility class for getting all system properties in a privileged action.
*
@@ -37,4 +39,4 @@
public Properties run() {
return System.getProperties();
}
-}
+}
\ No newline at end of file
Modified: trunk/shell/descriptors/org.jnode.shell.command.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.command.xml 2009-02-13 07:58:01 UTC (rev 5020)
+++ trunk/shell/descriptors/org.jnode.shell.command.xml 2009-02-14 05:22:25 UTC (rev 5021)
@@ -42,6 +42,7 @@
<alias name="namespace" class="org.jnode.shell.command.NamespaceCommand"/>
<alias name="onheap" class="org.jnode.shell.command.OnHeapCommand"/>
<alias name="page" class="org.jnode.shell.command.PageCommand"/>
+ <alias name="printenv" class="org.jnode.shell.command.PrintEnvCommand"/>
<alias name="run" class="org.jnode.shell.command.RunCommand"/>
<alias name="set" class="org.jnode.shell.command.SetCommand"/>
<alias name="sleep" class="org.jnode.shell.command.SleepCommand"/>
@@ -250,6 +251,7 @@
<empty description="Filter standard input a page (screen) at a time"/>
<argument argLabel="file" description="Output the file a page (screen) at a time"/>
</syntax>
+ <syntax alias="env" description="Print the environment variables"/>
<syntax alias="run" description="Run a command file">
<argument argLabel="file"/>
</syntax>
Modified: trunk/shell/src/shell/org/jnode/shell/command/EnvCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/EnvCommand.java 2009-02-13 07:58:01 UTC (rev 5020)
+++ trunk/shell/src/shell/org/jnode/shell/command/EnvCommand.java 2009-02-14 05:22:25 UTC (rev 5021)
@@ -34,6 +34,7 @@
* @author epr
*/
public class EnvCommand extends AbstractCommand {
+ // FIXME ... this class and the corresponding alias are incorrectly named
public EnvCommand() {
super("Print the system properties");
Added: trunk/shell/src/shell/org/jnode/shell/command/PrintEnvCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/PrintEnvCommand.java (rev 0)
+++ trunk/shell/src/shell/org/jnode/shell/command/PrintEnvCommand.java 2009-02-14 05:22:25 UTC (rev 5021)
@@ -0,0 +1,60 @@
+/*
+ * $Id: EnvCommand.java 4977 2009-02-02 09:09:41Z lsantha $
+ *
+ * Copyright (C) 2003-2009 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command;
+
+import gnu.java.security.action.GetEnvAction;
+
+import java.io.PrintWriter;
+import java.security.AccessController;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.jnode.shell.AbstractCommand;
+
+/**
+ * This command prints the current environment variables. A regular JNode command
+ * cannot set environment variables because the Java APIs do not allow this. Environment
+ * variable setting is accomplished by the shell / interpreter and builtin commands, it at all.
+ *
+ * @author cr...@jn...
+ */
+public class PrintEnvCommand extends AbstractCommand {
+
+ public PrintEnvCommand() {
+ super("Print the current environment variables");
+ }
+
+ public static void main(String[] args) throws Exception {
+ new PrintEnvCommand().execute(args);
+ }
+
+ /**
+ * Execute this command
+ */
+ public void execute() throws Exception {
+ final Map<String, String> env = (Map<String, String>) AccessController.doPrivileged(new GetEnvAction());
+ final TreeMap<String, String> sortedEnv = new TreeMap<String, String>(env);
+ final PrintWriter out = getOutput().getPrintWriter();
+ for (Map.Entry<String, String> entry : sortedEnv.entrySet()) {
+ out.println(entry.getKey() + '=' + entry.getValue());
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-02-15 05:39:36
|
Revision: 5026
http://jnode.svn.sourceforge.net/jnode/?rev=5026&view=rev
Author: crawley
Date: 2009-02-15 05:39:30 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
Changes to core infrastructure to allow 'procletization' of the System
properties and environment. System.getenv() et al are wired up, but
System.getProperties() et al are not. Also implemented in shell, the
proclet-mode invoker and the Bjorne interpreter (via the 'export' built-in).
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/IOContext.java
trunk/core/src/core/org/jnode/vm/VmIOContext.java
trunk/core/src/core/org/jnode/vm/VmSystem.java
trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java
trunk/shell/src/shell/org/jnode/shell/AsyncCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/CommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/CommandRunner.java
trunk/shell/src/shell/org/jnode/shell/CommandShell.java
trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/DefaultInterpreter.java
trunk/shell/src/shell/org/jnode/shell/RedirectingInterpreter.java
trunk/shell/src/shell/org/jnode/shell/ShellManager.java
trunk/shell/src/shell/org/jnode/shell/ShellUtils.java
trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneContext.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneControlException.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneInterpreter.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneToken.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneTokenizer.java
trunk/shell/src/shell/org/jnode/shell/bjorne/ExitBuiltin.java
trunk/shell/src/shell/org/jnode/shell/bjorne/VariableSlot.java
trunk/shell/src/shell/org/jnode/shell/command/PrintEnvCommand.java
trunk/shell/src/shell/org/jnode/shell/def/DefaultShellManager.java
trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/proclet/ProcletCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/proclet/ProcletContext.java
trunk/shell/src/shell/org/jnode/shell/proclet/ProcletIOContext.java
Added Paths:
-----------
trunk/shell/src/shell/org/jnode/shell/SimpleCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/bjorne/ExportBuiltin.java
Modified: trunk/core/src/core/org/jnode/vm/IOContext.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/IOContext.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/core/src/core/org/jnode/vm/IOContext.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -22,57 +22,24 @@
import java.io.InputStream;
import java.io.PrintStream;
+import java.util.Map;
+import java.util.Properties;
/**
- * This interface provides the hooks for implementing special semantics for System.in, System.out
- * and System.err. Specifically, it is used to implement 'proclet' mode where the stream objects
- * are proxies for context specific streams.
+ * This interface provides the hooks for implementing special semantics for
+ * System.in, System.out and System.err. Specifically, it is used to implement
+ * 'proclet' mode where the stream objects are proxies for context specific
+ * streams. It also supports 'proclet' mode contextualization of the System
+ * properties ({@link System#getProperties()}) and environment ({@link System#getenv()}).
*
* @author Levente S\u00e1ntha
* @author cr...@jn...
*/
public interface IOContext {
+
+ // FIXME ... the name of this interface is misleading.
/**
- * This hook is used to set the 'global' version of System.in; e.g. the one used
- * when there is no active proclet context.
- *
- * @param in the new global System.in
- */
- void setGlobalInStream(InputStream in);
-
- /**
- * This hook is used to get the 'global' version of System.in.
- */
- InputStream getGlobalInStream();
-
- /**
- * This hook is used to set the 'global' version of System.out; e.g. the one used
- * when there is no active proclet context.
- *
- * @param out the new global System.out
- */
- void setGlobalOutStream(PrintStream out);
-
- /**
- * This hook is used to get the 'global' version of System.out.
- */
- PrintStream getGlobalOutStream();
-
- /**
- * This hook is used to set the 'global' version of System.err; e.g. the one used
- * when there is no active proclet context.
- *
- * @param err the new global System.err
- */
- void setGlobalErrStream(PrintStream err);
-
- /**
- * This hook is used to get the 'global' version of System.err.
- */
- PrintStream getGlobalErrStream();
-
- /**
* This hook is used when "setting" System.in; i.e. via System.setIn(in).
*
* @param in the application supplied value for System.in
@@ -107,8 +74,31 @@
* This hook is used to get the 'real' stream underlying System.err in the current context.
*/
PrintStream getRealSystemErr();
+
+ /**
+ * The hook is used to get the current context's 'system properties'
+ */
+ Properties getProperties();
+
+ /**
+ * The hook is used to set the current context's 'system properties'
+ */
+ void setProperties(Properties props);
+
+ /**
+ * The hook is used to get the current context's environment; e.g. containing exported
+ * shell variables.
+ */
+ Map<String, String> getEnv();
+
+ /**
+ * The hook is used to get the current context's environment.
+ */
+ void setEnv(Map<String, String> env);
void enterContext();
void exitContext();
+
+
}
Modified: trunk/core/src/core/org/jnode/vm/VmIOContext.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmIOContext.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/core/src/core/org/jnode/vm/VmIOContext.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -22,40 +22,29 @@
import java.io.InputStream;
import java.io.PrintStream;
+import java.util.Map;
+import java.util.Properties;
/**
+ * This is the implementation of the IOContext API that is be used when
+ * 'proclet' mode is not enabled. It also provides static methods for
+ * getting and setting the 'global' versions of the Stream state, and
+ * the System properties and environment. (The 'global' state is used
+ * in 'proclet' mode when the current thread is not part of a 'proclet'.)
+ *
* @author Levente S\u00e1ntha
* @author cr...@jn...
*/
public class VmIOContext implements IOContext {
+ // FIXME ... restrict visibility (if possible) and add Java security
+ // access controls.
+
private static InputStream globalInStream;
private static PrintStream globalOutStream;
private static PrintStream globalErrStream;
+ private static Properties globalSysProps;
+ private static Map<String, String> globalEnv;
- public void setGlobalInStream(InputStream in) {
- globalInStream = in;
- }
-
- public void setGlobalOutStream(PrintStream out) {
- globalOutStream = out;
- }
-
- public PrintStream getGlobalOutStream() {
- return globalOutStream;
- }
-
- public void setGlobalErrStream(PrintStream err) {
- globalErrStream = err;
- }
-
- public PrintStream getGlobalErrStream() {
- return globalErrStream;
- }
-
- public InputStream getGlobalInStream() {
- return globalInStream;
- }
-
public void setSystemIn(InputStream in) {
globalInStream = in;
VmSystem.setStaticField(System.class, "in", in);
@@ -90,4 +79,100 @@
public PrintStream getRealSystemOut() {
return System.out;
}
+
+ public Map<String, String> getEnv() {
+ return globalEnv;
+ }
+
+ public Properties getProperties() {
+ return globalSysProps;
+ }
+
+ public void setEnv(Map<String, String> env) {
+ globalEnv = env;
+ }
+
+ public void setProperties(Properties props) {
+ globalSysProps = props;
+ }
+
+ /**
+ * Set the 'global' view of {@link System#in}.
+ * @param in the new input stream.
+ */
+ public static void setGlobalInStream(InputStream in) {
+ globalInStream = in;
+ }
+
+ /**
+ * Set the 'global' view of {@link System#out}.
+ * @param in the new output stream.
+ */
+ public static void setGlobalOutStream(PrintStream out) {
+ globalOutStream = out;
+ }
+
+ /**
+ * Get the 'global' view of {@link System#out}.
+ * @return the 'global' output stream.
+ */
+ public static PrintStream getGlobalOutStream() {
+ return globalOutStream;
+ }
+
+ /**
+ * Set the 'global' view of {@link System#err}.
+ * @param in the new error stream.
+ */
+ public static void setGlobalErrStream(PrintStream err) {
+ globalErrStream = err;
+ }
+
+ /**
+ * Get the 'global' view of {@link System#err}.
+ * @return the 'global' error stream.
+ */
+ public static PrintStream getGlobalErrStream() {
+ return globalErrStream;
+ }
+
+ /**
+ * Get the 'global' view of {@link System#in}.
+ * @return the 'global' input stream.
+ */
+ public static InputStream getGlobalInStream() {
+ return globalInStream;
+ }
+
+ /**
+ * Set the 'global' view of the environment returned by {@link System#getenv()}.
+ * @param env the new 'global' environment.
+ */
+ public static void setGlobalEnv(Map<String, String> env) {
+ globalEnv = env;
+ }
+
+ /**
+ * Set the 'global' view of the Properties returned by {@link System#getProperties()}.
+ * @param env the new 'global' properties.
+ */
+ public static void setGlobalProperties(Properties props) {
+ globalSysProps = props;
+ }
+
+ /**
+ * Get the 'global' view of the environment returned by {@link System#getenv()}.
+ * @return the current 'global' environment.
+ */
+ public static Map<String, String> getGlobalEnv() {
+ return globalEnv;
+ }
+
+ /**
+ * Get the 'global' view of the Properties returned by {@link System#getProperties()}.
+ * @return the current 'global' Properties.
+ */
+ public static Properties getGlobalProperties() {
+ return globalSysProps;
+ }
}
Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmSystem.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -171,11 +171,11 @@
final ConsoleAppender infoApp = new ConsoleAppender(new PatternLayout(LAYOUT));
root.addAppender(infoApp);
- initOpenJDKSpeciffics();
+ initOpenJDKSpecifics();
}
}
- private static void initOpenJDKSpeciffics() {
+ private static void initOpenJDKSpecifics() {
//todo this will be moved to java.lang.System during openjdk integration
sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess() {
public sun.reflect.ConstantPool getConstantPool(Class klass) {
@@ -199,6 +199,9 @@
throw new UnsupportedOperationException();
}
});
+
+ // Trigger initialization of the global environment variables.
+ System.getenv();
}
static boolean isInitialized() {
@@ -221,14 +224,13 @@
if (bootOut == null) {
bootOut = sout;
bootOutStream = new PrintStream(bootOut, true);
- IOContext ioContext = getIOContext();
- ioContext.setGlobalOutStream(bootOutStream);
- ioContext.setGlobalErrStream(bootOutStream);
+ VmIOContext.setGlobalOutStream(bootOutStream);
+ VmIOContext.setGlobalErrStream(bootOutStream);
return bootOutStream;
} else if (VmIsolate.isRoot()) {
return bootOutStream;
} else {
- return VmIsolate.currentIsolate().getIOContext().getGlobalOutStream();
+ return VmIOContext.getGlobalOutStream();
}
}
@@ -1125,7 +1127,7 @@
* @return the global 'err' stream.
*/
public static PrintStream getGlobalErrStream() {
- return getIOContext().getGlobalErrStream();
+ return VmIOContext.getGlobalErrStream();
}
/**
@@ -1134,7 +1136,7 @@
* @return the global 'in' stream.
*/
public static InputStream getGlobalInStream() {
- return getIOContext().getGlobalInStream();
+ return VmIOContext.getGlobalInStream();
}
/**
@@ -1143,7 +1145,7 @@
* @return the global 'out' stream.
*/
public static PrintStream getGlobalOutStream() {
- return getIOContext().getGlobalOutStream();
+ return VmIOContext.getGlobalOutStream();
}
/**
Modified: trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java
===================================================================
--- trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -57,9 +57,16 @@
import java.io.*;
import java.util.*;
+import org.jnode.vm.VmIOContext;
+import org.jnode.vm.VmSystem;
+
final class ProcessEnvironment
{
+ // FIXME ... this class needs some work for JNode, Redo / remove the
+ // code that populates the map from the 'C environment' and maybe even
+ // get rid of StringEnvironment and replace it with a simple HashMap.
+
private static final HashMap<Variable,Value> theEnvironment;
private static final Map<String,String> theUnmodifiableEnvironment;
static final int MIN_NAME_LENGTH = 0;
@@ -78,16 +85,18 @@
theUnmodifiableEnvironment
= Collections.unmodifiableMap
(new StringEnvironment(theEnvironment));
+
+ VmIOContext.setGlobalEnv(theUnmodifiableEnvironment);
}
/* Only for use by System.getenv(String) */
static String getenv(String name) {
- return theUnmodifiableEnvironment.get(name);
+ return VmSystem.getIOContext().getEnv().get(name);
}
/* Only for use by System.getenv() */
static Map<String,String> getenv() {
- return theUnmodifiableEnvironment;
+ return VmSystem.getIOContext().getEnv();
}
/* Only for use by ProcessBuilder.environment() */
Modified: trunk/shell/src/shell/org/jnode/shell/AsyncCommandInvoker.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/AsyncCommandInvoker.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/AsyncCommandInvoker.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -27,6 +27,8 @@
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Map;
+import java.util.Properties;
import org.jnode.driver.input.KeyboardEvent;
import org.jnode.driver.input.KeyboardListener;
@@ -46,7 +48,7 @@
* @author Martin Husted Hartvig (ha...@jn...)
* @author cr...@jn...
*/
-public abstract class AsyncCommandInvoker implements CommandInvoker,
+public abstract class AsyncCommandInvoker implements SimpleCommandInvoker,
KeyboardListener {
CommandShell commandShell;
@@ -92,9 +94,15 @@
CommandRunner cr = setup(cmdLine, cmdInfo);
return forkIt(cmdLine, cmdInfo, cr);
}
-
- private CommandRunner setup(CommandLine cmdLine, CommandInfo cmdInfo)
+
+ protected CommandRunner setup(CommandLine cmdLine, CommandInfo cmdInfo)
throws ShellException {
+ return setup(cmdLine, cmdInfo, null, null);
+ }
+
+ protected CommandRunner setup(CommandLine cmdLine, CommandInfo cmdInfo,
+ Properties sysProps, Map<String, String> env)
+ throws ShellException {
Method method;
CommandRunner cr = null;
@@ -112,7 +120,7 @@
throw new ShellInvocationException("Problem while creating command instance", ex);
}
if (command != null) {
- cr = new CommandRunner(this, cmdInfo, cmdLine, resolvedIOs);
+ cr = new CommandRunner(this, cmdInfo, cmdLine, resolvedIOs, sysProps, env);
} else {
try {
method = cmdInfo.getCommandClass().getMethod(MAIN_METHOD, MAIN_ARG_TYPES);
@@ -132,7 +140,7 @@
method.setAccessible(true);
cr = new CommandRunner(
this, cmdInfo, cmdInfo.getCommandClass(), method,
- new Object[] {cmdLine.getArguments()}, resolvedIOs);
+ new Object[] {cmdLine.getArguments()}, resolvedIOs, sysProps, env);
} catch (NoSuchMethodException e) {
// continue;
}
@@ -147,7 +155,7 @@
return cr;
}
- private int runIt(CommandLine cmdLine, CommandInfo cmdInfo, CommandRunner cr)
+ protected int runIt(CommandLine cmdLine, CommandInfo cmdInfo, CommandRunner cr)
throws ShellInvocationException {
try {
if (cmdInfo.isInternal()) {
@@ -178,7 +186,7 @@
}
}
- private CommandThread forkIt(CommandLine cmdLine, CommandInfo cmdInfo,
+ protected CommandThread forkIt(CommandLine cmdLine, CommandInfo cmdInfo,
CommandRunner cr) throws ShellInvocationException {
if (cmdInfo.isInternal()) {
throw new ShellFailureException("unexpected internal command");
Modified: trunk/shell/src/shell/org/jnode/shell/CommandInvoker.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandInvoker.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/CommandInvoker.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -20,36 +20,35 @@
package org.jnode.shell;
-/*
- * User: Sam Reid Date: Dec 20, 2003 Time: 1:18:31 AM Copyright (c) Dec 20, 2003
- * by Sam Reid
- */
+import java.util.Map;
+import java.util.Properties;
/**
- * This is the common API for the various mechanisms for running 'commands'.
- *
- * @author Sam Reid
+ * This 'advanced' invoker API adds methods for invoking commands with
+ * different system properties or environment variables to the parent.
+ *
* @author cr...@jn...
*/
-public interface CommandInvoker {
+public interface CommandInvoker extends SimpleCommandInvoker {
- public interface Factory {
- CommandInvoker create(CommandShell shell);
-
- String getName();
- }
-
/**
* Run a command synchronously, passing back the resulting return code.
*
* @param commandLine this provides the command name (alias), the command
* arguments and (where relevant) the command's i/o stream context.
* @param cmdInfo a CommandInfo descriptor for the command to be run.
+ * @param sysProps a Properties object containing the command's system
+ * properties. If this parameter is {@code null}, a copy of the
+ * system properties for the calling context should be used.
+ * @param env a Map object containing the command's environment variables.
+ * If this parameter is {@code null}, the environment variables for
+ * the calling context should be used.
* @return an integer return code, with zero indicating command success,
* non-zero indicating command failure.
* @throws ShellException if there was some problem launching the command.
*/
- int invoke(CommandLine commandLine, CommandInfo cmdInfo)
+ int invoke(CommandLine commandLine, CommandInfo cmdInfo,
+ Properties sysProps, Map<String, String> env)
throws ShellException;
/**
@@ -59,22 +58,19 @@
* @param commandLine this provides the command name (alias), the command
* arguments and (where relevant) the command's i/o stream context.
* @param cmdInfo a CommandInfo descriptor for the command to be run.
+ * @param sysProps a Properties object containing the command's system
+ * properties. If this parameter is {@code null}, a copy of the
+ * system properties for the calling context should be used.
+ * @param env a Map object containing the command's environment variables.
+ * If this parameter is {@code null}, the environment variables for
+ * the calling context should be used.
* @return the thread for the command. Calling
* {@link java.lang.Thread#start()} will cause the command to
* execute.
* @throws ShellException if there was some problem launching the command.
*/
- CommandThread invokeAsynchronous(CommandLine commandLine, CommandInfo cmdInfo)
+ CommandThread invokeAsynchronous(CommandLine commandLine, CommandInfo cmdInfo,
+ Properties sysProps, Map<String, String> env)
throws ShellException;
- /**
- * Get the invoker's name.
- *
- * @return the name.
- */
- String getName();
-
- boolean isDebugEnabled();
-
- void setDebugEnabled(boolean enabled);
}
Modified: trunk/shell/src/shell/org/jnode/shell/CommandRunner.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandRunner.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/CommandRunner.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -29,6 +29,8 @@
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedActionException;
+import java.util.Map;
+import java.util.Properties;
import org.jnode.shell.help.HelpException;
import org.jnode.shell.help.HelpFactory;
@@ -45,7 +47,7 @@
*/
public class CommandRunner implements Runnable {
- private final CommandInvoker invoker;
+ private final SimpleCommandInvoker invoker;
private final CommandIO[] ios;
final Class<?> targetClass;
final Method method;
@@ -53,12 +55,14 @@
final CommandInfo cmdInfo;
final CommandLine commandLine;
final PrintWriter shellErr;
+ final Properties sysProps;
+ final Map<String, String> env;
private int rc;
- public CommandRunner(CommandInvoker invoker,
+ public CommandRunner(SimpleCommandInvoker invoker,
CommandInfo cmdInfo, Class<?> targetClass, Method method, Object[] args,
- CommandIO[] ios) {
+ CommandIO[] ios, Properties sysProps, Map<String, String> env) {
this.invoker = invoker;
this.targetClass = targetClass;
this.method = method;
@@ -67,10 +71,13 @@
this.args = args;
this.ios = ios;
this.shellErr = ios[Command.SHELL_ERR].getPrintWriter();
+ this.env = env;
+ this.sysProps = sysProps;
}
- public CommandRunner(CommandInvoker invoker,
- CommandInfo cmdInfo, CommandLine commandLine, CommandIO[] ios) {
+ public CommandRunner(SimpleCommandInvoker invoker,
+ CommandInfo cmdInfo, CommandLine commandLine, CommandIO[] ios,
+ Properties sysProps, Map<String, String> env) {
this.invoker = invoker;
this.targetClass = null;
this.method = null;
@@ -79,6 +86,8 @@
this.commandLine = commandLine;
this.ios = ios;
this.shellErr = ios[Command.SHELL_ERR].getPrintWriter();
+ this.env = env;
+ this.sysProps = sysProps;
}
public void run() {
@@ -199,4 +208,11 @@
return commandLine != null ? commandLine.getCommandName() : null;
}
+ public Properties getSysProps() {
+ return sysProps;
+ }
+
+ public Map<String, String> getEnv() {
+ return env;
+ }
}
Modified: trunk/shell/src/shell/org/jnode/shell/CommandShell.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -38,6 +38,8 @@
import java.text.DateFormat;
import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.Properties;
import java.util.StringTokenizer;
import javax.naming.NameNotFoundException;
@@ -151,7 +153,7 @@
*/
private String lastInputLine = "";
- private CommandInvoker invoker;
+ private SimpleCommandInvoker invoker;
private String invokerName;
private CommandInterpreter interpreter;
@@ -573,11 +575,19 @@
* command is run using the CommandShell's current invoker.
*
* @param cmdLine the CommandLine object.
+ * @param env
+ * @param sysProps
* @return the command's return code
* @throws ShellException
*/
- public int invoke(CommandLine cmdLine, CommandInfo cmdInfo) throws ShellException {
- return this.invoker.invoke(cmdLine, cmdInfo);
+ public int invoke(CommandLine cmdLine, CommandInfo cmdInfo,
+ Properties sysProps, Map<String, String> env)
+ throws ShellException {
+ if (this.invoker instanceof CommandInvoker) {
+ return ((CommandInvoker) this.invoker).invoke(cmdLine, cmdInfo, sysProps, env);
+ } else {
+ return this.invoker.invoke(cmdLine, cmdInfo);
+ }
}
/**
@@ -843,7 +853,7 @@
}
}
- public CommandInvoker getDefaultCommandInvoker() {
+ public SimpleCommandInvoker getDefaultCommandInvoker() {
return ShellUtils.createInvoker("default", this);
}
Modified: trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -49,7 +49,7 @@
* @author Sam Reid
* @author cr...@jn...
*/
-public class DefaultCommandInvoker implements CommandInvoker {
+public class DefaultCommandInvoker implements SimpleCommandInvoker {
private final PrintWriter err;
private final CommandShell shell;
@@ -58,7 +58,7 @@
private static final Class<?>[] MAIN_ARG_TYPES = new Class[] {String[].class};
public static final Factory FACTORY = new Factory() {
- public CommandInvoker create(CommandShell shell) {
+ public SimpleCommandInvoker create(CommandShell shell) {
return new DefaultCommandInvoker(shell);
}
Modified: trunk/shell/src/shell/org/jnode/shell/DefaultInterpreter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/DefaultInterpreter.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/DefaultInterpreter.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -102,7 +102,7 @@
shell.addCommandToHistory(line);
try {
CommandInfo cmdInfo = cmd.parseCommandLine(shell);
- return shell.invoke(cmd, cmdInfo);
+ return shell.invoke(cmd, cmdInfo, null, null);
} catch (CommandSyntaxException ex) {
throw new ShellException("Command arguments don't match syntax", ex);
}
Modified: trunk/shell/src/shell/org/jnode/shell/RedirectingInterpreter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/RedirectingInterpreter.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/RedirectingInterpreter.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -249,7 +249,7 @@
desc.commandLine.setStreams(new CommandIO[] {in, out, err, CommandLine.DEFAULT_STDERR});
try {
CommandInfo cmdInfo = desc.commandLine.parseCommandLine(shell);
- return shell.invoke(desc.commandLine, cmdInfo);
+ return shell.invoke(desc.commandLine, cmdInfo, null, null);
} catch (CommandSyntaxException ex) {
throw new ShellException(
"Command arguments don't match syntax", ex);
Modified: trunk/shell/src/shell/org/jnode/shell/ShellManager.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/ShellManager.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/ShellManager.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -48,15 +48,15 @@
*/
public void registerShell(Shell currentShell);
- public void registerInvokerFactory(CommandInvoker.Factory factory);
+ public void registerInvokerFactory(SimpleCommandInvoker.Factory factory);
public void registerInterpreterFactory(CommandInterpreter.Factory factory);
- public void unregisterInvokerFactory(CommandInvoker.Factory factory);
+ public void unregisterInvokerFactory(SimpleCommandInvoker.Factory factory);
public void unregisterInterpreterFactory(CommandInterpreter.Factory factory);
- public CommandInvoker createInvoker(String name, CommandShell shell)
+ public SimpleCommandInvoker createInvoker(String name, CommandShell shell)
throws IllegalArgumentException;
public CommandInterpreter createInterpreter(String name)
Modified: trunk/shell/src/shell/org/jnode/shell/ShellUtils.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/ShellUtils.java 2009-02-14 20:29:54 UTC (rev 5025)
+++ trunk/shell/src/shell/org/jnode/shell/ShellUtils.java 2009-02-15 05:39:30 UTC (rev 5026)
@@ -92,7 +92,7 @@
return getShellManager().getCurrentShell().getSyntaxManager();
}
- public static void registerCommandInvoker(CommandInvoker.Factory factory)
+ ...
[truncated message content] |
|
From: <kon...@us...> - 2009-02-15 21:29:13
|
Revision: 5029
http://jnode.svn.sourceforge.net/jnode/?rev=5029&view=rev
Author: konkubinaten
Date: 2009-02-15 21:29:10 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
added descriptors for cirrus driver. If you have a cirrus graphics card it should be detected and the (not yet working) cirrus driver will be used by default.
Modified Paths:
--------------
trunk/all/conf/default-plugin-list.xml
Added Paths:
-----------
trunk/gui/descriptors/org.jnode.driver.video.cirrus.xml
Modified: trunk/all/conf/default-plugin-list.xml
===================================================================
--- trunk/all/conf/default-plugin-list.xml 2009-02-15 21:26:21 UTC (rev 5028)
+++ trunk/all/conf/default-plugin-list.xml 2009-02-15 21:29:10 UTC (rev 5029)
@@ -106,6 +106,7 @@
<plugin id="org.jnode.driver.video.cursor"/>
<plugin id="org.jnode.driver.video.ati.mach64"/>
<plugin id="org.jnode.driver.video.ati.radeon"/>
+ <plugin id="org.jnode.driver.video.cirrus"/>
<plugin id="org.jnode.driver.video.nvidia"/>
<plugin id="org.jnode.driver.video.vga"/>
<plugin id="org.jnode.driver.video.vgahw"/>
Added: trunk/gui/descriptors/org.jnode.driver.video.cirrus.xml
===================================================================
--- trunk/gui/descriptors/org.jnode.driver.video.cirrus.xml (rev 0)
+++ trunk/gui/descriptors/org.jnode.driver.video.cirrus.xml 2009-02-15 21:29:10 UTC (rev 5029)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<plugin id="org.jnode.driver.video.cirrus"
+ name="JNode Cirrus driver"
+ version="@VERSION@"
+ license-name="lgpl"
+ provider-name="JNode.org">
+
+ <requires>
+ <import plugin="org.jnode.awt"/>
+ <import plugin="org.jnode.driver.video"/>
+ <import plugin="org.jnode.driver.bus.pci"/>
+ </requires>
+
+ <runtime>
+ <library name="jnode-gui.jar">
+ <export name="org.jnode.driver.video.cirrus.*"/>
+ </library>
+ </runtime>
+
+ <extension point="org.jnode.driver.mappers">
+ <mapper id="1013:00B8" architecture="gd5446" name="Cirrus Logic GD 5446" driver-class="org.jnode.driver.video.cirrus.CirrusDriver" class="org.jnode.driver.bus.pci.PCIDeviceToDriverMapper"/>
+ </extension>
+
+ <extension point="org.jnode.security.permissions">
+ <permission class="org.jnode.system.ResourcePermission" name="ioports"/>
+ </extension>
+
+</plugin>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2009-02-15 22:30:56
|
Revision: 5031
http://jnode.svn.sourceforge.net/jnode/?rev=5031&view=rev
Author: fduminy
Date: 2009-02-15 22:30:50 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
fixed checkstyle config files for eclipse
Modified Paths:
--------------
trunk/builder/.checkstyle
trunk/core/.checkstyle
trunk/distr/.checkstyle
trunk/fs/.checkstyle
trunk/gui/.checkstyle
trunk/net/.checkstyle
trunk/shell/.checkstyle
Added Paths:
-----------
trunk/docs/.checkstyle
trunk/sound/.checkstyle
trunk/textui/.checkstyle
Modified: trunk/builder/.checkstyle
===================================================================
--- trunk/builder/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/builder/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
- <fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
+ <local-check-config name="JNode checkstyle - javadoc" location="/all/new_checks.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="true"/>
+ </local-check-config>
+ <fileset name="tous" enabled="true" check-config-name="JNode checkstyle - javadoc" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
<filter name="FilesFromPackage" enabled="true">
Modified: trunk/core/.checkstyle
===================================================================
--- trunk/core/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/core/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
<fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
Modified: trunk/distr/.checkstyle
===================================================================
--- trunk/distr/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/distr/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
- <fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
+ <local-check-config name="JNode checkstyle - javadoc" location="/all/new_checks.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="true"/>
+ </local-check-config>
+ <fileset name="tous" enabled="true" check-config-name="JNode checkstyle - javadoc" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
<filter name="NonSrcDirs" enabled="true"/>
Added: trunk/docs/.checkstyle
===================================================================
--- trunk/docs/.checkstyle (rev 0)
+++ trunk/docs/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="tous" enabled="true" check-config-name="Sun Checks" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Modified: trunk/fs/.checkstyle
===================================================================
--- trunk/fs/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/fs/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
<fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
Modified: trunk/gui/.checkstyle
===================================================================
--- trunk/gui/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/gui/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
<fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
Modified: trunk/net/.checkstyle
===================================================================
--- trunk/net/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/net/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
<fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
Modified: trunk/shell/.checkstyle
===================================================================
--- trunk/shell/.checkstyle 2009-02-15 22:09:28 UTC (rev 5030)
+++ trunk/shell/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
- <local-check-config name="JNode checkstyle" location="/JNode-All/jnode_checks.xml" type="project" description="">
+ <local-check-config name="JNode checkstyle" location="/all/jnode_checks.xml" type="project" description="">
<additional-data name="protect-config-file" value="true"/>
</local-check-config>
<fileset name="tous" enabled="true" check-config-name="JNode checkstyle" local="true">
Added: trunk/sound/.checkstyle
===================================================================
--- trunk/sound/.checkstyle (rev 0)
+++ trunk/sound/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="tous" enabled="true" check-config-name="Sun Checks" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Added: trunk/textui/.checkstyle
===================================================================
--- trunk/textui/.checkstyle (rev 0)
+++ trunk/textui/.checkstyle 2009-02-15 22:30:50 UTC (rev 5031)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="tous" enabled="true" check-config-name="Sun Checks" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2009-02-15 23:01:57
|
Revision: 5030
http://jnode.svn.sourceforge.net/jnode/?rev=5030&view=rev
Author: fduminy
Date: 2009-02-15 22:09:28 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
renamed eclipse projects to match their directory names (JNode-Shell -> shell, JNode-All -> all, ....)
Modified Paths:
--------------
trunk/all/.classpath
trunk/all/.project
trunk/builder/.classpath
trunk/builder/.project
trunk/core/.project
trunk/distr/.classpath
trunk/distr/.project
trunk/docs/.project
trunk/fs/.classpath
trunk/fs/.project
trunk/gui/.classpath
trunk/gui/.project
trunk/net/.classpath
trunk/net/.project
trunk/shell/.classpath
trunk/shell/.project
trunk/sound/.project
trunk/textui/.classpath
trunk/textui/.project
Modified: trunk/all/.classpath
===================================================================
--- trunk/all/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/all/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="/JNode-Builder"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="src" path="/JNode-FS"/>
- <classpathentry kind="src" path="/JNode-GUI"/>
- <classpathentry kind="src" path="/JNode-Net"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
+ <classpathentry kind="src" path="/builder"/>
+ <classpathentry kind="src" path="/core"/>
+ <classpathentry kind="src" path="/fs"/>
+ <classpathentry kind="src" path="/gui"/>
+ <classpathentry kind="src" path="/net"/>
+ <classpathentry kind="src" path="/shell"/>
<classpathentry kind="output" path="build"/>
</classpath>
Modified: trunk/all/.project
===================================================================
--- trunk/all/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/all/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-All</name>
+ <name>all</name>
<comment></comment>
<projects>
<project>JNode-Builder</project>
Modified: trunk/builder/.classpath
===================================================================
--- trunk/builder/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/builder/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -2,11 +2,11 @@
<classpath>
<classpathentry excluding="**/.svn/**" kind="src" path="src/builder"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/configure"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="src" path="/JNode-FS"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/ant.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
+ <classpathentry kind="src" path="/core"/>
+ <classpathentry kind="src" path="/fs"/>
+ <classpathentry kind="lib" path="/core/lib/ant.jar"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
+ <classpathentry kind="src" path="/shell"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/bcel-5.1.jar"/>
<classpathentry kind="lib" path="lib/nanoxml-2.2.3.jar"/>
Modified: trunk/builder/.project
===================================================================
--- trunk/builder/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/builder/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Builder</name>
+ <name>builder</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/core/.project
===================================================================
--- trunk/core/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/core/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Core</name>
+ <name>core</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/distr/.classpath
===================================================================
--- trunk/distr/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/distr/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -3,22 +3,23 @@
<classpathentry excluding="**/.svn/**" kind="src" path="src/install"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/emu"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
- <classpathentry kind="src" path="/JNode-Core"/>
+ <classpathentry kind="src" path="/core"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/apps"/>
- <classpathentry kind="src" path="/JNode-GUI"/>
+ <classpathentry kind="src" path="/gui"/>
<classpathentry kind="lib" path="lib/telnetd.jar"/>
<classpathentry kind="lib" path="lib/jetty-6.1.5.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-6.1.5.jar"/>
<classpathentry kind="lib" path="lib/jsp-2.1.jar"/>
<classpathentry kind="lib" path="lib/jsp-api-2.1.jar"/>
<classpathentry kind="lib" path="lib/servlet-api-2.5-6.1.5.jar"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
- <classpathentry kind="src" path="/JNode-TextUI"/>
- <classpathentry combineaccessrules="false" kind="src" path="/JNode-FS"/>
- <classpathentry kind="lib" path="/JNode-Shell/lib/bsh-2.0b5.jar"/>
+ <classpathentry kind="src" path="/shell"/>
+ <classpathentry kind="src" path="/textui"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/fs"/>
+ <classpathentry kind="lib" path="/shell/lib/bsh-2.0b5.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
<classpathentry kind="lib" path="lib/derby.jar"/>
<classpathentry kind="lib" path="lib/derbynet.jar"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/distr/.project
===================================================================
--- trunk/distr/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/distr/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Distr</name>
+ <name>distr</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/docs/.project
===================================================================
--- trunk/docs/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/docs/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Docs</name>
+ <name>docs</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/fs/.classpath
===================================================================
--- trunk/fs/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/fs/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -3,20 +3,20 @@
<classpathentry excluding="**/.svn/**" kind="src" path="src/fs"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/junit.jar"/>
+ <classpathentry kind="src" path="/shell"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/ant.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/jmock-1.0.1.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/jmock-cglib-1.0.1.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/cglib-2.1.jar"/>
<classpathentry kind="lib" path="lib/edtftpj-1.5.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.2.6.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/commons-net-1.1.0.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/jcfe.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/jfunc.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/JNode-Net"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/net"/>
+ <classpathentry kind="src" path="/core"/>
+ <classpathentry kind="lib" path="/core/lib/ant.jar"/>
+ <classpathentry kind="lib" path="/core/lib/cglib-2.1.jar"/>
+ <classpathentry kind="lib" path="/core/lib/commons-net-1.1.0.jar"/>
+ <classpathentry kind="lib" path="/core/lib/jcfe.jar"/>
+ <classpathentry kind="lib" path="/core/lib/jfunc.jar"/>
+ <classpathentry kind="lib" path="/core/lib/jmock-1.0.1.jar"/>
+ <classpathentry kind="lib" path="/core/lib/jmock-cglib-1.0.1.jar"/>
+ <classpathentry kind="lib" path="/core/lib/junit.jar"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/fs/.project
===================================================================
--- trunk/fs/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/fs/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-FS</name>
+ <name>fs</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/gui/.classpath
===================================================================
--- trunk/gui/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/gui/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -6,8 +6,8 @@
<classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/thinlet"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
+ <classpathentry kind="src" path="/core"/>
+ <classpathentry kind="src" path="/shell"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/gui/.project
===================================================================
--- trunk/gui/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/gui/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-GUI</name>
+ <name>gui</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/net/.classpath
===================================================================
--- trunk/net/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/net/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -3,15 +3,15 @@
<classpathentry excluding="**/.svn/**" kind="src" path="src/net"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/driver"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
+ <classpathentry kind="src" path="/core"/>
<classpathentry kind="lib" path="lib/oncrpc.jar"/>
- <classpathentry kind="src" path="/JNode-Shell"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/gnu-crypto.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/javax-crypto.jar"/>
+ <classpathentry kind="src" path="/shell"/>
<classpathentry kind="lib" path="lib/jsch-0.1.24.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/commons-net-1.1.0.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/junit.jar"/>
<classpathentry kind="lib" path="lib/dnsjava-1.6.6.jar" sourcepath="lib/dnsjava-1.6.6-src.zip"/>
+ <classpathentry kind="lib" path="/core/lib/commons-net-1.1.0.jar"/>
+ <classpathentry kind="lib" path="/core/lib/gnu-crypto.jar"/>
+ <classpathentry kind="lib" path="/core/lib/javax-crypto.jar"/>
+ <classpathentry kind="lib" path="/core/lib/junit.jar"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/net/.project
===================================================================
--- trunk/net/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/net/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Net</name>
+ <name>net</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/shell/.classpath
===================================================================
--- trunk/shell/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/shell/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -3,13 +3,13 @@
<classpathentry excluding="**/.svn/**" kind="src" path="src/shell"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/emu"/>
<classpathentry excluding="**/.svn/**" kind="src" path="src/test"/>
- <classpathentry kind="src" path="/JNode-Core"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/junit.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/ant.jar"/>
- <classpathentry kind="lib" path="/JNode-Core/lib/ant-launcher.jar"/>
+ <classpathentry kind="src" path="/core"/>
<classpathentry exported="true" kind="lib" path="lib/bsh-2.0b5.jar"/>
<classpathentry kind="lib" path="lib/rhino1.6r5-jsr223.jar"/>
- <classpathentry kind="lib" path="/JNode-Builder/lib/nanoxml-2.2.3.jar"/>
+ <classpathentry kind="lib" path="/core/lib/ant-launcher.jar"/>
+ <classpathentry kind="lib" path="/core/lib/ant.jar"/>
+ <classpathentry kind="lib" path="/core/lib/junit.jar"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
+ <classpathentry kind="lib" path="/builder/lib/nanoxml-2.2.3.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/shell/.project
===================================================================
--- trunk/shell/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/shell/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Shell</name>
+ <name>shell</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
Modified: trunk/sound/.project
===================================================================
--- trunk/sound/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/sound/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-Sound</name>
+ <name>sound</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/textui/.classpath
===================================================================
--- trunk/textui/.classpath 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/textui/.classpath 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/textui"/>
- <classpathentry exported="true" kind="src" path="/JNode-Core"/>
- <classpathentry exported="true" kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/>
- <classpathentry exported="true" kind="src" path="/JNode-Shell"/>
+ <classpathentry exported="true" kind="src" path="/core"/>
+ <classpathentry exported="true" kind="src" path="/shell"/>
+ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/textui/.project
===================================================================
--- trunk/textui/.project 2009-02-15 21:29:10 UTC (rev 5029)
+++ trunk/textui/.project 2009-02-15 22:09:28 UTC (rev 5030)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JNode-TextUI</name>
+ <name>textui</name>
<comment></comment>
<projects>
<project>JNode-Core</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-02-16 20:48:10
|
Revision: 5038
http://jnode.svn.sourceforge.net/jnode/?rev=5038&view=rev
Author: lsantha
Date: 2009-02-16 20:48:06 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
Added fragment org.classpath.ext.security.
Modified Paths:
--------------
trunk/all/conf/default-plugin-list.xml
Added Paths:
-----------
trunk/core/descriptors/org.classpath.ext.security.xml
Modified: trunk/all/conf/default-plugin-list.xml
===================================================================
--- trunk/all/conf/default-plugin-list.xml 2009-02-16 20:45:42 UTC (rev 5037)
+++ trunk/all/conf/default-plugin-list.xml 2009-02-16 20:48:06 UTC (rev 5038)
@@ -27,6 +27,7 @@
<plugin id="org.classpath.ext.imageio"/>
<plugin id="org.classpath.ext.management"/>
<plugin id="org.classpath.ext.sql"/>
+ <plugin id="org.classpath.ext.security"/>
<plugin id="org.classpath.tools"/>
<plugin id="mx4j"/>
Copied: trunk/core/descriptors/org.classpath.ext.security.xml (from rev 5025, trunk/core/descriptors/org.classpath.ext.xml.xml)
===================================================================
--- trunk/core/descriptors/org.classpath.ext.security.xml (rev 0)
+++ trunk/core/descriptors/org.classpath.ext.security.xml 2009-02-16 20:48:06 UTC (rev 5038)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<fragment id="org.classpath.ext.security"
+ name="Classpath javax.xml classes"
+ version="@VERSION@"
+ plugin-id="rt"
+ plugin-version="@VERSION@"
+ provider-name="Classpath"
+ provider-url="http://classpath.org"
+ license-name="classpath">
+
+ <runtime>
+ <library name="jnode-core.jar">
+ <export name="sun.security.util.*"/>
+ <export name="sun.security.tools.*"/>
+ <export name="sun.security.timestamp.*"/>
+ <export name="sun.security.acl.*"/>
+ <export name="sun.security.ec.*"/>
+ <export name="sun.security.internal.interfaces*"/>
+ <export name="sun.security.internal.spec*"/>
+ <export name="sun.security.internal.*"/>
+ <export name="sun.security.jca.*"/>
+ <export name="sun.security.jgss.*"/>
+ <export name="sun.security.jgss.krb5.*"/>
+ <export name="sun.security.jgss.spi.*"/>
+ <export name="sun.security.jgss.spnego.*"/>
+ <export name="sun.security.jgss.wrapper.*"/>
+ <export name="sun.security.krb5.*"/>
+ <export name="sun.security.krb5.internal.*"/>
+ <export name="sun.security.krb5.internal.ccache.*"/>
+ <export name="sun.security.krb5.internal.crypto.*"/>
+ <export name="sun.security.krb5.internal.crypto.dk.*"/>
+ <export name="sun.security.krb5.internal.rcache.*"/>
+ <export name="sun.security.krb5.internal.ktab.*"/>
+ <export name="sun.security.krb5.internal.util.*"/>
+ <export name="sun.security.pkcs.*"/>
+ <export name="sun.security.pkcs11.*"/>
+ <export name="sun.security.pkcs11.wrapper.*"/>
+ <export name="sun.security.pkcs12.*"/>
+ <export name="sun.security.provider.*"/>
+ <export name="sun.security.provider.certpath.*"/>
+ <export name="sun.security.rsa.*"/>
+ <export name="sun.security.ssl.*"/>
+ <export name="sun.security.validator.*"/>
+ <export name="sun.security.x509.*"/>
+ <export name="com.sun.crypto.provider.*"/>
+ <export name="com.sun.net.ssl.*"/>
+ <export name="com.sun.net.ssl.internal.ssl.*"/>
+ <export name="com.sun.jarsigner.*"/>
+ <export name="sun.nio.ch.*"/>
+ </library>
+ </runtime>
+
+</fragment>
Property changes on: trunk/core/descriptors/org.classpath.ext.security.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-02-17 14:52:23
|
Revision: 5042
http://jnode.svn.sourceforge.net/jnode/?rev=5042&view=rev
Author: crawley
Date: 2009-02-17 14:52:18 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
Working on getting black-box testing to work on on JNode ... nearly there
Modified Paths:
--------------
trunk/all/build.xml
trunk/all/conf/tests-plugin-list.xml
trunk/builder/.classpath
trunk/shell/.classpath
trunk/shell/build.xml
trunk/shell/descriptors/org.jnode.test.shell.xml
trunk/shell/src/emu/org/jnode/emu/Emu.java
trunk/shell/src/test/org/jnode/test/shell/bjorne/bjorne-shell-tests.xml
trunk/shell/src/test/org/jnode/test/shell/command/posix/posix-command-tests.xml
trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
trunk/shell/src/test/org/jnode/test/shell/harness/TestEmu.java
Added Paths:
-----------
trunk/shell/descriptors/net.n3.nanoxml.xml
trunk/shell/lib/nanoxml-2.2.3.jar
Removed Paths:
-------------
trunk/builder/lib/nanoxml-2.2.3.jar
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/all/build.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -69,7 +69,7 @@
<property name="derby.jar" value="${root.dir}/distr/lib/derby.jar" />
<property name="derbynet.jar" value="${root.dir}/distr/lib/derbynet.jar" />
<property name="derbytools.jar" value="${root.dir}/distr/lib/derbytools.jar" />
- <property name="nanoxml-java.jar" value="${root.dir}/builder/lib/nanoxml-2.2.3.jar" />
+ <property name="nanoxml-java.jar" value="${root.dir}/shell/lib/nanoxml-2.2.3.jar" />
<!-- libraries needed to run tests -->
<property name="jmock-cglib.jar" value="${root.dir}/core/lib/jmock-cglib-1.0.1.jar"/>
@@ -256,6 +256,7 @@
<libalias name="javax-crypto.jar" alias="${javax-crypto.jar}"/>
<libalias name="log4j.jar" alias="${log4j.jar}"/>
<libalias name="beanshell.jar" alias="${beanshell.jar}"/>
+ <libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/>
<libalias name="js.jar" alias="${js.jar}"/>
<libalias name="lw.jar" alias="${lw.jar}"/>
<libalias name="thinlet.jar" alias="${thinlet.jar}"/>
Modified: trunk/all/conf/tests-plugin-list.xml
===================================================================
--- trunk/all/conf/tests-plugin-list.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/all/conf/tests-plugin-list.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -16,6 +16,7 @@
<plugin id="net.sf.cglib"/>
<plugin id="org.jmock.cglib"/>
<plugin id="org.jmock"/>
+ <plugin id="net.n3.nanoxml"/>
<plugin id="org.jnode.test"/>
<plugin id="org.jnode.test.fs"/>
Modified: trunk/builder/.classpath
===================================================================
--- trunk/builder/.classpath 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/builder/.classpath 2009-02-17 14:52:18 UTC (rev 5042)
@@ -9,6 +9,6 @@
<classpathentry kind="src" path="/shell"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/bcel-5.1.jar"/>
- <classpathentry kind="lib" path="lib/nanoxml-2.2.3.jar"/>
+ <classpathentry kind="lib" path="/shell/lib/nanoxml-2.2.3.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Deleted: trunk/builder/lib/nanoxml-2.2.3.jar
===================================================================
(Binary files differ)
Modified: trunk/shell/.classpath
===================================================================
--- trunk/shell/.classpath 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/.classpath 2009-02-17 14:52:18 UTC (rev 5042)
@@ -10,6 +10,6 @@
<classpathentry kind="lib" path="/core/lib/ant.jar"/>
<classpathentry kind="lib" path="/core/lib/junit.jar"/>
<classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
- <classpathentry kind="lib" path="/builder/lib/nanoxml-2.2.3.jar"/>
+ <classpathentry kind="lib" path="lib/nanoxml-2.2.3.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/shell/build.xml
===================================================================
--- trunk/shell/build.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/build.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -10,7 +10,7 @@
<!-- Subproject specific classpath -->
<path id="my-cp">
<pathelement location="${jnode-core.jar}"/>
- <pathelement location="${basedir}/../builder/lib/nanoxml-2.2.3.jar"/>
+ <pathelement location="${nanoxml-java.jar}"/>
<path refid="cp"/>
</path>
@@ -19,7 +19,8 @@
<mkdir dir="${my-classes.dir}"/>
<jnode.copy-descriptors/>
<copy todir="${my-classes.dir}">
- <fileset dir="${my-src.dir}/shell" excludes="**/*.java,**/package.html"/>
+ <fileset dir="${my-src.dir}/shell" excludes="**/*.java,**/package.html"/>
+ <fileset dir="${my-src.dir}/test" excludes="**/*.java,**/package.html"/>
</copy>
</target>
Added: trunk/shell/descriptors/net.n3.nanoxml.xml
===================================================================
--- trunk/shell/descriptors/net.n3.nanoxml.xml (rev 0)
+++ trunk/shell/descriptors/net.n3.nanoxml.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<plugin id="net.n3.nanoxml"
+ name="NanoXML Java classes"
+ version="2.2.3"
+ provider-name="nanoxml.org"
+ license-name="zlib">
+
+ <runtime>
+ <library name="nanoxml-java.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
+
+</plugin>
\ No newline at end of file
Modified: trunk/shell/descriptors/org.jnode.test.shell.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.test.shell.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/descriptors/org.jnode.test.shell.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -13,6 +13,7 @@
<import plugin="org.jnode.shell.help"/>
<import plugin="org.jnode.shell.syntax"/>
<import plugin="org.junit" version="3.8"/>
+ <import plugin="net.n3.nanoxml"/>
<import plugin="org.jnode.shell.help"/>
<import plugin="org.jnode.testrunner"/>
</requires>
Added: trunk/shell/lib/nanoxml-2.2.3.jar
===================================================================
(Binary files differ)
Property changes on: trunk/shell/lib/nanoxml-2.2.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/shell/src/emu/org/jnode/emu/Emu.java
===================================================================
--- trunk/shell/src/emu/org/jnode/emu/Emu.java 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/src/emu/org/jnode/emu/Emu.java 2009-02-17 14:52:18 UTC (rev 5042)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.HashSet;
import javax.naming.NamingException;
@@ -59,7 +60,7 @@
};
// FIXME configuring a hard-coded list of command plugins is a bad idea.
- private static final String[] DEFAULT_PLUGIN_NAMES = new String[] {
+ private static final String[] DEFAULT_PLUGIN_IDS = new String[] {
"org.jnode.shell.command",
"org.jnode.shell.command.driver.console",
"org.jnode.apps.editor",
@@ -70,9 +71,10 @@
private final File root;
private final AliasManager aliasMgr;
private final SyntaxManager syntaxMgr;
+ private final HashSet<String> configuredPlugins = new HashSet<String>();
public Emu(File root) throws EmuException {
- this(root, DEFAULT_PLUGIN_NAMES);
+ this(root, DEFAULT_PLUGIN_IDS);
}
/**
@@ -94,7 +96,7 @@
aliasMgr = new DefaultAliasManager(new DummyExtensionPoint()).createAliasManager();
syntaxMgr = new DefaultSyntaxManager(new DummyExtensionPoint()).createSyntaxManager();
for (String pluginName : pluginNames) {
- configurePluginCommands(pluginName);
+ configurePlugin(pluginName);
}
System.setProperty("jnode.invoker", "thread");
System.setProperty("jnode.interpreter", "redirecting");
@@ -111,13 +113,16 @@
/**
* Configure any command classes specified by a given plugin's descriptor
*
- * @param pluginName the plugin to be processed
+ * @param pluginId the plugin to be processed
* @throws EmuException
*/
- public void configurePluginCommands(String pluginName) throws EmuException {
- XMLElement pluginDescriptor = loadPluginDescriptor(pluginName);
- extractAliases(pluginDescriptor);
- extractSyntaxBundles(pluginDescriptor);
+ public void configurePlugin(String pluginId) throws EmuException {
+ if (!configuredPlugins.contains(pluginId)) {
+ XMLElement pluginDescriptor = loadPluginDescriptor(pluginId);
+ extractAliases(pluginDescriptor);
+ extractSyntaxBundles(pluginDescriptor);
+ configuredPlugins.add(pluginId);
+ }
}
/**
Modified: trunk/shell/src/test/org/jnode/test/shell/bjorne/bjorne-shell-tests.xml
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/bjorne/bjorne-shell-tests.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/src/test/org/jnode/test/shell/bjorne/bjorne-shell-tests.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -613,9 +613,20 @@
</testSpec>
<testSpec title="redirection" command="test" runMode="AS_SCRIPT" rc="0">
<script>#!bjorne
- echo > @TEMP_DIR@/blablah Hi mum
+ echo > @TEMP_DIR@/1 Hi mum
+ echo > @TEMP_DIR@/2 Hi mum
+ echo >> @TEMP_DIR@/2 Hi mum again
+ echo Hello mother
+ echo Hello mother again 1>&2
</script>
- <file name="blablah" input="false">Hi mum
-</file>
+ <file name="1" input="false">Hi mum
+</file>
+ <file name="2" input="false">Hi mum
+Hi mum again
+</file>
+ <output>Hello mother
+</output>
+ <error>Hello mother again
+</error>
</testSpec>
</testSet>
\ No newline at end of file
Modified: trunk/shell/src/test/org/jnode/test/shell/command/posix/posix-command-tests.xml
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/command/posix/posix-command-tests.xml 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/src/test/org/jnode/test/shell/command/posix/posix-command-tests.xml 2009-02-17 14:52:18 UTC (rev 5042)
@@ -12,4 +12,42 @@
<output>2
</output>
</testSpec>
+ <testSpec title="expr 2 * 2" command="org.jnode.shell.command.posix.ExprCommand"
+ runMode="AS_ALIAS" rc="0">
+ <arg>2</arg>
+ <arg>*</arg>
+ <arg>2</arg>
+ <output>4
+</output>
+ </testSpec>
+ <testSpec title="expr 4 / 2" command="org.jnode.shell.command.posix.ExprCommand"
+ runMode="AS_ALIAS" rc="0">
+ <arg>4</arg>
+ <arg>/</arg>
+ <arg>2</arg>
+ <output>2
+</output>
+ </testSpec>
+ <testSpec title="expr 1 + 2 * 2" command="org.jnode.shell.command.posix.ExprCommand"
+ runMode="AS_ALIAS" rc="0">
+ <arg>1</arg>
+ <arg>+</arg>
+ <arg>2</arg>
+ <arg>*</arg>
+ <arg>2</arg>
+ <output>5
+</output>
+ </testSpec>
+ <testSpec title="expr ( 1 + 2 ) * 2" command="org.jnode.shell.command.posix.ExprCommand"
+ runMode="AS_ALIAS" rc="0">
+ <arg>(</arg>
+ <arg>1</arg>
+ <arg>+</arg>
+ <arg>2</arg>
+ <arg>)</arg>
+ <arg>*</arg>
+ <arg>2</arg>
+ <output>6
+</output>
+ </testSpec>
</testSet>
\ No newline at end of file
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-02-17 14:52:18 UTC (rev 5042)
@@ -46,8 +46,9 @@
@Override
public int run() throws Exception {
Properties props = new Properties();
- props.setProperty("TEMP_DIR", System.getProperty("java.io.tmpdir"));
- tempScriptFile = new File(System.getProperty("java.io.tmpdir"), spec.getCommand());
+ String tempDir = System.getProperty("java.io.tmpdir");
+ props.setProperty("TEMP_DIR", tempDir);
+ tempScriptFile = new File(tempDir, spec.getCommand());
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(tempScriptFile));
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/TestEmu.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/TestEmu.java 2009-02-16 21:32:28 UTC (rev 5041)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/TestEmu.java 2009-02-17 14:52:18 UTC (rev 5042)
@@ -91,16 +91,16 @@
if (!emuInitialized) {
throw new IllegalStateException("Emu not initialized");
}
- if (!loadedPseudoPlugins.contains(className)) {
- try {
+ try {
+ if (!loadedPseudoPlugins.contains(className)) {
Class<?> clazz = Class.forName(className);
clazz.newInstance();
- Method method = emuClass.getMethod("configurePluginCommands", String.class);
- method.invoke(emuObject, pluginId);
- } catch (Exception ex) {
- throw new RuntimeException("Cannot configure plugin '" + pluginId + "'", ex);
+ loadedPseudoPlugins.add(className);
}
- loadedPseudoPlugins.add(className);
+ Method method = emuClass.getMethod("configurePlugin", String.class);
+ method.invoke(emuObject, pluginId);
+ } catch (Exception ex) {
+ throw new RuntimeException("Cannot configure plugin '" + pluginId + "'", ex);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-02-18 10:45:05
|
Revision: 5047
http://jnode.svn.sourceforge.net/jnode/?rev=5047&view=rev
Author: lsantha
Date: 2009-02-18 10:45:00 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Removed unused and outdated plugins.
Modified Paths:
--------------
trunk/all/build.xml
trunk/all/conf/default-plugin-list.xml
trunk/core/descriptors/org.classpath.core.xml
trunk/net/descriptors/com.jcraft.jsch.xml
trunk/net/descriptors/org.jnode.test.net.xml
Removed Paths:
-------------
trunk/core/descriptors/crypto-security.xml
trunk/core/lib/gnu-crypto.jar
trunk/core/lib/javax-crypto.jar
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/all/build.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -83,9 +83,6 @@
<property name="junit4.jar" value="${root.dir}/distr/lib/junit-4.1.jar"/>
<property name="log4j.jar" value="${root.dir}/core/lib/log4j-1.2.8.jar"/>
- <property name="gnu-crypto.jar" value="${root.dir}/core/lib/gnu-crypto.jar"/>
- <property name="javax-crypto.jar" value="${root.dir}/core/lib/javax-crypto.jar"/>
- <!-- property name="javax-security.jar" value="${root.dir}/core/lib/javax-security.jar" / -->
<property name="beanshell.jar" value="${root.dir}/shell/lib/bsh-2.0b5.jar"/>
<property name="js.jar" value="${root.dir}/shell/lib/rhino1.6r5-jsr223.jar"/>
@@ -120,8 +117,6 @@
<pathelement location="${asm-util.jar}"/>
<pathelement location="${cglib.jar}"/>
<pathelement location="${log4j.jar}"/>
- <pathelement location="${gnu-crypto.jar}"/>
- <pathelement location="${javax-crypto.jar}"/>
<pathelement location="${basedir}/conf"/>
<pathelement location="${beanshell.jar}"/>
<pathelement location="${js.jar}"/>
@@ -252,8 +247,6 @@
<libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/>
<libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/>
<libalias name="jsch-0.1.24.jar" alias="${jsch.jar}"/>
- <libalias name="gnu-crypto.jar" alias="${gnu-crypto.jar}"/>
- <libalias name="javax-crypto.jar" alias="${javax-crypto.jar}"/>
<libalias name="log4j.jar" alias="${log4j.jar}"/>
<libalias name="beanshell.jar" alias="${beanshell.jar}"/>
<libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/>
Modified: trunk/all/conf/default-plugin-list.xml
===================================================================
--- trunk/all/conf/default-plugin-list.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/all/conf/default-plugin-list.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -153,7 +153,6 @@
<plugin id="org.jnode.net.nfs"/>
<plugin id="com.jcraft.jsch"/>
- <plugin id="crypto-security"/>
<plugin id="org.jnode.protocol"/>
<plugin id="org.jnode.protocol.ftp"/>
Deleted: trunk/core/descriptors/crypto-security.xml
===================================================================
--- trunk/core/descriptors/crypto-security.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/core/descriptors/crypto-security.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plugin SYSTEM "jnode.dtd">
-
-<plugin id="crypto-security"
- name="GNU-Crypto classes"
- version="2.0.1"
- provider-name="http://www.gnu.org/software/gnu-crypto"
- license-name="GPL + Library Exception"
- license-url="http://www.gnu.org/software/gnu-crypto/">
-
- <runtime>
- <library name="gnu-crypto.jar">
- <export name="*"/>
- </library>
- <library name="javax-crypto.jar">
- <export name="*"/>
- </library>
- </runtime>
-
-</plugin>
\ No newline at end of file
Modified: trunk/core/descriptors/org.classpath.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.core.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/core/descriptors/org.classpath.core.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -169,6 +169,7 @@
<export name="javax.xml.stream.util.*"/>
<export name="javax.crypto.*"/>
+ <export name="javax.crypto.interfaces.*"/>
<export name="javax.crypto.spec.*"/>
<export name="javax.security.auth.AuthPermission"/>
<export name="javax.security.auth.Destroyable"/>
Deleted: trunk/core/lib/gnu-crypto.jar
===================================================================
(Binary files differ)
Deleted: trunk/core/lib/javax-crypto.jar
===================================================================
(Binary files differ)
Modified: trunk/net/descriptors/com.jcraft.jsch.xml
===================================================================
--- trunk/net/descriptors/com.jcraft.jsch.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/net/descriptors/com.jcraft.jsch.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -10,7 +10,7 @@
license-url="http://www.jcraft.com/jsch/LICENSE.txt">
<requires>
- <import plugin="crypto-security"/>
+ <import plugin="org.classpath.ext.security"/>
</requires>
Modified: trunk/net/descriptors/org.jnode.test.net.xml
===================================================================
--- trunk/net/descriptors/org.jnode.test.net.xml 2009-02-17 19:54:00 UTC (rev 5046)
+++ trunk/net/descriptors/org.jnode.test.net.xml 2009-02-18 10:45:00 UTC (rev 5047)
@@ -8,7 +8,6 @@
provider-name="JNode.org">
<requires>
- <import plugin="crypto-security"/>
<import plugin="com.jcraft.jsch"/>
</requires>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-02-18 10:51:49
|
Revision: 5048
http://jnode.svn.sourceforge.net/jnode/?rev=5048&view=rev
Author: lsantha
Date: 2009-02-18 10:51:38 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Fixed IDEA project files.
Modified Paths:
--------------
trunk/builder/builder.iml
trunk/distr/distr.iml
trunk/shell/shell.iml
Modified: trunk/builder/builder.iml
===================================================================
--- trunk/builder/builder.iml 2009-02-18 10:45:00 UTC (rev 5047)
+++ trunk/builder/builder.iml 2009-02-18 10:51:38 UTC (rev 5048)
@@ -111,20 +111,20 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="fs" />
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/nanoxml-2.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../core/lib/ant.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module" module-name="fs" />
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/../core/lib/ant.jar!/" />
+ <root url="jar://$MODULE_DIR$/../shell/lib/nanoxml-2.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: trunk/distr/distr.iml
===================================================================
--- trunk/distr/distr.iml 2009-02-18 10:45:00 UTC (rev 5047)
+++ trunk/distr/distr.iml 2009-02-18 10:51:38 UTC (rev 5048)
@@ -20,15 +20,6 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../hda6/ext/devel/jnode/shell/lib/bsh-2.0b5.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
<root url="file://$MODULE_DIR$/lib" />
</CLASSES>
<JAVADOC />
Modified: trunk/shell/shell.iml
===================================================================
--- trunk/shell/shell.iml 2009-02-18 10:45:00 UTC (rev 5047)
+++ trunk/shell/shell.iml 2009-02-18 10:51:38 UTC (rev 5048)
@@ -26,7 +26,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/../builder/lib/nanoxml-2.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/nanoxml-2.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cr...@us...> - 2009-02-24 12:11:14
|
Revision: 5061
http://jnode.svn.sourceforge.net/jnode/?rev=5061&view=rev
Author: crawley
Date: 2009-02-24 12:11:10 +0000 (Tue, 24 Feb 2009)
Log Message:
-----------
Moving 'cat' to Shell project. It is no more a file system command than
(say) 'grep' or 'test'.
Modified Paths:
--------------
trunk/fs/descriptors/org.jnode.fs.command.xml
trunk/shell/descriptors/org.jnode.shell.command.xml
Added Paths:
-----------
trunk/shell/src/shell/org/jnode/shell/command/CatCommand.java
Removed Paths:
-------------
trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
Modified: trunk/fs/descriptors/org.jnode.fs.command.xml
===================================================================
--- trunk/fs/descriptors/org.jnode.fs.command.xml 2009-02-23 14:55:27 UTC (rev 5060)
+++ trunk/fs/descriptors/org.jnode.fs.command.xml 2009-02-24 12:11:10 UTC (rev 5061)
@@ -20,7 +20,6 @@
</runtime>
<extension point="org.jnode.shell.aliases">
- <alias name="cat" class="org.jnode.fs.command.CatCommand"/>
<alias name="cd" class="org.jnode.fs.command.CdCommand" internal="yes"/>
<alias name="cp" class="org.jnode.fs.command.CpCommand"/>
<alias name="del" class="org.jnode.fs.command.DeleteCommand"/>
@@ -37,18 +36,6 @@
</extension>
<extension point="org.jnode.shell.syntaxes">
- <syntax alias="cat">
- <empty description="copy standard input to standard output"/>
- <sequence description="fetch and concatenate urls to standard output">
- <option argLabel="urls" shortName="u" longName="urls"/>
- <repeat minCount="1">
- <argument argLabel="url"/>
- </repeat>
- </sequence>
- <repeat minCount="1" description="concatenate files to standard output">
- <argument argLabel="file"/>
- </repeat>
- </syntax>
<syntax alias="cd">
<empty description="change the current directory to the 'user.home' directory"/>
<argument argLabel="directory" description="change the current directory to 'directory'"/>
Deleted: trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2009-02-23 14:55:27 UTC (rev 5060)
+++ trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2009-02-24 12:11:10 UTC (rev 5061)
@@ -1,164 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 2003-2009 JNode.org
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; If not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-package org.jnode.fs.command;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.URL;
-
-import org.jnode.shell.AbstractCommand;
-import org.jnode.shell.syntax.Argument;
-import org.jnode.shell.syntax.FileArgument;
-import org.jnode.shell.syntax.FlagArgument;
-import org.jnode.shell.syntax.URLArgument;
-
-/**
- * Read files or network resources and write the concatenation to standard output. If
- * no filenames or URIs are provided, copy standard input to standard output. Data is
- * copied byte-wise.
- * <p>
- * If any file or URL cannot be opened, it is skipped and we (eventually) set a non-zero
- * return code. If we get an IOException reading or writing data, we allow it to propagate.
- *
- * @author epr
- * @author Andreas H\u00e4nel
- * @author cr...@jn...
- * @author Fabien DUMINY (fd...@jn...)
- */
-public class CatCommand extends AbstractCommand {
-
- private final FileArgument ARG_FILE =
- new FileArgument("file", Argument.OPTIONAL | Argument.MULTIPLE | Argument.EXISTING,
- "the files to be concatenated");
-
- private final URLArgument ARG_URL =
- new URLArgument("url", Argument.OPTIONAL | Argument.MULTIPLE | Argument.EXISTING,
- "the urls to be concatenated");
-
- private final FlagArgument FLAG_URLS =
- new FlagArgument("urls", Argument.OPTIONAL, "If set, arguments will be urls");
-
- private PrintWriter err;
-
- public CatCommand() {
- super("Concatenate the contents of files, urls or standard input to standard output");
- registerArguments(ARG_FILE, ARG_URL, FLAG_URLS);
- }
-
- private static final int BUFFER_SIZE = 8192;
-
-
- public static void main(String[] args) throws Exception {
- new CatCommand().execute(args);
- }
-
- public void execute() throws IOException {
- this.err = getError().getPrintWriter();
- OutputStream out = getOutput().getOutputStream();
- File[] files = ARG_FILE.getValues();
- URL[] urls = ARG_URL.getValues();
-
- boolean ok = true;
- if (urls != null && urls.length > 0) {
- for (URL url : urls) {
- InputStream is = null;
- try {
- is = url.openStream();
- } catch (IOException ex) {
- err.println("Can't fetch url '" + url + "': " + ex.getLocalizedMessage());
- ok = false;
- }
- if (is != null) {
- try {
- process(is, out);
- } finally {
- try {
- is.close();
- } catch (IOException ex) {
- /* ignore */
- }
- }
- }
- }
- } else if (files != null && files.length > 0) {
- for (File file : files) {
- InputStream is = null;
- try {
- is = openFile(file);
- if (is == null) {
- ok = false;
- } else {
- process(is, out);
- }
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException ex) {
- /* ignore */
- }
- }
- }
- }
- } else {
- process(getInput().getInputStream(), out);
- }
- out.flush();
- if (!ok) {
- exit(1);
- }
- }
-
- /**
- * Copy all of stream 'in' to stream 'out'
- * @param in
- * @param out
- * @throws IOException
- */
- private void process(InputStream in, OutputStream out) throws IOException {
- int len;
- final byte[] buf = new byte[BUFFER_SIZE];
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- }
-
- /**
- * Attempt to open a file, writing an error message on failure.
- * @param fname the filename of the file to be opened
- * @return An open stream, or <code>null</code>.
- * @throws FileNotFoundException
- */
- private InputStream openFile(File file) throws FileNotFoundException {
- try {
- return new FileInputStream(file);
- } catch (IOException ex) {
- err.println("Cannot open file '" + file + "': " + ex.getLocalizedMessage());
- return null;
- }
- }
-
-}
Modified: trunk/shell/descriptors/org.jnode.shell.command.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.command.xml 2009-02-23 14:55:27 UTC (rev 5060)
+++ trunk/shell/descriptors/org.jnode.shell.command.xml 2009-02-24 12:11:10 UTC (rev 5061)
@@ -20,6 +20,7 @@
<extension point="org.jnode.shell.aliases">
<alias name="alias" class="org.jnode.shell.command.AliasCommand"/>
<alias name="bindkeys" class="org.jnode.shell.command.BindKeysCommand"/>
+ <alias name="cat" class="org.jnode.shell.command.CatCommand"/>
<alias name="class" class="org.jnode.shell.command.ClassCommand"/>
<alias name="classpath" class="org.jnode.shell.command.ClasspathCommand" internal="yes"/>
<alias name="compile" class="org.jnode.shell.command.CompileCommand"/>
@@ -84,6 +85,18 @@
</repeat>
</sequence>
</syntax>
+ <syntax alias="cat">
+ <empty description="copy standard input to standard output"/>
+ <sequence description="fetch and concatenate urls to standard output">
+ <option argLabel="urls" shortName="u" longName="urls"/>
+ <repeat minCount="1">
+ <argument argLabel="url"/>
+ </repeat>
+ </sequence>
+ <repeat minCount="1" description="concatenate files to standard output">
+ <argument argLabel="file"/>
+ </repeat>
+ </syntax>
<syntax alias="class" description="Show details of a Java class">
<argument argLabel="className"/>
</syntax>
Added: trunk/shell/src/shell/org/jnode/shell/command/CatCommand.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/command/CatCommand.java (rev 0)
+++ trunk/shell/src/shell/org/jnode/shell/command/CatCommand.java 2009-02-24 12:11:10 UTC (rev 5061)
@@ -0,0 +1,164 @@
+/*
+ * $Id: CatCommand.java 4975 2009-02-02 08:30:52Z lsantha $
+ *
+ * Copyright (C) 2003-2009 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.shell.command;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+
+import org.jnode.shell.AbstractCommand;
+import org.jnode.shell.syntax.Argument;
+import org.jnode.shell.syntax.FileArgument;
+import org.jnode.shell.syntax.FlagArgument;
+import org.jnode.shell.syntax.URLArgument;
+
+/**
+ * Read files or network resources and write the concatenation to standard output. If
+ * no filenames or URIs are provided, copy standard input to standard output. Data is
+ * copied byte-wise.
+ * <p>
+ * If any file or URL cannot be opened, it is skipped and we (eventually) set a non-zero
+ * return code. If we get an IOException reading or writing data, we allow it to propagate.
+ *
+ * @author epr
+ * @author Andreas H\u00e4nel
+ * @author cr...@jn...
+ * @author Fabien DUMINY (fd...@jn...)
+ */
+public class CatCommand extends AbstractCommand {
+
+ private final FileArgument ARG_FILE =
+ new FileArgument("file", Argument.OPTIONAL | Argument.MULTIPLE | Argument.EXISTING,
+ "the files to be concatenated");
+
+ private final URLArgument ARG_URL =
+ new URLArgument("url", Argument.OPTIONAL | Argument.MULTIPLE | Argument.EXISTING,
+ "the urls to be concatenated");
+
+ private final FlagArgument FLAG_URLS =
+ new FlagArgument("urls", Argument.OPTIONAL, "If set, arguments will be urls");
+
+ private PrintWriter err;
+
+ public CatCommand() {
+ super("Concatenate the contents of files, urls or standard input to standard output");
+ registerArguments(ARG_FILE, ARG_URL, FLAG_URLS);
+ }
+
+ private static final int BUFFER_SIZE = 8192;
+
+
+ public static void main(String[] args) throws Exception {
+ new CatCommand().execute(args);
+ }
+
+ public void execute() throws IOException {
+ this.err = getError().getPrintWriter();
+ OutputStream out = getOutput().getOutputStream();
+ File[] files = ARG_FILE.getValues();
+ URL[] urls = ARG_URL.getValues();
+
+ boolean ok = true;
+ if (urls != null && urls.length > 0) {
+ for (URL url : urls) {
+ InputStream is = null;
+ try {
+ is = url.openStream();
+ } catch (IOException ex) {
+ err.println("Can't fetch url '" + url + "': " + ex.getLocalizedMessage());
+ ok = false;
+ }
+ if (is != null) {
+ try {
+ process(is, out);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ /* ignore */
+ }
+ }
+ }
+ }
+ } else if (files != null && files.length > 0) {
+ for (File file : files) {
+ InputStream is = null;
+ try {
+ is = openFile(file);
+ if (is == null) {
+ ok = false;
+ } else {
+ process(is, out);
+ }
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException ex) {
+ /* ignore */
+ }
+ }
+ }
+ }
+ } else {
+ process(getInput().getInputStream(), out);
+ }
+ out.flush();
+ if (!ok) {
+ exit(1);
+ }
+ }
+
+ /**
+ * Copy all of stream 'in' to stream 'out'
+ * @param in
+ * @param out
+ * @throws IOException
+ */
+ private void process(InputStream in, OutputStream out) throws IOException {
+ int len;
+ final byte[] buf = new byte[BUFFER_SIZE];
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ }
+
+ /**
+ * Attempt to open a file, writing an error message on failure.
+ * @param fname the filename of the file to be opened
+ * @return An open stream, or <code>null</code>.
+ * @throws FileNotFoundException
+ */
+ private InputStream openFile(File file) throws FileNotFoundException {
+ try {
+ return new FileInputStream(file);
+ } catch (IOException ex) {
+ err.println("Cannot open file '" + file + "': " + ex.getLocalizedMessage());
+ return null;
+ }
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-02-26 21:53:25
|
Revision: 5066
http://jnode.svn.sourceforge.net/jnode/?rev=5066&view=rev
Author: lsantha
Date: 2009-02-26 21:53:20 +0000 (Thu, 26 Feb 2009)
Log Message:
-----------
OpenJDK integration and cleanups.
Modified Paths:
--------------
trunk/all/build.xml
trunk/all/conf/default-plugin-list.xml
trunk/core/descriptors/org.classpath.core.xml
trunk/core/descriptors/org.classpath.ext.core.xml
trunk/core/descriptors/org.classpath.ext.management.xml
trunk/core/descriptors/org.classpath.ext.xml.xml
Added Paths:
-----------
trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml
trunk/core/descriptors/org.classpath.ext.xml.ws.xml
Removed Paths:
-------------
trunk/core/descriptors/mx4j.xml
trunk/core/lib/mx4j-remote.jar
trunk/core/lib/mx4j.jar
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/all/build.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -44,9 +44,6 @@
<property name="jnode-mmtk-ms.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.ms"/>
<property name="jnode-mmtk-nogc.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.nogc"/>
- <property name="mx4j.jar" value="${root.dir}/core/lib/mx4j.jar"/>
- <property name="mx4j-remote.jar" value="${root.dir}/core/lib/mx4j-remote.jar"/>
-
<property name="ant.jar" value="${root.dir}/core/lib/ant.jar"/>
<property name="ant-launcher.jar" value="${root.dir}/core/lib/ant-launcher.jar"/>
<property name="commons-net.jar" value="${root.dir}/core/lib/commons-net-1.1.0.jar"/>
@@ -144,8 +141,6 @@
<pathelement location="${thinlet.jar}"/>
<pathelement location="${jnode-textui.jar}"/>
<pathelement location="${bcel-5.1.jar}"/>
- <pathelement location="${mx4j.jar}"/>
- <pathelement location="${mx4j-remote.jar}"/>
<path refid="cp"/>
</path>
@@ -241,8 +236,6 @@
<libalias name="jnode-mmtk-nogc.jar" alias="${jnode-mmtk-nogc.jar}"/>
<libalias name="mmtk.jar" alias="${mmtk.jar}"/>
- <libalias name="mx4j.jar" alias="${mx4j.jar}"/>
- <libalias name="mx4j-remote.jar" alias="${mx4j-remote.jar}"/>
<libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/>
<libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/>
@@ -251,7 +244,6 @@
<libalias name="beanshell.jar" alias="${beanshell.jar}"/>
<libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/>
<libalias name="js.jar" alias="${js.jar}"/>
- <libalias name="lw.jar" alias="${lw.jar}"/>
<libalias name="thinlet.jar" alias="${thinlet.jar}"/>
<libalias name="junit.jar" alias="${junit.jar}"/>
@@ -266,9 +258,7 @@
<libalias name="jfunc.jar" alias="${jfunc.jar}"/>
<libalias name="ant.jar" alias="${ant.jar}"/>
- <libalias name="ant-commons-net.jar" alias="${ant-commons-net.jar}"/>
<libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/>
- <libalias name="ant-trax.jar" alias="${ant-trax.jar}"/>
<libalias name="edtftpj.jar" alias="${edtftpj.jar}"/>
<libalias name="jcifs.jar" alias="${jcifs.jar}"/>
<libalias name="ejc.jar" alias="${ejc.jar}"/>
Modified: trunk/all/conf/default-plugin-list.xml
===================================================================
--- trunk/all/conf/default-plugin-list.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/all/conf/default-plugin-list.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -29,7 +29,6 @@
<plugin id="org.classpath.ext.sql"/>
<plugin id="org.classpath.ext.security"/>
<plugin id="org.classpath.tools"/>
- <plugin id="mx4j"/>
<plugin id="org.apache.jakarta.commons.net"/>
<plugin id="org.xbill.dns"/>
Deleted: trunk/core/descriptors/mx4j.xml
===================================================================
--- trunk/core/descriptors/mx4j.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/core/descriptors/mx4j.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plugin SYSTEM "jnode.dtd">
-
-<fragment id="mx4j"
- name="MX4J Management Extensions"
- version="3.0.1"
- plugin-id="rt"
- plugin-version="@VERSION@"
- provider-name="mx4j.org"
- provider-url="http://mx4j.org"
- license-name="apache">
-
- <runtime>
- <library name="mx4j.jar">
- <export name="javax.management.*"/>
- <export name="javax.management.loading.*"/>
- <export name="javax.management.modelmbean.*"/>
- <export name="javax.management.monitor.*"/>
- <export name="javax.management.openmbean.*"/>
- <export name="javax.management.relation.*"/>
- <export name="javax.management.timer.*"/>
-
- <export name="mx4j.*"/>
- <export name="mx4j.loading.*"/>
- <export name="mx4j.log.*"/>
- <export name="mx4j.monitor.*"/>
- <export name="mx4j.persist.*"/>
- <export name="mx4j.server.*"/>
- <export name="mx4j.server.interceptor.*"/>
- <export name="mx4j.timer.*"/>
- <export name="mx4j.util.*"/>
- </library>
-
- <library name="mx4j-remote.jar">
- <export name="javax.management.remote.*"/>
- <export name="javax.management.remote.rmi.*"/>
-
- <export name="mx4j.*"/>
- <export name="mx4j.log.*"/>
- <export name="mx4j.remote.*"/>
- <export name="mx4j.remote.provider.*"/>
- <export name="mx4j.remote.provider.iiop.*"/>
- <export name="mx4j.remote.provider.rmi.*"/>
- <export name="mx4j.remote.resolver.iiop.*"/>
- <export name="mx4j.remote.resolver.rmi.*"/>
- <export name="mx4j.remote.rmi.*"/>
- <export name="mx4j.util.*"/>
- <export name="org.omg.stub.javax.management.remote.rmi.*"/>
- </library>
- </runtime>
-
-</fragment>
Modified: trunk/core/descriptors/org.classpath.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.core.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/core/descriptors/org.classpath.core.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -100,7 +100,6 @@
<export name="gnu.java.security.util.*"/>
<export name="gnu.java.util.*"/>
- <export name="gnu.java.util.jar.*"/>
<export name="java.awt.AWTPermission"/>
<export name="java.beans.ChangeListenerMap" />
Modified: trunk/core/descriptors/org.classpath.ext.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.core.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/core/descriptors/org.classpath.ext.core.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -58,7 +58,6 @@
<export name="java.awt.print.*"/>
<export name="java.beans.*"/>
<export name="java.beans.beancontext.*"/>
- <export name="java.lang.management.*"/>
<export name="java.rmi.*"/>
<export name="java.rmi.activation.*"/>
<export name="java.rmi.dgc.*"/>
@@ -88,8 +87,6 @@
<export name="javax.activity.*"/>
<export name="javax.annotation.*"/>
<export name="javax.annotation.processing.*"/>
- <export name="javax.jws.*"/>
- <export name="javax.jws.soap.*"/>
<export name="javax.lang.model.*"/>
<export name="javax.lang.model.element.*"/>
<export name="javax.lang.model.type.*"/>
Modified: trunk/core/descriptors/org.classpath.ext.management.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.management.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/core/descriptors/org.classpath.ext.management.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -11,8 +11,30 @@
license-name="classpath">
<runtime>
- <library name="jnode-core.jar">
+ <library name="jnode-core.jar">
+ <export name="com.sun.management.*"/>
+ <export name="com.sun.jmx.defaults.*"/>
+ <export name="com.sun.jmx.interceptor.*"/>
+ <export name="com.sun.jmx.mbeanserver.*"/>
+ <export name="com.sun.jmx.remote.internal.*"/>
+ <export name="com.sun.jmx.remote.protocol.iiop.*"/>
+ <export name="com.sun.jmx.remote.protocol.rmi.*"/>
+ <export name="com.sun.jmx.remote.security.*"/>
+ <export name="com.sun.jmx.remote.util.*"/>
+ <export name="java.lang.management.*"/>
+ <export name="javax.management.*"/>
+ <export name="javax.management.loading.*"/>
+ <export name="javax.management.modelmbean.*"/>
+ <export name="javax.management.monitor.*"/>
<export name="javax.management.openmbean.*"/>
+ <export name="javax.management.relation.*"/>
+ <export name="javax.management.remote.*"/>
+ <export name="javax.management.remote.rmi.*"/>
+ <export name="javax.management.timer.*"/>
+ <export name="sun.management.*"/>
+ <export name="sun.management.counter.*"/>
+ <export name="sun.management.counter.perf.*"/>
+ <export name="sun.management.jmxremote.*"/>
</library>
</runtime>
Added: trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml (rev 0)
+++ trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<fragment id="org.classpath.ext.xml.ws.tools"
+ name="Classpath javax.xml classes"
+ version="@VERSION@"
+ plugin-id="rt"
+ plugin-version="@VERSION@"
+ provider-name="Classpath"
+ provider-url="http://classpath.org"
+ license-name="classpath">
+
+ <runtime>
+ <library name="jnode-core.jar">
+ <export name="com.sun.codemodel.internal.*"/>
+ <export name="com.sun.codemodel.internal.fmt.*"/>
+ <export name="com.sun.codemodel.internal.util.*"/>
+ <export name="com.sun.codemodel.internal.writer.*"/>
+ <export name="com.sun.tools.internal.jxc.*"/>
+ <export name="com.sun.tools.internal.jxc.apt.*"/>
+ <export name="com.sun.tools.internal.jxc.gen.config.*"/>
+ <export name="com.sun.tools.internal.jxc.model.nav.*"/>
+ <export name="com.sun.tools.internal.ws.*"/>
+ <export name="com.sun.tools.internal.ws.api.*"/>
+ <export name="com.sun.tools.internal.ws.api.wsdl.*"/>
+ <export name="com.sun.tools.internal.ws.processor.*"/>
+ <export name="com.sun.tools.internal.ws.processor.generator.*"/>
+ <export name="com.sun.tools.internal.ws.processor.model.*"/>
+ <export name="com.sun.tools.internal.ws.processor.model.exporter.*"/>
+ <export name="com.sun.tools.internal.ws.processor.model.java.*"/>
+ <export name="com.sun.tools.internal.ws.processor.model.jaxb.*"/>
+ <export name="com.sun.tools.internal.ws.processor.modeler.*"/>
+ <export name="com.sun.tools.internal.ws.processor.modeler.annotation.*"/>
+ <export name="com.sun.tools.internal.ws.processor.modeler.wsdl.*"/>
+ <export name="com.sun.tools.internal.ws.processor.util.*"/>
+ <export name="com.sun.tools.internal.ws.resources.*"/>
+ <export name="com.sun.tools.internal.ws.spi.*"/>
+ <export name="com.sun.tools.internal.ws.util.*"/>
+ <export name="com.sun.tools.internal.ws.util.xml.*"/>
+ <export name="com.sun.tools.internal.ws.wscompile.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.http.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.jaxws.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.mime.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.schema.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.document.soap.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.framework.*"/>
+ <export name="com.sun.tools.internal.ws.wsdl.parser.*"/>
+ <export name="com.sun.tools.internal.xjc.*"/>
+ <export name="com.sun.tools.internal.xjc.addon.at_generated.*"/>
+ <export name="com.sun.tools.internal.xjc.addon.code_injector.*"/>
+ <export name="com.sun.tools.internal.xjc.addon.episode.*"/>
+ <export name="com.sun.tools.internal.xjc.addon.locator.*"/>
+ <export name="com.sun.tools.internal.xjc.addon.sync.*"/>
+ <export name="com.sun.tools.internal.xjc.api.*"/>
+ <export name="com.sun.tools.internal.xjc.api.impl.j2s.*"/>
+ <export name="com.sun.tools.internal.xjc.api.impl.s2j.*"/>
+ <export name="com.sun.tools.internal.xjc.api.util.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.annotation.ri.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.annotation.spec.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.bean.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.bean.field.*"/>
+ <export name="com.sun.tools.internal.xjc.generator.util.*"/>
+ <export name="com.sun.tools.internal.xjc.model.*"/>
+ <export name="com.sun.tools.internal.xjc.model.nav.*"/>
+ <export name="com.sun.tools.internal.xjc.outline.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.dtd.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.dtd.bindinfo.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.gbind.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.internalizer.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.relaxng.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.xmlschema.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.xmlschema.ct.*"/>
+ <export name="com.sun.tools.internal.xjc.reader.xmlschema.parser.*"/>
+ <export name="com.sun.tools.internal.xjc.runtime.*"/>
+ <export name="com.sun.tools.internal.xjc.util.*"/>
+ <export name="com.sun.tools.internal.xjc.writer.*"/>
+ </library>
+
+ </runtime>
+ <extension point="org.jnode.shell.aliases">
+ <alias name="xjc" class="com.sun.tools.internal.xjc.Driver"/>
+ <alias name="schemagen" class="com.sun.tools.internal.jxc.SchemaGenerator"/>
+ <alias name="wsgen" class="com.sun.tools.internal.ws.WsGen"/>
+ <alias name="wsimport" class="com.sun.tools.internal.ws.WsImport"/>
+ </extension>
+
+ <extension point="org.jnode.security.permissions">
+ <permission class="java.lang.RuntimePermission" name="exitVM"/>
+ <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/>
+ <permission class="java.util.PropertyPermission" name="<<ALL FILES>>" actions="read,write"/>
+ <permission class="java.util.PropertyPermission" name="*" actions="read"/>
+ <permission class="java.lang.RuntimePermission" name="getProtectionDomain"/>
+ <permission class="java.lang.RuntimePermission" name="createClassLoader"/>
+ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/>
+ <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/>
+ <permission class="org.jnode.security.JNodePermission" name="getVmThread"/>
+ <permission class="org.jnode.security.JNodePermission" name="getVmClass"/>
+ <permission class="java.net.SocketPermission" name="*" actions="resolve"/>
+ <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/>
+ <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/>
+ <permission class="java.lang.RuntimePermission" name="readFileDescriptor"/>
+ </extension>
+
+</fragment>
Copied: trunk/core/descriptors/org.classpath.ext.xml.ws.xml (from rev 5064, trunk/core/descriptors/org.classpath.ext.xml.xml)
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml.ws.xml (rev 0)
+++ trunk/core/descriptors/org.classpath.ext.xml.ws.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plugin SYSTEM "jnode.dtd">
+
+<fragment id="org.classpath.ext.xml.ws"
+ name="Classpath javax.xml classes"
+ version="@VERSION@"
+ plugin-id="rt"
+ plugin-version="@VERSION@"
+ provider-name="Classpath"
+ provider-url="http://classpath.org"
+ license-name="classpath">
+
+ <runtime>
+ <library name="jnode-core.jar">
+ <export name="com.sun.activation.registries.*"/>
+ <export name="com.sun.istack.internal.*"/>
+ <export name="com.sun.istack.internal.tools.*"/>
+ <export name="com.sun.istack.internal.ws.*"/>
+ <export name="com.sun.xml.internal.bind.*"/>
+ <export name="com.sun.xml.internal.bind.annotation.*"/>
+ <export name="com.sun.xml.internal.bind.api.*"/>
+ <export name="com.sun.xml.internal.bind.api.impl.*"/>
+ <export name="com.sun.xml.internal.bind.marshaller.*"/>
+ <export name="com.sun.xml.internal.bind.unmarshaller.*"/>
+ <export name="com.sun.xml.internal.bind.util.*"/>
+ <export name="com.sun.xml.internal.bind.v2.*"/>
+ <export name="com.sun.xml.internal.bind.v2.bytecode.*"/>
+ <export name="com.sun.xml.internal.bind.v2.model.annotation.*"/>
+ <export name="com.sun.xml.internal.bind.v2.model.core.*"/>
+ <export name="com.sun.xml.internal.bind.v2.model.impl.*"/>
+ <export name="com.sun.xml.internal.bind.v2.model.nav.*"/>
+ <export name="com.sun.xml.internal.bind.v2.model.runtime.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.output.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.property.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.reflect.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.reflect.opt.*"/>
+ <export name="com.sun.xml.internal.bind.v2.runtime.unmarshaller.*"/>
+ <export name="com.sun.xml.internal.bind.v2.schemagen.*"/>
+ <export name="com.sun.xml.internal.bind.v2.schemagen.episode.*"/>
+ <export name="com.sun.xml.internal.bind.v2.schemagen.xmlschema.*"/>
+ <export name="com.sun.xml.internal.bind.v2.util.*"/>
+ <export name="com.sun.xml.internal.dtdparser.*"/>
+ <export name="com.sun.xml.internal.dtdparser.resources.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.algorithm.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.alphabet.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.dom.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.org.apache.xerces.util.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.resources.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.sax.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.stax.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.stax.events.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.stax.factory.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.stax.util.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.tools.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.util.*"/>
+ <export name="com.sun.xml.internal.fastinfoset.vocab.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.client.p2p.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.packaging.mime.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.packaging.mime.internet.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.packaging.mime.util.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.dynamic.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.impl.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.name.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.ver1_1.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.soap.ver1_2.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.util.*"/>
+ <export name="com.sun.xml.internal.messaging.saaj.util.transform.*"/>
+ <export name="com.sun.xml.internal.org.jvnet.fastinfoset.*"/>
+ <export name="com.sun.xml.internal.org.jvnet.fastinfoset.sax.*"/>
+ <export name="com.sun.xml.internal.org.jvnet.fastinfoset.sax.helpers.*"/>
+ <export name="com.sun.xml.internal.org.jvnet.fastinfoset.stax.*"/>
+ <export name="com.sun.xml.internal.org.jvnet.staxex.*"/>
+ <export name="com.sun.xml.internal.rngom.ast.*"/>
+ <export name="com.sun.xml.internal.rngom.ast.builder.*"/>
+ <export name="com.sun.xml.internal.rngom.ast.om.*"/>
+ <export name="com.sun.xml.internal.rngom.ast.util.*"/>
+ <export name="com.sun.xml.internal.rngom.binary.*"/>
+ <export name="com.sun.xml.internal.rngom.binary.visitor.*"/>
+ <export name="com.sun.xml.internal.rngom.digested.*"/>
+ <export name="com.sun.xml.internal.rngom.dt.*"/>
+ <export name="com.sun.xml.internal.rngom.dt.builtin.*"/>
+ <export name="com.sun.xml.internal.rngom.nc.*"/>
+ <export name="com.sun.xml.internal.rngom.parse.*"/>
+ <export name="com.sun.xml.internal.rngom.parse.compact.*"/>
+ <export name="com.sun.xml.internal.rngom.parse.host.*"/>
+ <export name="com.sun.xml.internal.rngom.parse.xml.*"/>
+ <export name="com.sun.xml.internal.rngom.util.*"/>
+ <export name="com.sun.xml.internal.rngom.xml.sax.*"/>
+ <export name="com.sun.xml.internal.rngom.xml.util.*"/>
+ <export name="com.sun.xml.internal.stream.buffer.*"/>
+ <export name="com.sun.xml.internal.stream.buffer.sax.*"/>
+ <export name="com.sun.xml.internal.stream.buffer.stax.*"/>
+ <export name="com.sun.xml.internal.txw2.*"/>
+ <export name="com.sun.xml.internal.txw2.annotation.*"/>
+ <export name="com.sun.xml.internal.txw2.output.*"/>
+ <export name="com.sun.xml.internal.ws.*"/>
+ <export name="com.sun.xml.internal.ws.addressing.*"/>
+ <export name="com.sun.xml.internal.ws.addressing.model.*"/>
+ <export name="com.sun.xml.internal.ws.addressing.v200408.*"/>
+ <export name="com.sun.xml.internal.ws.api.*"/>
+ <export name="com.sun.xml.internal.ws.api.addressing.*"/>
+ <export name="com.sun.xml.internal.ws.api.client.*"/>
+ <export name="com.sun.xml.internal.ws.api.fastinfoset.*"/>
+ <export name="com.sun.xml.internal.ws.api.message.*"/>
+ <export name="com.sun.xml.internal.ws.api.message.stream.*"/>
+ <export name="com.sun.xml.internal.ws.api.model.*"/>
+ <export name="com.sun.xml.internal.ws.api.model.soap.*"/>
+ <export name="com.sun.xml.internal.ws.api.model.wsdl.*"/>
+ <export name="com.sun.xml.internal.ws.api.pipe.*"/>
+ <export name="com.sun.xml.internal.ws.api.pipe.helper.*"/>
+ <export name="com.sun.xml.internal.ws.api.server.*"/>
+ <export name="com.sun.xml.internal.ws.api.streaming.*"/>
+ <export name="com.sun.xml.internal.ws.api.wsdl.parser.*"/>
+ <export name="com.sun.xml.internal.ws.api.wsdl.writer.*"/>
+ <export name="com.sun.xml.internal.ws.binding.*"/>
+ <export name="com.sun.xml.internal.ws.client.*"/>
+ <export name="com.sun.xml.internal.ws.client.dispatch.*"/>
+ <export name="com.sun.xml.internal.ws.client.dispatch.impl.*"/>
+ <export name="com.sun.xml.internal.ws.client.sei.*"/>
+ <export name="com.sun.xml.internal.ws.developer.*"/>
+ <export name="com.sun.xml.internal.ws.encoding.*"/>
+ <export name="com.sun.xml.internal.ws.encoding.fastinfoset.*"/>
+ <export name="com.sun.xml.internal.ws.encoding.soap.*"/>
+ <export name="com.sun.xml.internal.ws.encoding.soap.streaming.*"/>
+ <export name="com.sun.xml.internal.ws.encoding.xml.*"/>
+ <export name="com.sun.xml.internal.ws.fault.*"/>
+ <export name="com.sun.xml.internal.ws.handler.*"/>
+ <export name="com.sun.xml.internal.ws.message.*"/>
+ <export name="com.sun.xml.internal.ws.message.jaxb.*"/>
+ <export name="com.sun.xml.internal.ws.message.saaj.*"/>
+ <export name="com.sun.xml.internal.ws.message.source.*"/>
+ <export name="com.sun.xml.internal.ws.message.stream.*"/>
+ <export name="com.sun.xml.internal.ws.model.*"/>
+ <export name="com.sun.xml.internal.ws.model.soap.*"/>
+ <export name="com.sun.xml.internal.ws.model.wsdl.*"/>
+ <export name="com.sun.xml.internal.ws.protocol.soap.*"/>
+ <export name="com.sun.xml.internal.ws.protocol.xml.*"/>
+ <export name="com.sun.xml.internal.ws.resources.*"/>
+ <export name="com.sun.xml.internal.ws.server.*"/>
+ <export name="com.sun.xml.internal.ws.server.provider.*"/>
+ <export name="com.sun.xml.internal.ws.server.sei.*"/>
+ <export name="com.sun.xml.internal.ws.spi.*"/>
+ <export name="com.sun.xml.internal.ws.streaming.*"/>
+ <export name="com.sun.xml.internal.ws.transport.*"/>
+ <export name="com.sun.xml.internal.ws.transport.http.*"/>
+ <export name="com.sun.xml.internal.ws.transport.http.client.*"/>
+ <export name="com.sun.xml.internal.ws.transport.http.server.*"/>
+ <export name="com.sun.xml.internal.ws.util.*"/>
+ <export name="com.sun.xml.internal.ws.util.exception.*"/>
+ <export name="com.sun.xml.internal.ws.util.localization.*"/>
+ <export name="com.sun.xml.internal.ws.util.pipe.*"/>
+ <export name="com.sun.xml.internal.ws.util.resources.*"/>
+ <export name="com.sun.xml.internal.ws.util.xml.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.parser.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.document.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.document.http.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.document.soap.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.document.soap12.*"/>
+ <export name="com.sun.xml.internal.ws.wsdl.writer.document.xsd.*"/>
+ <export name="com.sun.xml.internal.xsom.*"/>
+ <export name="com.sun.xml.internal.xsom.impl.*"/>
+ <export name="com.sun.xml.internal.xsom.impl.parser.*"/>
+ <export name="com.sun.xml.internal.xsom.impl.parser.state.*"/>
+ <export name="com.sun.xml.internal.xsom.impl.scd.*"/>
+ <export name="com.sun.xml.internal.xsom.impl.util.*"/>
+ <export name="com.sun.xml.internal.xsom.parser.*"/>
+ <export name="com.sun.xml.internal.xsom.util.*"/>
+ <export name="com.sun.xml.internal.xsom.visitor.*"/>
+ <export name="javax.jws.*"/>
+ <export name="javax.jws.soap.*"/>
+ <export name="javax.xml.bind.*"/>
+ <export name="javax.xml.bind.annotation.*"/>
+ <export name="javax.xml.bind.annotation.adapters.*"/>
+ <export name="javax.xml.bind.attachment.*"/>
+ <export name="javax.xml.bind.helpers.*"/>
+ <export name="javax.xml.bind.util.*"/>
+ <export name="javax.xml.soap.*"/>
+ <export name="javax.xml.ws.*"/>
+ <export name="javax.xml.ws.handler.*"/>
+ <export name="javax.xml.ws.handler.soap.*"/>
+ <export name="javax.xml.ws.http.*"/>
+ <export name="javax.xml.ws.soap.*"/>
+ <export name="javax.xml.ws.spi.*"/>
+ <export name="javax.xml.ws.wsaddressing.*"/>
+
+ </library>
+ </runtime>
+
+</fragment>
Modified: trunk/core/descriptors/org.classpath.ext.xml.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml.xml 2009-02-26 21:41:23 UTC (rev 5065)
+++ trunk/core/descriptors/org.classpath.ext.xml.xml 2009-02-26 21:53:20 UTC (rev 5066)
@@ -114,18 +114,6 @@
<export name="com.sun.org.apache.xpath.internal.patterns.*"/>
<export name="com.sun.org.apache.xpath.internal.res.*"/>
- <!--
- <export name="com.sun.xml.internal.bind.*"/>
- <export name="com.sun.xml.internal.bind.annotation.*"/>
- <export name="com.sun.xml.internal.bind.api.*"/>
- <export name="com.sun.xml.internal.bind.api.impl.*"/>
- <export name="com.sun.xml.internal.bind.marshaller.*"/>
- <export name="com.sun.xml.internal.bind.unmarshaller.*"/>
- <export name="com.sun.xml.internal.bind.util.*"/>
- <export name="com.sun.xml.internal.bind.v2.*"/>
- <export name="com.sun.xml.internal.bind.v2.bytecode.*"/>
- <export name="com.sun.xml.internal.bind.v2.model.*"/>
- -->
<export name="com.sun.xml.internal.stream.*"/>
<export name="com.sun.xml.internal.stream.dtd.*"/>
<export name="com.sun.xml.internal.stream.dtd.nonvalidating.*"/>
@@ -135,12 +123,6 @@
<export name="com.sun.xml.internal.stream.*"/>
<export name="javax.xml.*"/>
- <export name="javax.xml.bind.*"/>
- <export name="javax.xml.bind.annotation.*"/>
- <export name="javax.xml.bind.annotation.adapters.*"/>
- <export name="javax.xml.bind.attachment.*"/>
- <export name="javax.xml.bind.helpers.*"/>
- <export name="javax.xml.bind.util.*"/>
<export name="javax.xml.crypto.*"/>
<export name="javax.xml.crypto.dom.*"/>
<export name="javax.xml.crypto.dsig.*"/>
@@ -149,16 +131,9 @@
<export name="javax.xml.crypto.dsig.spec.*"/>
<export name="javax.xml.datatype.*"/>
<export name="javax.xml.namespace.*"/>
- <export name="javax.xml.soap.*"/>
<export name="javax.xml.transform.sax.*"/>
<export name="javax.xml.transform.stax.*"/>
<export name="javax.xml.validation.*"/>
- <export name="javax.xml.ws.*"/>
- <export name="javax.xml.ws.handler.*"/>
- ...
[truncated message content] |
|
From: <ls...@us...> - 2009-02-28 18:59:13
|
Revision: 5073
http://jnode.svn.sourceforge.net/jnode/?rev=5073&view=rev
Author: lsantha
Date: 2009-02-28 18:59:06 +0000 (Sat, 28 Feb 2009)
Log Message:
-----------
Reduced code duplication in plugins.
Modified Paths:
--------------
trunk/core/descriptors/com.sun.tools.javac.xml
trunk/core/descriptors/javax.ext.tools.xml
trunk/core/descriptors/org.classpath.core.xml
trunk/core/descriptors/org.classpath.ext.core.xml
trunk/core/descriptors/org.classpath.ext.security.xml
trunk/core/descriptors/org.classpath.ext.xml
trunk/shell/descriptors/org.jnode.shell.command.debug.xml
Modified: trunk/core/descriptors/com.sun.tools.javac.xml
===================================================================
--- trunk/core/descriptors/com.sun.tools.javac.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/com.sun.tools.javac.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -9,6 +9,9 @@
provider-url="http://sun.com"
license-name="classpath">
+ <requires>
+ <import plugin="javax.ext.tools"/>
+ </requires>
<runtime>
<library name="jnode-core.jar">
<export name="com.sun.mirror.apt.*"/>
Modified: trunk/core/descriptors/javax.ext.tools.xml
===================================================================
--- trunk/core/descriptors/javax.ext.tools.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/javax.ext.tools.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -10,9 +10,12 @@
provider-url="http://sun.com"
license-name="classpath">
+ <requires>
+ <import plugin="org.classpath.ext.core"/>
+ </requires>
+
<runtime>
<library name="jnode-core.jar">
- <export name="javax.annotation.*"/>
<export name="javax.annotation.processing.*"/>
<export name="javax.lang.model.*"/>
<export name="javax.lang.model.element.*"/>
Modified: trunk/core/descriptors/org.classpath.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.core.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/org.classpath.core.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -41,8 +41,6 @@
<export name="sun.nio.ByteBuffered"/>
<export name="sun.nio.ch.Interruptible"/>
<export name="sun.security.acl.GroupImpl"/>
- <export name="sun.security.util.Debug"/>
- <export name="sun.security.util.SecurityConstants"/>
<export name="sun.security.action.*"/>
<export name="sun.security.jca.*"/>
<export name="sun.security.pkcs.ParsingException"/>
@@ -59,30 +57,13 @@
<export name="sun.text.*"/>
<export name="sun.text.normalizer.*"/>
- <export name="sun.text.resources.BreakIteratorInfo"/>
- <export name="sun.text.resources.BreakIteratorRules"/>
- <export name="sun.text.resources.CollationData"/>
- <export name="sun.text.resources.FormatData"/>
+ <export name="sun.text.resources.*"/>
<export name="sun.util.calendar.*"/>
<export name="sun.util.*"/>
- <export name="sun.util.resources.LocaleData"/>
- <export name="sun.util.resources.LocaleNames"/>
- <export name="sun.util.resources.LocaleNamesBundle"/>
- <export name="sun.util.resources.OpenListResourceBundle"/>
- <export name="sun.util.resources.CalendarData"/>
- <export name="sun.util.resources.CurrencyNames"/>
- <export name="sun.util.resources.TimeZoneNames"/>
+ <export name="sun.util.resources.*"/>
- <export name="gnu.classpath.Configuration"/>
- <export name="gnu.classpath.Pointer"/>
- <export name="gnu.classpath.SystemProperties"/>
- <export name="gnu.classpath.VMSystemProperties"/>
- <export name="gnu.classpath.VMStackWalker"/>
- <export name="gnu.classpath.ServiceFactory"/>
- <export name="gnu.classpath.ServiceFactory$ServiceIterator"/>
- <export name="gnu.classpath.ServiceProviderLoadingAction"/>
-
+ <export name="gnu.classpath.*"/>
<export name="gnu.classpath.debug.*"/>
<export name="gnu.java.io.*"/>
@@ -170,17 +151,10 @@
<export name="javax.crypto.*"/>
<export name="javax.crypto.interfaces.*"/>
<export name="javax.crypto.spec.*"/>
- <export name="javax.security.auth.AuthPermission"/>
- <export name="javax.security.auth.Destroyable"/>
- <export name="javax.security.auth.DestroyFailedException"/>
- <export name="javax.security.auth.Subject"/>
- <export name="javax.security.auth.callback.Callback"/>
- <export name="javax.security.auth.callback.CallbackHandler"/>
- <export name="javax.security.auth.callback.PasswordCallback"/>
- <export name="javax.security.auth.callback.UnsupportedCallbackException"/>
- <export name="javax.security.auth.login.LoginException"/>
- <export name="javax.security.auth.login.Configuration$Parameters"/>
- <export name="javax.security.auth.login.Configuration"/>
+
+ <export name="javax.security.auth.*"/>
+ <export name="javax.security.auth.callback.*"/>
+ <export name="javax.security.auth.login.*"/>
<export name="javax.security.auth.x500.*"/>
<export name="org.xml.sax.*"/>
Modified: trunk/core/descriptors/org.classpath.ext.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.core.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/org.classpath.ext.core.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -15,23 +15,11 @@
<export name="com.sun.media.sound.*"/>
- <export name="gnu.classpath.*"/>
-
- <export name="gnu.classpath.jdwp.*"/>
- <export name="gnu.classpath.jdwp.event.*"/>
- <export name="gnu.classpath.jdwp.event.filters.*"/>
- <export name="gnu.classpath.jdwp.exception.*"/>
- <export name="gnu.classpath.jdwp.id.*"/>
- <export name="gnu.classpath.jdwp.processor.*"/>
- <export name="gnu.classpath.jdwp.transport.*"/>
- <export name="gnu.classpath.jdwp.util.*"/>
-
<export name="gnu.java.awt.*"/>
<export name="gnu.java.awt.color.*"/>
<export name="gnu.java.awt.peer.*"/>
<export name="gnu.java.awt.java2d.*"/>
<export name="gnu.java.awt.print.*"/>
- <export name="gnu.java.lang.reflect.*"/>
<export name="gnu.java.net.protocol.*"/>
<export name="gnu.java.net.protocol.file.*"/>
<export name="gnu.java.net.protocol.ftp.*"/>
@@ -86,12 +74,6 @@
<export name="javax.activation.*"/>
<export name="javax.activity.*"/>
<export name="javax.annotation.*"/>
- <export name="javax.annotation.processing.*"/>
- <export name="javax.lang.model.*"/>
- <export name="javax.lang.model.element.*"/>
- <export name="javax.lang.model.type.*"/>
- <export name="javax.lang.model.util.*"/>
- <export name="javax.management.*"/>
<export name="javax.naming.directory.*"/>
<export name="javax.naming.event.*"/>
<export name="javax.naming.ldap.*"/>
@@ -105,8 +87,6 @@
<export name="javax.script.*"/>
- <export name="javax.tools.*"/>
-
<export name="sun.audio.*"/>
<export name="sun.net.*"/>
@@ -119,11 +99,6 @@
<export name="sun.net.spi.nameservice.dns.META-INF.services.*"/>
<export name="sun.security.*"/>
- <export name="sun.security.util.*"/>
-
- <export name="sun.reflect.misc.*"/>
- <export name="sun.text.resources.*"/>
- <export name="sun.util.resources.*"/>
</library>
</runtime>
Modified: trunk/core/descriptors/org.classpath.ext.security.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.security.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/org.classpath.ext.security.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -12,7 +12,6 @@
<runtime>
<library name="jnode-core.jar">
- <export name="sun.security.util.*"/>
<export name="sun.security.tools.*"/>
<export name="sun.security.timestamp.*"/>
<export name="sun.security.acl.*"/>
@@ -20,7 +19,6 @@
<export name="sun.security.internal.interfaces*"/>
<export name="sun.security.internal.spec*"/>
<export name="sun.security.internal.*"/>
- <export name="sun.security.jca.*"/>
<export name="sun.security.jgss.*"/>
<export name="sun.security.jgss.krb5.*"/>
<export name="sun.security.jgss.spi.*"/>
Modified: trunk/core/descriptors/org.classpath.ext.xml
===================================================================
--- trunk/core/descriptors/org.classpath.ext.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/core/descriptors/org.classpath.ext.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -13,9 +13,6 @@
<runtime>
<library name="jnode-core.jar">
<export name="javax.security.*"/>
- <export name="javax.security.auth.*"/>
- <export name="javax.security.auth.callback.*"/>
- <export name="javax.security.auth.login.*"/>
<export name="javax.security.auth.spi.*"/>
<export name="javax.security.auth.kerberos.*"/>
<export name="javax.security.cert.*"/>
Modified: trunk/shell/descriptors/org.jnode.shell.command.debug.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.command.debug.xml 2009-02-28 18:42:21 UTC (rev 5072)
+++ trunk/shell/descriptors/org.jnode.shell.command.debug.xml 2009-02-28 18:59:06 UTC (rev 5073)
@@ -10,6 +10,7 @@
<requires>
<import plugin="org.jnode.debug"/>
<import plugin="org.jnode.shell.help"/>
+ <import plugin="org.classpath.ext.jdwp"/>
</requires>
<runtime>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2009-03-08 10:02:19
|
Revision: 5094
http://jnode.svn.sourceforge.net/jnode/?rev=5094&view=rev
Author: fduminy
Date: 2009-03-08 10:02:17 +0000 (Sun, 08 Mar 2009)
Log Message:
-----------
fixed build process to support multiple versions of a library (aka 2 plugins with the same id but with a different version)
Modified Paths:
--------------
trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java
trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java
trunk/builder/src/builder/org/jnode/build/PluginList.java
trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java
trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java
trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java
trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java
trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java
Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -407,7 +407,7 @@
try {
log("plugin-list: " + getPluginListFile(), Project.MSG_DEBUG);
piList = getPluginList();
- memMgrPluginURL = piList.createPluginURL(memMgrPluginId);
+ memMgrPluginURL = piList.createPluginURL(memMgrPluginId, version);
lmPI = Math.max(piList.lastModified(), memMgrPluginURL.openConnection().getLastModified());
} catch (PluginException ex) {
throw new BuildException(ex);
Modified: trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -24,9 +24,11 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.apache.tools.ant.Project;
@@ -188,20 +190,49 @@
*/
protected void testPluginPrerequisites(List<PluginJar> pluginJars)
throws BuildException {
- final HashSet<String> ids = new HashSet<String>();
-
+ final Map<String, List<String>> idToVersions = new HashMap<String, List<String>>();
+
+ // get all couples (id, version) in idToVersions
for (PluginJar piJar : pluginJars) {
final PluginDescriptor descr = piJar.getDescriptor();
- ids.add(descr.getId());
+
+ List<String> versions = idToVersions.get(descr.getId());
+ if (versions == null) {
+ versions = new ArrayList<String>();
+ idToVersions.put(descr.getId(), versions);
+ }
+
+ versions.add(descr.getVersion());
}
+
+ // now, check that each dependency is satisfied
for (PluginJar piJar : pluginJars) {
final PluginDescriptor descr = piJar.getDescriptor();
final PluginPrerequisite[] prereqs = descr.getPrerequisites();
+
for (int j = 0; j < prereqs.length; j++) {
- if (!ids.contains(prereqs[j].getPluginId())) {
+ PluginPrerequisite required = prereqs[j];
+ List<String> versions = idToVersions.get(required.getPluginId());
+
+ boolean versionSpecified = (required.getPluginVersion() == null);
+
+ boolean satisfied = false;
+ if (versions != null) {
+ satisfied = !versionSpecified ||
+ versions.contains(required.getPluginVersion());
+ }
+
+ if (!satisfied) {
+ String reqVersionStr = versionSpecified ? "" : " version " +
+ required.getPluginVersion();
+
+ String versionStr = (descr.getVersion() == null) ? "" : " version " +
+ descr.getVersion();
+
throw new BuildException("Cannot find plugin "
- + prereqs[j].getPluginId()
- + ", which is required by " + descr.getId());
+ + required.getPluginId() + reqVersionStr
+ + ", which is required by " + descr.getId()
+ + versionStr);
}
}
}
Modified: trunk/builder/src/builder/org/jnode/build/PluginList.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/PluginList.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/builder/src/builder/org/jnode/build/PluginList.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -90,8 +90,12 @@
throw new PluginException("id attribute expected on "
+ e.getName());
}
+
+ // version attribute is optional
+ // if not specified, then the latest version found will be used.
+ final String version = e.getStringAttribute("version");
- addPlugin(descrList, pluginList, id);
+ addPlugin(descrList, pluginList, id, version);
} else if (e.getName().equals("manifest")) {
manifest = parseManifest(e);
} else if (e.getName().equals("include")) {
@@ -103,39 +107,76 @@
}
}
- public void addPlugin(String id) throws MalformedURLException, PluginException {
- addPlugin(descrList, pluginList, id);
+ /**
+ *
+ * @param id
+ * @param version optional
+ * @throws MalformedURLException
+ * @throws PluginException
+ */
+ public void addPlugin(String id, String version) throws MalformedURLException, PluginException {
+ addPlugin(descrList, pluginList, id, version);
}
- private void addPlugin(List<URL> descrList, List<URL> pluginList, String id)
+ /**
+ *
+ * @param descrList
+ * @param pluginList
+ * @param id
+ * @param version optional parameter
+ * @throws MalformedURLException
+ * @throws PluginException
+ */
+ private void addPlugin(List<URL> descrList, List<URL> pluginList, String id, String version)
throws MalformedURLException, PluginException {
- final File f = findPlugin(defaultDir, id);
+ final File f = findPlugin(defaultDir, id, version);
final URL pluginUrl = f.toURL();
final URL descrUrl = new URL("jar:" + pluginUrl + "!/plugin.xml");
-
+
if (pluginList.contains(pluginUrl)) {
- throw new PluginException("can't use the same id(" + id + ") for multiple plugins");
+ String versionStr = (version == null) ? "unspecified" : version;
+ throw new PluginException("can't use the same id(" + id +
+ ") and version(" + versionStr + ") for multiple plugins");
}
descrList.add(descrUrl);
pluginList.add(pluginUrl);
}
- private File findPlugin(File dir, final String id) {
+ private File findPlugin(File dir, final String id, String version) {
// System.out.println("Find " + id + " in " + dir);
+ final String begin = id + "_";
+ final String end = ".jar";
+
String[] names = dir.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
- return name.startsWith(id + "_") && name.endsWith(".jar");
+ return name.startsWith(begin) && name.endsWith(end);
}
});
if (names.length == 0) {
throw new IllegalArgumentException("Cannot find plugin " + id
+ " in " + dir + " for list " + this.name);
- } else {
- Arrays.sort(names);
- return new File(dir, names[names.length - 1]);
}
+
+ String filename = null;
+ if (version != null) {
+ // version specified, try to find it
+ for (String name : names) {
+ String v = name.substring(begin.length(), name.length() - end.length());
+ if (version.equals(v)) {
+ filename = name; // found exact version
+ break;
+ }
+ }
+ }
+
+ if (filename == null) {
+ // by default, take the latest version
+ filename = names[names.length - 1];
+ }
+
+ return new File(dir, filename);
}
private Manifest parseManifest(XMLElement me) throws PluginException {
@@ -239,11 +280,11 @@
}
/**
- * Create an URL to a plugin with a given id.
+ * Create an URL to a plugin with a given id and version.
*/
- public final URL createPluginURL(String id) {
+ public final URL createPluginURL(String id, String version) {
try {
- return findPlugin(defaultDir, id).toURL();
+ return findPlugin(defaultDir, id, version).toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
Modified: trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -49,7 +49,7 @@
if (isEnabled()) {
for (String pluginId : readPluginIds(list.getName())) {
log("Adding user plugin " + pluginId + " to " + list.getName(), Project.MSG_INFO);
- list.addPlugin(pluginId);
+ list.addPlugin(pluginId, null);
}
} else {
log("PluginListInsertor is disabled", Project.MSG_INFO);
Modified: trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java
===================================================================
--- trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -80,8 +80,14 @@
* @return the version
*/
public abstract String getVersion();
-
+
/**
+ * Get the plugin reference, something that uniquely identify a plugin (id + version)
+ * @return
+ */
+ public PluginReference getPluginReference();
+
+ /**
* Gets the required imports.
*
* @return the required imports
Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java
===================================================================
--- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -38,6 +38,7 @@
import org.jnode.plugin.PluginDescriptorListener;
import org.jnode.plugin.PluginException;
import org.jnode.plugin.PluginPrerequisite;
+import org.jnode.plugin.PluginReference;
import org.jnode.plugin.Runtime;
import org.jnode.system.BootLog;
import org.jnode.util.BootableArrayList;
@@ -106,6 +107,8 @@
private final String version;
private final int priority;
+
+ private PluginReference reference;
/**
* Create a new instance
@@ -529,6 +532,17 @@
public String getVersion() {
return version;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public PluginReference getPluginReference() {
+ if (reference == null) {
+ // lazy creation
+ reference = new PluginReference(id, version);
+ }
+ return reference;
+ }
/**
* Does this plugin have a custom plugin class specified?
Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java
===================================================================
--- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -435,7 +435,7 @@
}
// Now remove it
- unloadedIds.add(new PluginReference(descr.getId(), descr.getVersion()));
+ unloadedIds.add(descr.getPluginReference());
descr.unresolve(this);
}
}
Modified: trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java
===================================================================
--- trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java 2009-03-08 09:22:32 UTC (rev 5093)
+++ trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java 2009-03-08 10:02:17 UTC (rev 5094)
@@ -30,6 +30,7 @@
import org.jnode.plugin.PluginDescriptorListener;
import org.jnode.plugin.PluginException;
import org.jnode.plugin.PluginPrerequisite;
+import org.jnode.plugin.PluginReference;
import org.jnode.plugin.Runtime;
/**
@@ -158,4 +159,8 @@
// TODO Auto-generated method stub
}
+
+ public PluginReference getPluginReference() {
+ return null;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-03-13 20:11:36
|
Revision: 5099
http://jnode.svn.sourceforge.net/jnode/?rev=5099&view=rev
Author: lsantha
Date: 2009-03-13 20:11:26 +0000 (Fri, 13 Mar 2009)
Log Message:
-----------
OpenJDK integration.
Modified Paths:
--------------
trunk/all/conf/openjdk-annotations.properties
trunk/core/src/classpath/vm/java/lang/Thread.java
Added Paths:
-----------
trunk/core/src/openjdk/java/java/lang/InheritableThreadLocal.java
trunk/core/src/openjdk/java/java/lang/ThreadLocal.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/lang/InheritableThreadLocal.java
trunk/core/src/classpath/java/java/lang/ThreadLocal.java
Modified: trunk/all/conf/openjdk-annotations.properties
===================================================================
--- trunk/all/conf/openjdk-annotations.properties 2009-03-13 20:07:21 UTC (rev 5098)
+++ trunk/all/conf/openjdk-annotations.properties 2009-03-13 20:11:26 UTC (rev 5099)
@@ -5,16 +5,17 @@
# package/className.class=<annotations list separated by a ','>
# supported annotations : SharedStatics, MagicPermission
-java/lang/Throwable.class=MagicPermission
-java/util/Currency.class=SharedStatics
-sun/misc/SharedSecrets.class=SharedStatics
-sun/misc/Unsafe.class=SharedStatics
java/awt/EventQueue.class=SharedStatics
+java/awt/image/DataBuffer.class=SharedStatics
java/awt/KeyboardFocusManager.class=SharedStatics
java/awt/Toolkit.class=SharedStatics
+java/lang/ThreadLocal.class=SharedStatics
+java/lang/Throwable.class=MagicPermission
+java/util/Currency.class=SharedStatics
+java/util/concurrent/locks/LockSupport.class=SharedStatics
sun/awt/AppContext.class=SharedStatics
sun/awt/AWTAutoShutdown.class=SharedStatics
sun/awt/image/SunWritableRaster.class=SharedStatics
sun/java2d/Disposer.class=SharedStatics
-java/awt/image/DataBuffer.class=SharedStatics
-java/util/concurrent/locks/LockSupport.class=SharedStatics
+sun/misc/SharedSecrets.class=SharedStatics
+sun/misc/Unsafe.class=SharedStatics
Deleted: trunk/core/src/classpath/java/java/lang/InheritableThreadLocal.java
===================================================================
--- trunk/core/src/classpath/java/java/lang/InheritableThreadLocal.java 2009-03-13 20:07:21 UTC (rev 5098)
+++ trunk/core/src/classpath/java/java/lang/InheritableThreadLocal.java 2009-03-13 20:11:26 UTC (rev 5099)
@@ -1,119 +0,0 @@
-/* InheritableThreadLocal -- a ThreadLocal which inherits values across threads
- Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.lang;
-
-import java.util.Iterator;
-import java.util.WeakHashMap;
-
-/**
- * A ThreadLocal whose value is inherited by child Threads. The value of the
- * InheritableThreadLocal associated with the (parent) Thread is copied to
- * the new (child) Thread at the moment of creation.
- *
- * <p>It is possible to make the value associated with the child Thread a
- * function of the value that is associated with the parent Thread by
- * overriding the <code>childValue()</code> method. The utility of this class
- * is in transferring items like User ID or Transaction ID across threads
- * automatically.
- *
- * @author Mark Wielaard (ma...@kl...)
- * @author Eric Blake (eb...@em...)
- * @author Tom Tromey (tr...@re...)
- * @author Andrew John Hughes (gnu...@me...)
- * @see ThreadLocal
- * @since 1.2
- * @status updated to 1.4
- */
-public class InheritableThreadLocal<T> extends ThreadLocal<T>
-{
-
- /**
- * Creates a new InheritableThreadLocal that has no values associated
- * with it yet.
- */
- public InheritableThreadLocal()
- {
- }
-
- /**
- * Determines the value associated with a newly created child Thread as a
- * function of the value associated with the currently executing (parent)
- * Thread. The default implementation just returns the parentValue.
- *
- * @param parentValue the value of this object in the parent thread at
- * the moment of creation of the child
- * @return the initial value for the child thread
- */
- protected Object childValue(Object parentValue)
- {
- return parentValue;
- }
-
- /**
- * Generates the childValues of all <code>InheritableThreadLocal</code>s
- * that are in the heritage of the current Thread for the newly created
- * childThread. Should be called from the contructor Thread.
- *
- * @param childThread the newly created thread, to inherit from this thread
- * @see Thread#Thread(ThreadGroup, Runnable, String)
- */
- static void newChildThread(Thread childThread)
- {
- // The currentThread is the parent of the new thread.
- Thread parentThread = Thread.currentThread();
- if (parentThread.locals != null)
- {
- Iterator keys = parentThread.locals.keySet().iterator();
- while (keys.hasNext())
- {
- ThreadLocal.Key key = (ThreadLocal.Key)keys.next();
- if (key.get() instanceof InheritableThreadLocal)
- {
- InheritableThreadLocal local = (InheritableThreadLocal)key.get();
- Object parentValue = parentThread.locals.get(key);
- Object childValue = local.childValue(parentValue == NULL
- ? null : parentValue);
- if (childThread.locals == null)
- childThread.locals = new WeakHashMap();
- childThread.locals.put(key, (childValue == null
- ? NULL : childValue));
- }
- }
- }
- }
-}
Deleted: trunk/core/src/classpath/java/java/lang/ThreadLocal.java
===================================================================
--- trunk/core/src/classpath/java/java/lang/ThreadLocal.java 2009-03-13 20:07:21 UTC (rev 5098)
+++ trunk/core/src/classpath/java/java/lang/ThreadLocal.java 2009-03-13 20:11:26 UTC (rev 5099)
@@ -1,181 +0,0 @@
-/* ThreadLocal -- a variable with a unique value per thread
- Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.lang;
-
-import java.util.Map;
-
-
-/**
- * ThreadLocal objects have a different state associated with every
- * Thread that accesses them. Every access to the ThreadLocal object
- * (through the <code>get()</code> and <code>set()</code> methods)
- * only affects the state of the object as seen by the currently
- * executing Thread.
- *
- * <p>The first time a ThreadLocal object is accessed on a particular
- * Thread, the state for that Thread's copy of the local variable is set by
- * executing the method <code>initialValue()</code>.
- * </p>
- *
- * <p>An example how you can use this:
- * </p>
- *
- * <pre>
- * class Connection
- * {
- * private static ThreadLocal owner = new ThreadLocal()
- * {
- * public Object initialValue()
- * {
- * return("nobody");
- * }
- * };
- * ...
- * }
- * </pre>
- *
- * <p>Now all instances of connection can see who the owner of the currently
- * executing Thread is by calling <code>owner.get()</code>. By default any
- * Thread would be associated with 'nobody'. But the Connection object could
- * offer a method that changes the owner associated with the Thread on
- * which the method was called by calling <code>owner.put("somebody")</code>.
- * (Such an owner changing method should then be guarded by security checks.)
- * </p>
- *
- * <p>When a Thread is garbage collected all references to values of
- * the ThreadLocal objects associated with that Thread are removed.
- * </p>
- *
- * @author Mark Wielaard (ma...@kl...)
- * @author Eric Blake (eb...@em...)
- * @since 1.2
- * @status updated to 1.5
- */
-public class ThreadLocal<T>
-{
- /**
- * Placeholder to distinguish between uninitialized and null set by the
- * user. Do not expose this to the public. Package visible for use by
- * InheritableThreadLocal
- */
- static final Object NULL = new Object();
-
- /**
- * Serves as a key for the Thread.locals WeakHashMap.
- * We can't use "this", because a subclass may override equals/hashCode
- * and we need to use object identity for the map.
- */
- final Key key = new Key();
-
- class Key
- {
- ThreadLocal get()
- {
- return ThreadLocal.this;
- }
- }
-
- /**
- * Creates a ThreadLocal object without associating any value to it yet.
- */
- public ThreadLocal()
- {
- }
-
- /**
- * Called once per thread on the first invocation of get(), if set() was
- * not already called. The default implementation returns <code>null</code>.
- * Often, this method is overridden to create the appropriate initial object
- * for the current thread's view of the ThreadLocal.
- *
- * @return the initial value of the variable in this thread
- */
- protected T initialValue()
- {
- return null;
- }
-
- /**
- * Gets the value associated with the ThreadLocal object for the currently
- * executing Thread. If this is the first time the current thread has called
- * get(), and it has not already called set(), the value is obtained by
- * <code>initialValue()</code>.
- *
- * @return the value of the variable in this thread
- */
- public T get()
- {
- Map map = Thread.getThreadLocals();
- // Note that we don't have to synchronize, as only this thread will
- // ever modify the map.
- Object value = map.get(key);
- if (value == null)
- {
- value = initialValue();
- map.put(key, value == null ? NULL : value);
- }
- return value == NULL ? null : (T) value;
- }
-
- /**
- * Sets the value associated with the ThreadLocal object for the currently
- * executing Thread. This overrides any existing value associated with the
- * current Thread and prevents <code>initialValue()</code> from being
- * called if this is the first access to this ThreadLocal in this Thread.
- *
- * @param value the value to set this thread's view of the variable to
- */
- public void set(T value)
- {
- Map map = Thread.getThreadLocals();
- // Note that we don't have to synchronize, as only this thread will
- // ever modify the map.
- map.put(key, value == null ? NULL : value);
- }
-
- /**
- * Removes the value associated with the ThreadLocal object for the
- * currently executing Thread.
- * @since 1.5
- */
- public void remove()
- {
- Map map = Thread.getThreadLocals();
- map.remove(this);
-}
-}
Modified: trunk/core/src/classpath/vm/java/lang/Thread.java
===================================================================
--- trunk/core/src/classpath/vm/java/lang/Thread.java 2009-03-13 20:07:21 UTC (rev 5098)
+++ trunk/core/src/classpath/vm/java/lang/Thread.java 2009-03-13 20:11:26 UTC (rev 5099)
@@ -39,7 +39,6 @@
package java.lang;
import java.util.Map;
-import java.util.WeakHashMap;
import java.util.HashMap;
@@ -101,7 +100,6 @@
* @see #start()
* @see ThreadLocal
* @since 1.0
- * @status updated to 1.4
*/
@SharedStatics
public class Thread implements Runnable
@@ -141,15 +139,20 @@
private final Thread parent;
/** The default exception handler. */
- private static UncaughtExceptionHandler defaultHandler;
+ private static UncaughtExceptionHandler defaultHandler;
- /** Thread local storage. Package accessible for use by
- * InheritableThreadLocal.
+ /* ThreadLocal values pertaining to this thread. This map is maintained
+ * by the ThreadLocal class. */
+ ThreadLocal.ThreadLocalMap threadLocals = null;
+
+ /*
+ * InheritableThreadLocal values pertaining to this thread. This map is
+ * maintained by the InheritableThreadLocal class.
*/
- WeakHashMap locals;
+ ThreadLocal.ThreadLocalMap inheritableThreadLocals = null;
/** The uncaught exception handler. */
- UncaughtExceptionHandler exceptionHandler;
+ UncaughtExceptionHandler exceptionHandler;
/**
* Name and number of threads created. Used only for generating unique names.
@@ -158,8 +161,7 @@
*/
private static final HashMap<String, Integer> nameMap = new HashMap<String, Integer>();
- private static final JNodePermission GETVMTHREAD_PERM = new JNodePermission(
- "getVmThread");
+ private static final JNodePermission GETVMTHREAD_PERM = new JNodePermission("getVmThread");
/**
* Allocates a new <code>Thread</code> object. This constructor has
@@ -345,8 +347,9 @@
this.vmThread = VmProcessor.current().createThread(this);
this.vmThread.setPriority(current.getPriority());
this.vmThread.updateName();
-
- InheritableThreadLocal.newChildThread(this); // FDy : CLASSPATH patch ?
+
+ if (parent.inheritableThreadLocals != null)
+ this.inheritableThreadLocals = ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
}
/**
@@ -396,7 +399,8 @@
this.vmThread.setPriority(current.getPriority());
this.vmThread.updateName();
- InheritableThreadLocal.newChildThread(this); // FDy : CLASSPATH patch ?
+ if (parent.inheritableThreadLocals != null)
+ this.inheritableThreadLocals = ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
}
/**
@@ -431,8 +435,11 @@
this.vmThread = VmProcessor.current().createThread(isolatedStatics, this);
this.vmThread.setPriority(this.getPriority());
this.vmThread.updateName();
-
- InheritableThreadLocal.newChildThread(this); // FDy : CLASSPATH patch ?
+
+ //todo review it: should thread locals be inherited accorss isolates? Probably not...
+ ThreadLocal.ThreadLocalMap parentLocals = currentThread().inheritableThreadLocals;
+ if (parentLocals != null)
+ this.inheritableThreadLocals = ThreadLocal.createInheritedMap(parentLocals);
}
/**
@@ -1067,19 +1074,6 @@
}
/**
- * Returns the map used by ThreadLocal to store the thread local values.
- */
- static Map getThreadLocals() {
- Thread thread = currentThread();
- Map locals = thread.locals;
- if (locals == null)
- {
- locals = thread.locals = new WeakHashMap();
- }
- return locals;
- }
-
- /**
* Assigns the given <code>UncaughtExceptionHandler</code> to this
* thread. This will then be called if the thread terminates due
* to an uncaught exception, pre-empting that of the
@@ -1213,6 +1207,8 @@
public final void onExit() {
if (vmThread.isStopping()) {
group.remove(this);
+ threadLocals = null;
+ inheritableThreadLocals = null;
}
}
@@ -1466,5 +1462,4 @@
// blocker = b;
// }
}
-
}
Added: trunk/core/src/openjdk/java/java/lang/InheritableThreadLocal.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/InheritableThreadLocal.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/InheritableThreadLocal.java 2009-03-13 20:11:26 UTC (rev 5099)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+import java.lang.ref.*;
+
+/**
+ * This class extends <tt>ThreadLocal</tt> to provide inheritance of values
+ * from parent thread to child thread: when a child thread is created, the
+ * child receives initial values for all inheritable thread-local variables
+ * for which the parent has values. Normally the child's values will be
+ * identical to the parent's; however, the child's value can be made an
+ * arbitrary function of the parent's by overriding the <tt>childValue</tt>
+ * method in this class.
+ *
+ * <p>Inheritable thread-local variables are used in preference to
+ * ordinary thread-local variables when the per-thread-attribute being
+ * maintained in the variable (e.g., User ID, Transaction ID) must be
+ * automatically transmitted to any child threads that are created.
+ *
+ * @author Josh Bloch and Doug Lea
+ * @see ThreadLocal
+ * @since 1.2
+ */
+
+public class InheritableThreadLocal<T> extends ThreadLocal<T> {
+ /**
+ * Computes the child's initial value for this inheritable thread-local
+ * variable as a function of the parent's value at the time the child
+ * thread is created. This method is called from within the parent
+ * thread before the child is started.
+ * <p>
+ * This method merely returns its input argument, and should be overridden
+ * if a different behavior is desired.
+ *
+ * @param parentValue the parent thread's value
+ * @return the child thread's initial value
+ */
+ protected T childValue(T parentValue) {
+ return parentValue;
+ }
+
+ /**
+ * Get the map associated with a ThreadLocal.
+ *
+ * @param t the current thread
+ */
+ ThreadLocalMap getMap(Thread t) {
+ return t.inheritableThreadLocals;
+ }
+
+ /**
+ * Create the map associated with a ThreadLocal.
+ *
+ * @param t the current thread
+ * @param firstValue value for the initial entry of the table.
+ * @param map the map to store.
+ */
+ void createMap(Thread t, T firstValue) {
+ t.inheritableThreadLocals = new ThreadLocalMap(this, firstValue);
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/ThreadLocal.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/ThreadLocal.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/ThreadLocal.java 2009-03-13 20:11:26 UTC (rev 5099)
@@ -0,0 +1,697 @@
+/*
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+import java.lang.ref.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * This class provides thread-local variables. These variables differ from
+ * their normal counterparts in that each thread that accesses one (via its
+ * <tt>get</tt> or <tt>set</tt> method) has its own, independently initialized
+ * copy of the variable. <tt>ThreadLocal</tt> instances are typically private
+ * static fields in classes that wish to associate state with a thread (e.g.,
+ * a user ID or Transaction ID).
+ *
+ * <p>For example, the class below generates unique identifiers local to each
+ * thread.
+ * A thread's id is assigned the first time it invokes <tt>ThreadId.get()</tt>
+ * and remains unchanged on subsequent calls.
+ * <pre>
+ * import java.util.concurrent.atomic.AtomicInteger;
+ *
+ * public class ThreadId {
+ * // Atomic integer containing the next thread ID to be assigned
+ * private static final AtomicInteger nextId = new AtomicInteger(0);
+ *
+ * // Thread local variable containing each thread's ID
+ * private static final ThreadLocal<Integer> threadId =
+ * new ThreadLocal<Integer>() {
+ * @Override protected Integer initialValue() {
+ * return nextId.getAndIncrement();
+ * }
+ * };
+ *
+ * // Returns the current thread's unique ID, assigning it if necessary
+ * public static int get() {
+ * return threadId.get();
+ * }
+ * }
+ * </pre>
+ * <p>Each thread holds an implicit reference to its copy of a thread-local
+ * variable as long as the thread is alive and the <tt>ThreadLocal</tt>
+ * instance is accessible; after a thread goes away, all of its copies of
+ * thread-local instances are subject to garbage collection (unless other
+ * references to these copies exist).
+ *
+ * @author Josh Bloch and Doug Lea
+ * @since 1.2
+ */
+public class ThreadLocal<T> {
+ /**
+ * ThreadLocals rely on per-thread linear-probe hash maps attached
+ * to each thread (Thread.threadLocals and
+ * inheritableThreadLocals). The ThreadLocal objects act as keys,
+ * searched via threadLocalHashCode. This is a custom hash code
+ * (useful only within ThreadLocalMaps) that eliminates collisions
+ * in the common case where consecutively constructed ThreadLocals
+ * are used by the same threads, while remaining well-behaved in
+ * less common cases.
+ */
+ private final int threadLocalHashCode = nextHashCode();
+
+ /**
+ * The next hash code to be given out. Updated atomically. Starts at
+ * zero.
+ */
+//jnode todo: unsing AtomicInteger here breaks the boot process, why?
+// private static AtomicInteger nextHashCode =
+// new AtomicInteger();
+ private static Integer nextHashCode = 0;
+
+ /**
+ * The difference between successively generated hash codes - turns
+ * implicit sequential thread-local IDs into near-optimally spread
+ * multiplicative hash values for power-of-two-sized tables.
+ */
+ private static final int HASH_INCREMENT = 0x61c88647;
+
+ /**
+ * Returns the next hash code.
+ */
+ private static int nextHashCode() {
+// return nextHashCode.getAndAdd(HASH_INCREMENT);
+ return nextHashCode += HASH_INCREMENT;
+ }
+
+ /**
+ * Returns the current thread's "initial value" for this
+ * thread-local variable. This method will be invoked the first
+ * time a thread accesses the variable with the {@link #get}
+ * method, unless the thread previously invoked the {@link #set}
+ * method, in which case the <tt>initialValue</tt> method will not
+ * be invoked for the thread. Normally, this method is invoked at
+ * most once per thread, but it may be invoked again in case of
+ * subsequent invocations of {@link #remove} followed by {@link #get}.
+ *
+ * <p>This implementation simply returns <tt>null</tt>; if the
+ * programmer desires thread-local variables to have an initial
+ * value other than <tt>null</tt>, <tt>ThreadLocal</tt> must be
+ * subclassed, and this method overridden. Typically, an
+ * anonymous inner class will be used.
+ *
+ * @return the initial value for this thread-local
+ */
+ protected T initialValue() {
+ return null;
+ }
+
+ /**
+ * Creates a thread local variable.
+ */
+ public ThreadLocal() {
+ }
+
+ /**
+ * Returns the value in the current thread's copy of this
+ * thread-local variable. If the variable has no value for the
+ * current thread, it is first initialized to the value returned
+ * by an invocation of the {@link #initialValue} method.
+ *
+ * @return the current thread's value of this thread-local
+ */
+ public T get() {
+ Thread t = Thread.currentThread();
+ ThreadLocalMap map = getMap(t);
+ if (map != null) {
+ ThreadLocalMap.Entry e = map.getEntry(this);
+ if (e != null)
+ return (T)e.value;
+ }
+ return setInitialValue();
+ }
+
+ /**
+ * Variant of set() to establish initialValue. Used instead
+ * of set() in case user has overridden the set() method.
+ *
+ * @return the initial value
+ */
+ private T setInitialValue() {
+ T value = initialValue();
+ Thread t = Thread.currentThread();
+ ThreadLocalMap map = getMap(t);
+ if (map != null)
+ map.set(this, value);
+ else
+ createMap(t, value);
+ return value;
+ }
+
+ /**
+ * Sets the current thread's copy of this thread-local variable
+ * to the specified value. Most subclasses will have no need to
+ * override this method, relying solely on the {@link #initialValue}
+ * method to set the values of thread-locals.
+ *
+ * @param value the value to be stored in the current thread's copy of
+ * this thread-local.
+ */
+ public void set(T value) {
+ Thread t = Thread.currentThread();
+ ThreadLocalMap map = getMap(t);
+ if (map != null)
+ map.set(this, value);
+ else
+ createMap(t, value);
+ }
+
+ /**
+ * Removes the current thread's value for this thread-local
+ * variable. If this thread-local variable is subsequently
+ * {@linkplain #get read} by the current thread, its value will be
+ * reinitialized by invoking its {@link #initialValue} method,
+ * unless its value is {@linkplain #set set} by the current thread
+ * in the interim. This may result in multiple invocations of the
+ * <tt>initialValue</tt> method in the current thread.
+ *
+ * @since 1.5
+ */
+ public void remove() {
+ ThreadLocalMap m = getMap(Thread.currentThread());
+ if (m != null)
+ m.remove(this);
+ }
+
+ /**
+ * Get the map associated with a ThreadLocal. Overridden in
+ * InheritableThreadLocal.
+ *
+ ...
[truncated message content] |
|
From: <cr...@us...> - 2009-03-16 14:33:32
|
Revision: 5111
http://jnode.svn.sourceforge.net/jnode/?rev=5111&view=rev
Author: crawley
Date: 2009-03-16 14:33:29 +0000 (Mon, 16 Mar 2009)
Log Message:
-----------
Style fixes
Modified Paths:
--------------
trunk/core/src/core/org/jnode/util/IOUtils.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjornePipeline.java
trunk/shell/src/shell/org/jnode/shell/bjorne/CaseCommandNode.java
trunk/shell/src/shell/org/jnode/shell/bjorne/ForCommandNode.java
trunk/shell/src/shell/org/jnode/shell/bjorne/FunctionDefinitionNode.java
trunk/shell/src/shell/org/jnode/shell/bjorne/IfCommandNode.java
trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java
trunk/shell/src/shell/org/jnode/shell/bjorne/LoopCommandNode.java
trunk/shell/src/shell/org/jnode/shell/io/BaseCommandIO.java
trunk/shell/src/shell/org/jnode/shell/proclet/ProcletProxyInputStream.java
trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
Modified: trunk/core/src/core/org/jnode/util/IOUtils.java
===================================================================
--- trunk/core/src/core/org/jnode/util/IOUtils.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/core/src/core/org/jnode/util/IOUtils.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -27,10 +27,6 @@
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.io.PipedReader;
-import java.io.PipedWriter;
import java.io.Reader;
import java.io.Writer;
import java.lang.reflect.Field;
@@ -38,8 +34,6 @@
import java.security.PrivilegedAction;
import org.apache.log4j.Logger;
-import org.jnode.vm.annotation.DoPrivileged;
-import org.jnode.vm.annotation.PrivilegedActionPragma;
/**
* Common utility code for higher-level operations on IO streams. Notwithstanding the
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjornePipeline.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/BjornePipeline.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjornePipeline.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -17,8 +17,9 @@
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
- package org.jnode.shell.bjorne;
+package org.jnode.shell.bjorne;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/CaseCommandNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/CaseCommandNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/CaseCommandNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -83,12 +83,13 @@
@Override
public CommandThread fork(CommandShell shell, final BjorneContext context)
throws ShellException {
-
+
CommandRunnable cr = new BjorneSubshellRunner(context) {
@Override
public int doRun() throws ShellException {
return CaseCommandNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
}
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/ForCommandNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/ForCommandNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/ForCommandNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -83,7 +83,8 @@
@Override
public int doRun() throws ShellException {
return ForCommandNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
}
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/FunctionDefinitionNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/FunctionDefinitionNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/FunctionDefinitionNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -67,7 +67,8 @@
@Override
public int doRun() throws ShellException {
return FunctionDefinitionNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/IfCommandNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/IfCommandNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/IfCommandNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -94,7 +94,8 @@
@Override
public int doRun() throws ShellException {
return IfCommandNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -112,7 +112,8 @@
@Override
public int doRun() throws ShellException {
return ListCommandNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/LoopCommandNode.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/LoopCommandNode.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/LoopCommandNode.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -98,7 +98,8 @@
@Override
public int doRun() throws ShellException {
return LoopCommandNode.this.execute(context);
- }};
+ }
+ };
return new CommandThreadImpl(cr, context.getName());
}
}
Modified: trunk/shell/src/shell/org/jnode/shell/io/BaseCommandIO.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/io/BaseCommandIO.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/io/BaseCommandIO.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -29,6 +29,11 @@
import org.jnode.util.IOUtils;
import org.jnode.util.ProxyStream;
+/**
+ * Base class for the CommandIO implementations.
+ *
+ * @author cr...@jn...
+ */
abstract class BaseCommandIO implements CommandIO {
private String assignedEncoding;
@@ -86,13 +91,13 @@
}
}
- public synchronized final void close() throws IOException {
+ public final synchronized void close() throws IOException {
doClose();
}
abstract void doClose() throws IOException;
- public synchronized final void flush() throws IOException {
+ public final synchronized void flush() throws IOException {
doFlush();
}
Modified: trunk/shell/src/shell/org/jnode/shell/proclet/ProcletProxyInputStream.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/proclet/ProcletProxyInputStream.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/shell/org/jnode/shell/proclet/ProcletProxyInputStream.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -106,7 +106,7 @@
@Override
public void mark(int readLimit) {
- getRealStream().mark(readLimit);
+ getRealStream().mark(readLimit);
}
@Override
@@ -145,7 +145,8 @@
public InputStream getProxiedStream() throws ProxyStreamException {
ProcletContext procletContext = ProcletContext.currentProcletContext();
- int pid = (procletContext == null) ? ProcletIOContext.GLOBAL_STREAM_ID : procletContext.getPid();
+ int pid = (procletContext == null) ?
+ ProcletIOContext.GLOBAL_STREAM_ID : procletContext.getPid();
InputStream is = streamMap.get(pid);
if (is == null) {
throw new ProxyStreamException(
Modified: trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-03-16 14:17:28 UTC (rev 5110)
+++ trunk/shell/src/test/org/jnode/test/shell/harness/ScriptTestRunner.java 2009-03-16 14:33:29 UTC (rev 5111)
@@ -102,14 +102,14 @@
StringBuffer sb = new StringBuffer(20);
while ((ch = r.read()) != marker) {
switch (ch) {
- case -1:
- throw new TestSpecificationException("Encountered EOF in a " + marker +
- "..." + marker + " sequence in script template");
- case '\n':
- throw new TestSpecificationException("Encountered newline in a " +
- marker + "..." + marker + " sequence in script template");
- default:
- sb.append((char) ch);
+ case -1:
+ throw new TestSpecificationException("Encountered EOF in a " + marker +
+ "..." + marker + " sequence in script template");
+ case '\n':
+ throw new TestSpecificationException("Encountered newline in a " +
+ marker + "..." + marker + " sequence in script template");
+ default:
+ sb.append((char) ch);
}
}
if (sb.length() == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2009-03-18 21:02:45
|
Revision: 5114
http://jnode.svn.sourceforge.net/jnode/?rev=5114&view=rev
Author: lsantha
Date: 2009-03-18 21:02:34 +0000 (Wed, 18 Mar 2009)
Log Message:
-----------
OpenJDK integration.
Modified Paths:
--------------
trunk/all/conf/openjdk-annotations.properties
trunk/core/src/classpath/java/java/net/DatagramSocket.java
trunk/core/src/classpath/java/java/net/ServerSocket.java
trunk/core/src/classpath/java/java/net/Socket.java
Added Paths:
-----------
trunk/core/src/openjdk/java/java/net/Inet4Address.java
trunk/core/src/openjdk/java/java/net/Inet4AddressImpl.java
trunk/core/src/openjdk/java/java/net/Inet6Address.java
trunk/core/src/openjdk/java/java/net/Inet6AddressImpl.java
trunk/core/src/openjdk/java/java/net/InetAddress.java
trunk/core/src/openjdk/java/java/net/InetAddressImpl.java
trunk/core/src/openjdk/java/java/net/InetSocketAddress.java
trunk/core/src/openjdk/vm/java/net/NativeInet4Address.java
trunk/core/src/openjdk/vm/java/net/NativeInet4AddressImpl.java
trunk/core/src/openjdk/vm/java/net/NativeInet6Address.java
trunk/core/src/openjdk/vm/java/net/NativeInet6AddressImpl.java
trunk/core/src/openjdk/vm/java/net/NativeInetAddress.java
trunk/core/src/openjdk/vm/java/net/NativeInetAddressImplFactory.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/net/Inet4Address.java
trunk/core/src/classpath/java/java/net/Inet6Address.java
trunk/core/src/classpath/java/java/net/InetAddress.java
trunk/core/src/classpath/java/java/net/InetSocketAddress.java
Modified: trunk/all/conf/openjdk-annotations.properties
===================================================================
--- trunk/all/conf/openjdk-annotations.properties 2009-03-17 13:25:49 UTC (rev 5113)
+++ trunk/all/conf/openjdk-annotations.properties 2009-03-18 21:02:34 UTC (rev 5114)
@@ -11,6 +11,8 @@
java/awt/Toolkit.class=SharedStatics
java/lang/ThreadLocal.class=SharedStatics
java/lang/Throwable.class=MagicPermission
+java/net/InetAddress.class=SharedStatics
+java/net/URLConnection.class=SharedStatics
java/util/Currency.class=SharedStatics
java/util/concurrent/locks/LockSupport.class=SharedStatics
sun/awt/AppContext.class=SharedStatics
Modified: trunk/core/src/classpath/java/java/net/DatagramSocket.java
===================================================================
--- trunk/core/src/classpath/java/java/net/DatagramSocket.java 2009-03-17 13:25:49 UTC (rev 5113)
+++ trunk/core/src/classpath/java/java/net/DatagramSocket.java 2009-03-18 21:02:34 UTC (rev 5114)
@@ -317,7 +317,7 @@
}
catch (SecurityException e)
{
- localAddr = InetAddress.ANY_IF;
+ localAddr = NativeInetAddress.ANY_IF;
}
catch (SocketException e)
{
@@ -673,7 +673,7 @@
s.checkListen(port);
if (addr == null)
- addr = InetAddress.ANY_IF;
+ addr = NativeInetAddress.ANY_IF;
try
{
Deleted: trunk/core/src/classpath/java/java/net/Inet4Address.java
===================================================================
--- trunk/core/src/classpath/java/java/net/Inet4Address.java 2009-03-17 13:25:49 UTC (rev 5113)
+++ trunk/core/src/classpath/java/java/net/Inet4Address.java 2009-03-18 21:02:34 UTC (rev 5114)
@@ -1,233 +0,0 @@
-/* Inet4Address.java --
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.net;
-
-import java.io.ObjectStreamException;
-
-/*
- * Written using on-line Java Platform 1.4 API Specification and
- * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt),
- * RFC 1918 (http://www.ietf.org/rfc/rfc1918.txt),
- * RFC 2365 (http://www.ietf.org/rfc/rfc2365.txt)
- *
- * @author Michael Koch
- * @status Believed complete and correct.
- */
-public final class Inet4Address extends InetAddress
-{
- /**
- * For compatability with Sun's JDK 1.4.2 rev. 5
- */
- static final long serialVersionUID = 3286316764910316507L;
-
- /**
- * needed for serialization
- */
- private Object writeReplace() throws ObjectStreamException
- {
- return new InetAddress(addr, hostName);
- }
-
- /**
- * Initializes this object's addr instance variable from the passed in
- * byte array. Note that this constructor is protected and is called
- * only by static methods in this class.
- *
- * @param addr The IP number of this address as an array of bytes
- * @param host The hostname of this IP address.
- */
- Inet4Address(byte[] addr, String host)
- {
- super(addr, host);
- }
-
- /**
- * Checks if the address is a multicast address
- *
- * @since 1.1
- */
- public boolean isMulticastAddress()
- {
- return super.isMulticastAddress();
- }
-
- /**
- * Checks if this address is a loopback address
- */
- public boolean isLoopbackAddress()
- {
- return super.isLoopbackAddress();
- }
-
- /**
- * Checks if this address is a wildcard address
- *
- * @since 1.4
- */
- public boolean isAnyLocalAddress()
- {
- return super.isAnyLocalAddress();
- }
-
- /**
- * Checks if this address is a link local address
- *
- * @since 1.4
- */
- public boolean isLinkLocalAddress()
- {
- return super.isLinkLocalAddress();
- }
-
- /**
- * Checks if this address is a site local address
- *
- * @since 1.4
- */
- public boolean isSiteLocalAddress()
- {
- return super.isSiteLocalAddress();
- }
-
- /**
- * Checks if this multicast address has global scope
- *
- * @since 1.4
- */
- public boolean isMCGlobal()
- {
- return super.isMCGlobal();
- }
-
- /**
- * Checks if this multicast address has node scope
- *
- * @since 1.4
- */
- public boolean isMCNodeLocal()
- {
- return super.isMCNodeLocal();
- }
-
- /**
- * Checks if this multicast address has link scope
- *
- * @since 1.4
- */
- public boolean isMCLinkLocal()
- {
- return super.isMCLinkLocal();
- }
-
- /**
- * Checks if this multicast address has site scope
- *
- * @since 1.4
- */
- public boolean isMCSiteLocal()
- {
- return super.isMCSiteLocal();
- }
-
- /**
- * Checks if this multicast address has organization scope
- *
- * @since 1.4
- */
- public boolean isMCOrgLocal()
- {
- return super.isMCOrgLocal();
- }
-
- /**
- * Returns the address of the current instance
- */
- public byte[] getAddress()
- {
- return (byte[]) addr.clone();
- }
-
- /**
- * Returns the address as string
- *
- * @since 1.0.2
- */
- public String getHostAddress()
- {
- return super.getHostAddress();
- }
-
- /**
- * Computes the hashcode of the instance
- */
- public int hashCode()
- {
- int hash = 0;
- int len = addr.length;
- int i = len > 4 ? len - 4 : 0;
-
- for (; i < len; i++)
- hash = (hash << 8) | (addr[i] & 0xFF);
-
- return hash;
- }
-
- /**
- * Compare the current Inet4Address instance with obj
- *
- * @param obj Object to compare with
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof InetAddress))
- return false;
-
- byte[] addr1 = addr;
- byte[] addr2 = ((InetAddress) obj).addr;
-
- if (addr1.length != addr2.length)
- return false;
-
- for (int i = addr1.length; --i >= 0;)
- if (addr1[i] != addr2[i])
- return false;
-
- return true;
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/Inet6Address.java
===================================================================
--- trunk/core/src/classpath/java/java/net/Inet6Address.java 2009-03-17 13:25:49 UTC (rev 5113)
+++ trunk/core/src/classpath/java/java/net/Inet6Address.java 2009-03-18 21:02:34 UTC (rev 5114)
@@ -1,422 +0,0 @@
-/* Inet6Address.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.net;
-
-import java.util.Arrays;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-
-/*
- * Written using on-line Java Platform 1.4 API Specification and
- * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt)
- *
- * @author Michael Koch
- * @status Updated to 1.5. Serialization compatibility is tested.
- */
-public final class Inet6Address extends InetAddress
-{
- static final long serialVersionUID = 6880410070516793377L;
-
- /**
- * Needed for serialization
- */
- byte[] ipaddress;
-
- /**
- * The scope ID, if any.
- * @since 1.5
- * @serial
- */
- private int scope_id;
-
- /**
- * The scope ID, if any.
- * @since 1.5
- * @serial
- */
- private boolean scope_id_set;
-
- /**
- * Whether ifname is set or not.
- * @since 1.5
- * @serial
- */
- private boolean scope_ifname_set;
-
- /**
- * Name of the network interface, used only by the serialization methods
- * @since 1.5
- * @serial
- */
- private String ifname;
-
- /**
- * Scope network interface, or <code>null</code>.
- */
- private transient NetworkInterface nif;
-
- /**
- * Create an Inet6Address object
- *
- * @param addr The IP address
- * @param host The hostname
- */
- Inet6Address(byte[] addr, String host)
- {
- super(addr, host);
- // Super constructor clones the addr. Get a reference to the clone.
- this.ipaddress = this.addr;
- ifname = null;
- scope_ifname_set = scope_id_set = false;
- scope_id = 0;
- nif = null;
- }
-
- /**
- * Utility routine to check if the InetAddress is an IP multicast address
- *
- * @since 1.1
- */
- public boolean isMulticastAddress()
- {
- return ipaddress[0] == 0xFF;
- }
-
- /**
- * Utility routine to check if the InetAddress in a wildcard address
- *
- * @since 1.4
- */
- public boolean isAnyLocalAddress()
- {
- byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- return Arrays.equals(ipaddress, anylocal);
- }
-
- /**
- * Utility routine to check if the InetAddress is a loopback address
- *
- * @since 1.4
- */
- public boolean isLoopbackAddress()
- {
- byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
- return Arrays.equals(ipaddress, loopback);
- }
-
- /**
- * Utility routine to check if the InetAddress is an link local address
- *
- * @since 1.4
- */
- public boolean isLinkLocalAddress()
- {
- return ipaddress[0] == 0xFA;
- }
-
- /**
- * Utility routine to check if the InetAddress is a site local address
- *
- * @since 1.4
- */
- public boolean isSiteLocalAddress()
- {
- return ipaddress[0] == 0xFB;
- }
-
- /**
- * Utility routine to check if the multicast address has global scope
- *
- * @since 1.4
- */
- public boolean isMCGlobal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0xE;
- }
-
- /**
- * Utility routine to check if the multicast address has node scope
- *
- * @since 1.4
- */
- public boolean isMCNodeLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x1;
- }
-
- /**
- * Utility routine to check if the multicast address has link scope
- *
- * @since 1.4
- */
- public boolean isMCLinkLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x2;
- }
-
- /**
- * Utility routine to check if the multicast address has site scope
- *
- * @since 1.4
- */
- public boolean isMCSiteLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x5;
- }
-
- /**
- * Utility routine to check if the multicast address has organization scope
- *
- * @since 1.4
- */
- public boolean isMCOrgLocal()
- {
- if (! isMulticastAddress())
- return false;
-
- return (ipaddress[1] & 0x0F) == 0x8;
- }
-
- /**
- * Returns the raw IP address of this InetAddress object. The result is in
- * network byte order: the highest order byte of the address is i
- * n getAddress()[0]
- */
- public byte[] getAddress()
- {
- return (byte[]) ipaddress.clone();
- }
-
- /**
- * Creates a scoped Inet6Address where the scope has an integer id.
- *
- * @throws UnkownHostException if the address is an invalid number of bytes.
- * @since 1.5
- */
- public static Inet6Address getByAddress(String host, byte[] addr,
- int scopeId)
- throws UnknownHostException
- {
- if( addr.length != 16 )
- throw new UnknownHostException("Illegal address length: " + addr.length
- + " bytes.");
- Inet6Address ip = new Inet6Address( addr, host );
- ip.scope_id = scopeId;
- ip.scope_id_set = true;
- return ip;
- }
-
- /**
- * Creates a scoped Inet6Address where the scope is a given
- * NetworkInterface.
- *
- * @throws UnkownHostException if the address is an invalid number of bytes.
- * @since 1.5
- */
- public static Inet6Address getByAddress(String host, byte[] addr,
- NetworkInterface nif)
- throws UnknownHostException
- {
- if( addr.length != 16 )
- throw new UnknownHostException("Illegal address length: " + addr.length
- + " bytes.");
- Inet6Address ip = new Inet6Address( addr, host );
- ip.nif = nif;
-
- return ip;
- }
-
- /**
- * Returns the <code>NetworkInterface</code> of the address scope
- * if it is a scoped address and the scope is given in the form of a
- * NetworkInterface.
- * (I.e. the address was created using the
- * getByAddress(String, byte[], NetworkInterface) method)
- * Otherwise this method returns <code>null</code>.
- * @since 1.5
- */
- public NetworkInterface getScopedInterface()
- {
- return nif;
- }
-
- /**
- * Returns the scope ID of the address scope if it is a scoped adress using
- * an integer to identify the scope.
- *
- * Otherwise this method returns 0.
- * @since 1.5
- */
- public int getScopeId()
- {
- // check scope_id_set because some JDK-serialized objects seem to have
- // scope_id set to a nonzero value even when scope_id_set == false
- if( scope_id_set )
- return scope_id;
- return 0;
- }
-
- /**
- * Returns the IP address string in textual presentation
- */
- public String getHostAddress()
- {
- StringBuffer sbuf = new StringBuffer(40);
-
- for (int i = 0; i < 16; i += 2)
- {
- int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF);
-
- if (i > 0)
- sbuf.append(':');
-
- sbuf.append(Integer.toHexString(x));
- }
- if( nif != null )
- sbuf.append( "%" + nif.getName() );
- else if( scope_id_set )
- sbuf.append( "%" + scope_id );
-
- return sbuf.toString();
- }
-
- /**
- * Returns a hashcode for this IP address
- * (The hashcode is independent of scope)
- */
- public int hashCode()
- {
- return super.hashCode();
- }
-
- /**
- * Compares this object against the specified object
- */
- public boolean equals(Object obj)
- {
- if (! (obj instanceof Inet6Address))
- return false;
-
- Inet6Address ip = (Inet6Address)obj;
- if (ipaddress.length != ip.ipaddress.length)
- return false;
-
- for (int i = 0; i < ip.ipaddress.length; i++)
- if (ipaddress[i] != ip.ipaddress[i])
- return false;
-
- if( ip.nif != null && nif != null )
- return nif.equals( ip.nif );
- if( ip.nif != nif )
- return false;
- if( ip.scope_id_set != scope_id_set )
- return false;
- if( scope_id_set )
- return (scope_id == ip.scope_id);
- return true;
- }
-
- /**
- * Utility routine to check if the InetAddress is an
- * IPv4 compatible IPv6 address
- *
- * @since 1.4
- */
- public boolean isIPv4CompatibleAddress()
- {
- if (ipaddress[0] != 0x00 || ipaddress[1] != 0x00 || ipaddress[2] != 0x00
- || ipaddress[3] != 0x00 || ipaddress[4] != 0x00
- || ipaddress[5] != 0x00 || ipaddress[6] != 0x00
- || ipaddress[7] != 0x00 || ipaddress[8] != 0x00
- || ipaddress[9] != 0x00 || ipaddress[10] != 0x00
- || ipaddress[11] != 0x00)
- return false;
-
- return true;
- }
-
- /**
- * Required for 1.5-compatible serialization.
- * @since 1.5
- */
- private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- s.defaultReadObject();
- try
- {
- if( scope_ifname_set )
- nif = NetworkInterface.getByName( ifname );
- }
- catch( SocketException se )
- {
- // FIXME: Ignore this? or throw an IOException?
- }
- }
-
- /**
- * Required for 1.5-compatible serialization.
- * @since 1.5
- */
- private void writeObject(ObjectOutputStream s)
- throws IOException
- {
- if( nif != null )
- {
- ifname = nif.getName();
- scope_ifname_set = true;
- }
- s.defaultWriteObject();
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/InetAddress.java
===================================================================
--- trunk/core/src/classpath/java/java/net/InetAddress.java 2009-03-17 13:25:49 UTC (rev 5113)
+++ trunk/core/src/classpath/java/java/net/InetAddress.java 2009-03-18 21:02:34 UTC (rev 5114)
@@ -1,698 +0,0 @@
-/* InetAddress.java -- Class to model an Internet address
- Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.net;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-/**
- * This class models an Internet address. It does not have a public
- * constructor. Instead, new instances of this objects are created
- * using the static methods getLocalHost(), getByName(), and
- * getAllByName().
- *
- * <p>This class fulfills the function of the C style functions gethostname(),
- * gethostbyname(), and gethostbyaddr(). It resolves Internet DNS names
- * into their corresponding numeric addresses and vice versa.</p>
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @author Per Bothner
- *
- * @specnote This class is not final since JK 1.4
- */
-public class InetAddress implements Serializable
-{
- private static final long serialVersionUID = 3286316764910316507L;
-
- /**
- * The special IP address INADDR_ANY.
- */
- private static InetAddress inaddr_any;
-
- /**
- * Dummy InetAddress, used to bind socket to any (all) network interfaces.
- */
- static InetAddress ANY_IF;
-
- /**
- * Stores static localhost address object.
- */
- static InetAddress LOCALHOST;
-
- static
- {
- // precompute the ANY_IF address
- try
- {
- ANY_IF = getInaddrAny();
-
- byte[] ip_localhost = { 127, 0, 0, 1 };
- LOCALHOST = new Inet4Address(ip_localhost, "localhost");
- }
- catch (UnknownHostException uhe)
- {
- // Hmmm, make one up and hope that it works.
- byte[] zeros = { 0, 0, 0, 0 };
- ANY_IF = new Inet4Address(zeros, "0.0.0.0");
- }
- }
-
- /**
- * The Serialized Form specifies that an int 'address' is saved/restored.
- * This class uses a byte array internally so we'll just do the conversion
- * at serialization time and leave the rest of the algorithm as is.
- */
- private int address;
-
- /**
- * An array of octets representing an IP address.
- */
- transient byte[] addr;
-
- /**
- * The name of the host for this address.
- */
- String hostName;
-
- /**
- * The field 'family' seems to be the AF_ value.
- * FIXME: Much of the code in the other java.net classes does not make
- * use of this family field. A better implementation would be to make
- * use of getaddrinfo() and have other methods just check the family
- * field rather than examining the length of the address each time.
- */
- int family;
-
- /**
- * Initializes this object's addr instance variable from the passed in
- * byte array. Note that this constructor is protected and is called
- * only by static methods in this class.
- *
- * @param ipaddr The IP number of this address as an array of bytes
- * @param hostname The hostname of this IP address.
- */
- InetAddress(byte[] ipaddr, String hostname)
- {
- addr = (null == ipaddr) ? null : (byte[]) ipaddr.clone();
- hostName = hostname;
-
- family = 2; /* AF_INET */
- }
-
- /**
- * Returns true if this address is a multicast address, false otherwise.
- * An address is multicast if the high four bits are "1110". These are
- * also known as "Class D" addresses.
- *
- * @return true if mulitcast, false if not
- *
- * @since 1.1
- */
- public boolean isMulticastAddress()
- {
- // Mask against high order bits of 1110
- if (addr.length == 4)
- return (addr[0] & 0xf0) == 0xe0;
-
- return false;
- }
-
- /**
- * Utility routine to check if the InetAddress in a wildcard address
- *
- * @since 1.4
- */
- public boolean isAnyLocalAddress()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- return equals(ANY_IF);
- }
-
- /**
- * Utility routine to check if the InetAddress is a loopback address
- *
- * @since 1.4
- */
- public boolean isLoopbackAddress()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- return (addr[0] & 0xff) == 0x7f;
- }
-
- /**
- * Utility routine to check if InetAddress is a link local address
- *
- * @since 1.4
- */
- public boolean isLinkLocalAddress()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- // XXX: This seems to not exist with IPv4 addresses
- return false;
- }
-
- /**
- * Utility routine to check if InetAddress is a site local address
- *
- * @since 1.4
- */
- public boolean isSiteLocalAddress()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
-
- // 10.0.0.0/8
- if ((addr[0] & 0xff) == 0x0a)
- return true;
-
- // 172.16.0.0/12
- if ((addr[0] & 0xff) == 0xac && (addr[1] & 0xf0) == 0x10)
- return true;
-
- // 192.168.0.0/16
- if ((addr[0] & 0xff) == 0xc0 && (addr[1] & 0xff) == 0xa8)
- return true;
-
- // XXX: Do we need to check more addresses here ?
- return false;
- }
-
- /**
- * Utility routine to check if InetAddress is a global multicast address
- *
- * @since 1.4
- */
- public boolean isMCGlobal()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- // XXX: This seems to not exist with IPv4 addresses
- return false;
- }
-
- /**
- * Utility routine to check if InetAddress is a node local multicast address.
- *
- * @since 1.4
- */
- public boolean isMCNodeLocal()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- // XXX: This seems to not exist with IPv4 addresses
- return false;
- }
-
- /**
- * Utility routine to check if InetAddress is a link local multicast address.
- *
- * @since 1.4
- */
- public boolean isMCLinkLocal()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- if (! isMulticastAddress())
- return false;
-
- return ((addr[0] & 0xff) == 0xe0
- && (addr[1] & 0xff) == 0x00
- && (addr[2] & 0xff) == 0x00);
- }
-
- /**
- * Utility routine to check if InetAddress is a site local multicast address.
- *
- * @since 1.4
- */
- public boolean isMCSiteLocal()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- // XXX: This seems to not exist with IPv4 addresses
- return false;
- }
-
- /**
- * Utility routine to check if InetAddress is a organization local
- * multicast address.
- *
- * @since 1.4
- */
- public boolean isMCOrgLocal()
- {
- // This is the IPv4 implementation.
- // Any class derived from InetAddress should override this.
- // XXX: This seems to not exist with IPv4 addresses
- return false;
- }
-
- /**
- * Returns the hostname for this address. This will return the IP address
- * as a String if there is no hostname available for this address
- *
- * @return The hostname for this address
- */
- public String getHostName()
- {
- if (hostName != null)
- return hostName;
-
- try
- {
- hostName = VMInetAddress.getHostByAddr(addr);
- return hostName;
- }
- catch (UnknownHostException e)
- {
- return getHostAddress();
- }
- }
-
- //jnode
- String getHostName(boolean check){
- return getHostName();
- }
-
- /**
- * Returns the canonical hostname represented by this InetAddress
- *
- * @since 1.4
- */
- public String getCanonicalHostName()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- try
- {
- sm.checkConnect(hostName, -1);
- }
- catch (SecurityException e)
- {
- return getHostAddress();
- }
- }
-
- // Try to find the FDQN now
- InetAddress address;
- byte[] ipaddr = getAddress();
-
- if (ipaddr.length == 16)
- address = new Inet6Address(getAddress(), null);
- else
- address = new Inet4Address(getAddress(), null);
-
- return address.getHostName();
- }
-
- /**
- * Returns the IP address of this object as a ...
[truncated message content] |
|
From: <ls...@us...> - 2009-03-19 18:13:43
|
Revision: 5119
http://jnode.svn.sourceforge.net/jnode/?rev=5119&view=rev
Author: lsantha
Date: 2009-03-19 18:13:36 +0000 (Thu, 19 Mar 2009)
Log Message:
-----------
OpenJDK integration.
Modified Paths:
--------------
trunk/all/conf/openjdk-annotations.properties
trunk/core/src/openjdk/java/java/net/AbstractPlainSocketImpl.java
Added Paths:
-----------
trunk/core/src/classpath/vm/java/net/MimeTypeMapper.java
trunk/core/src/openjdk/java/java/net/DatagramSocket.java
trunk/core/src/openjdk/java/java/net/InterfaceAddress.java
trunk/core/src/openjdk/java/java/net/MulticastSocket.java
trunk/core/src/openjdk/java/java/net/NetworkInterface.java
trunk/core/src/openjdk/java/java/net/ServerSocket.java
trunk/core/src/openjdk/java/java/net/Socket.java
trunk/core/src/openjdk/java/java/net/SocketInputStream.java
trunk/core/src/openjdk/java/java/net/SocketOutputStream.java
trunk/core/src/openjdk/java/java/net/SocksSocketImpl.java
trunk/core/src/openjdk/svm/java/net/
trunk/core/src/openjdk/svm/java/net/DefaultDatagramSocketImplFactory.java
trunk/core/src/openjdk/svm/java/net/PlainDatagramSocketImpl.java
trunk/core/src/openjdk/svm/java/net/PlainSocketImpl.java
trunk/core/src/openjdk/vm/java/net/NativeNetworkInterface.java
trunk/core/src/openjdk/vm/java/net/NativePlainDatagramSocketImpl.java
trunk/core/src/openjdk/vm/java/net/NativePlainSocketImpl.java
trunk/core/src/openjdk/vm/java/net/NativeSocketInputStream.java
trunk/core/src/openjdk/vm/java/net/NativeSocketOutputStream.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/net/DatagramSocket.java
trunk/core/src/classpath/java/java/net/MimeTypeMapper.java
trunk/core/src/classpath/java/java/net/MulticastSocket.java
trunk/core/src/classpath/java/java/net/NetworkInterface.java
trunk/core/src/classpath/java/java/net/ServerSocket.java
trunk/core/src/classpath/java/java/net/Socket.java
Modified: trunk/all/conf/openjdk-annotations.properties
===================================================================
--- trunk/all/conf/openjdk-annotations.properties 2009-03-19 16:23:45 UTC (rev 5118)
+++ trunk/all/conf/openjdk-annotations.properties 2009-03-19 18:13:36 UTC (rev 5119)
@@ -12,6 +12,11 @@
java/lang/ThreadLocal.class=SharedStatics
java/lang/Throwable.class=MagicPermission
java/net/InetAddress.class=SharedStatics
+# TODO DatagramSocket, ServerSocket and Socket might need to be isolated
+# TODO for propperly supporting setSocketImplFactory()
+java/net/DatagramSocket.class=SharedStatics
+java/net/ServerSocket.class=SharedStatics
+java/net/Socket.class=SharedStatics
java/net/URLConnection.class=SharedStatics
java/util/Currency.class=SharedStatics
java/util/concurrent/locks/LockSupport.class=SharedStatics
Deleted: trunk/core/src/classpath/java/java/net/DatagramSocket.java
===================================================================
--- trunk/core/src/classpath/java/java/net/DatagramSocket.java 2009-03-19 16:23:45 UTC (rev 5118)
+++ trunk/core/src/classpath/java/java/net/DatagramSocket.java 2009-03-19 18:13:36 UTC (rev 5119)
@@ -1,948 +0,0 @@
-/* DatagramSocket.java -- A class to model UDP sockets
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-import gnu.classpath.SystemProperties;
-
-import gnu.java.net.PlainDatagramSocketImpl;
-import gnu.java.nio.DatagramChannelImpl;
-import gnu.java.security.action.GetPropertyAction;
-
-import java.io.IOException;
-import java.nio.channels.DatagramChannel;
-import java.nio.channels.IllegalBlockingModeException;
-import java.security.AccessController;
-import org.jnode.vm.annotation.SharedStatics;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-/**
- * This class models a connectionless datagram socket that sends
- * individual packets of data across the network. In the TCP/IP world,
- * this means UDP. Datagram packets do not have guaranteed delivery,
- * or any guarantee about the order the data will be received on the
- * remote host.
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @author Warren Levy (wa...@cy...)
- * @date May 3, 1999.
- */
-@SharedStatics
-public class DatagramSocket
-{
- /**
- * This is the user DatagramSocketImplFactory for this class. If this
- * variable is null, a default factory is used.
- */
- private static DatagramSocketImplFactory factory;
-
- /**
- * This is the implementation object used by this socket.
- */
- private DatagramSocketImpl impl;
-
- /**
- * True if socket implementation was created.
- */
- private boolean implCreated;
-
- /**
- * This is the address we are "connected" to
- */
- private InetAddress remoteAddress;
-
- /**
- * This is the port we are "connected" to
- */
- private int remotePort = -1;
-
- /**
- * True if socket is bound.
- */
- private boolean bound;
-
- /**
- * Creates a <code>DatagramSocket</code> from a specified
- * <code>DatagramSocketImpl</code> instance
- *
- * @param impl The <code>DatagramSocketImpl</code> the socket will be
- * created from
- *
- * @since 1.4
- */
- protected DatagramSocket(DatagramSocketImpl impl)
- {
- if (impl == null)
- throw new NullPointerException("impl may not be null");
-
- this.impl = impl;
- this.remoteAddress = null;
- this.remotePort = -1;
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * a random port and every address on the local machine.
- *
- * @exception SocketException If an error occurs.
- * @exception SecurityException If a security manager exists and
- * its <code>checkListen</code> method doesn't allow the operation.
- */
- public DatagramSocket() throws SocketException
- {
- this(new InetSocketAddress(0));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified port and every address on the local machine.
- *
- * @param port The local port number to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- */
- public DatagramSocket(int port) throws SocketException
- {
- this(new InetSocketAddress(port));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified local port and address.
- *
- * @param port The local port number to bind to.
- * @param addr The local address to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * checkListen method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- */
- public DatagramSocket(int port, InetAddress addr) throws SocketException
- {
- this(new InetSocketAddress(addr, port));
- }
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified local port and address.
- *
- * @param address The local address and port number to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public DatagramSocket(SocketAddress address) throws SocketException
- {
- // @classpath-bugfix Security
- //String propVal = SystemProperties.getProperty("impl.prefix");
- //if (propVal == null || propVal.equals(""))
- String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix"));
- // @classpath-bugfix-end
-
- // @classpath-bugfix Use factory
- //if (propVal == null || propVal.equals(""))
- if (factory != null) {
- impl = factory.createDatagramSocketImpl();
- } else if (propVal == null || propVal.equals(""))
- // @classpath-bugfix-end
- impl = new PlainDatagramSocketImpl();
- else
- try
- {
- impl =
- (DatagramSocketImpl) Class.forName("java.net." + propVal
- + "DatagramSocketImpl")
- .newInstance();
- }
- catch (Exception e)
- {
- System.err.println("Could not instantiate class: java.net."
- + propVal + "DatagramSocketImpl");
- impl = new PlainDatagramSocketImpl();
- }
-
- if (address != null)
- bind(address);
- }
-
- // This needs to be accessible from java.net.MulticastSocket
- DatagramSocketImpl getImpl() throws SocketException
- {
- try
- {
- if (! implCreated)
- {
- impl.create();
- implCreated = true;
- }
-
- return impl;
- }
- catch (IOException e)
- {
- SocketException se = new SocketException();
- se.initCause(e);
- throw se;
- }
- }
-
- /**
- * Closes this datagram socket.
- */
- public void close()
- {
- if (isClosed())
- return;
-
- try
- {
- getImpl().close();
- }
- catch (SocketException e)
- {
- // Ignore this case, just close the socket in finally clause.
- }
- finally
- {
- remoteAddress = null;
- remotePort = -1;
- impl = null;
- }
-
- try
- {
- if (getChannel() != null)
- getChannel().close();
- }
- catch (IOException e)
- {
- // Do nothing.
- }
- }
-
- /**
- * This method returns the remote address to which this socket is
- * connected. If this socket is not connected, then this method will
- * return <code>null</code>.
- *
- * @return The remote address.
- *
- * @since 1.2
- */
- public InetAddress getInetAddress()
- {
- return remoteAddress;
- }
-
- /**
- * This method returns the remote port to which this socket is
- * connected. If this socket is not connected, then this method will
- * return -1.
- *
- * @return The remote port.
- *
- * @since 1.2
- */
- public int getPort()
- {
- return remotePort;
- }
-
- /**
- * Returns the local address this datagram socket is bound to.
- *
- * @return The local address is the socket is bound or null
- *
- * @since 1.1
- */
- public InetAddress getLocalAddress()
- {
- if (! isBound())
- return null;
-
- InetAddress localAddr;
-
- try
- {
- localAddr =
- (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkConnect(localAddr.getHostName(), -1);
- }
- catch (SecurityException e)
- {
- localAddr = NativeInetAddress.ANY_IF;
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- return null;
- }
-
- return localAddr;
- }
-
- /**
- * Returns the local port this socket is bound to.
- *
- * @return The local port number.
- */
- public int getLocalPort()
- {
- if (isClosed())
- return -1;
-
- try
- {
- return getImpl().getLocalPort();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are bound.
- return 0;
- }
- }
-
- /**
- * Returns the value of the socket's SO_TIMEOUT setting. If this method
- * returns 0 then SO_TIMEOUT is disabled.
- *
- * @return The current timeout in milliseconds.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.1
- */
- public synchronized int getSoTimeout() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_TIMEOUT);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the value of the socket's SO_TIMEOUT value. A value of 0 will
- * disable SO_TIMEOUT. Any other value is the number of milliseconds
- * a socket read/write will block before timing out.
- *
- * @param timeout The new SO_TIMEOUT value in milliseconds.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.1
- */
- public synchronized void setSoTimeout(int timeout) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (timeout < 0)
- throw new IllegalArgumentException("Invalid timeout: " + timeout);
-
- getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_SNDBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The send buffer size.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.2
- */
- public int getSendBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_SNDBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new send buffer size.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If size is 0 or negative.
- *
- * @since 1.2
- */
- public void setSendBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size < 0)
- throw new IllegalArgumentException("Buffer size is less than 0");
-
- getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
- }
-
- /**
- * This method returns the value of the system level socket option
- * SO_RCVBUF, which is used by the operating system to tune buffer
- * sizes for data transfers.
- *
- * @return The receive buffer size.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.2
- */
- public int getReceiveBufferSize() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * This method sets the value for the system level socket option
- * SO_RCVBUF to the specified value. Note that valid values for this
- * option are specific to a given operating system.
- *
- * @param size The new receive buffer size.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If size is 0 or negative.
- *
- * @since 1.2
- */
- public void setReceiveBufferSize(int size) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (size < 0)
- throw new IllegalArgumentException("Buffer size is less than 0");
-
- getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
- }
-
- /**
- * This method connects this socket to the specified address and port.
- * When a datagram socket is connected, it will only send or receive
- * packets to and from the host to which it is connected. A multicast
- * socket that is connected may only send and not receive packets.
- *
- * @param address The address to connect this socket to.
- * @param port The port to connect this socket to.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If address or port are invalid.
- * @exception SecurityException If the caller is not allowed to send
- * datagrams to or receive from this address and port.
- *
- * @since 1.2
- */
- public void connect(InetAddress address, int port)
- {
- if (address == null)
- throw new IllegalArgumentException("Connect address may not be null");
-
- if ((port < 1) || (port > 65535))
- throw new IllegalArgumentException("Port number is illegal: " + port);
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect(address.getHostName(), port);
-
- try
- {
- getImpl().connect(address, port);
- remoteAddress = address;
- remotePort = port;
- }
- catch (SocketException e)
- {
- // This means simply not connected or connect not implemented.
- }
- }
-
- /**
- * This method disconnects this socket from the address/port it was
- * connected to. If the socket was not connected in the first place,
- * this method does nothing.
- *
- * @since 1.2
- */
- public void disconnect()
- {
- if (! isConnected())
- return;
-
- try
- {
- getImpl().disconnect();
- }
- catch (SocketException e)
- {
- // This cannot happen as we are connected.
- }
- finally
- {
- remoteAddress = null;
- remotePort = -1;
- }
- }
-
- /**
- * Reads a datagram packet from the socket. Note that this method
- * will block until a packet is received from the network. On return,
- * the passed in <code>DatagramPacket</code> is populated with the data
- * received and all the other information about the packet.
- *
- * @param p A <code>DatagramPacket</code> for storing the data
- *
- * @exception IOException If an error occurs.
- * @exception SocketTimeoutException If setSoTimeout was previously called
- * and the timeout has expired.
- * @exception PortUnreachableException If the socket is connected to a
- * currently unreachable destination. Note, there is no guarantee that the
- * exception will be thrown.
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode.
- * @exception SecurityException If a security manager exists and its
- * checkAccept method doesn't allow the receive.
- */
- public synchronized void receive(DatagramPacket p) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (remoteAddress != null && remoteAddress.isMulticastAddress())
- throw new IOException
- ("Socket connected to a multicast address my not receive");
-
- if (getChannel() != null && ! getChannel().isBlocking()
- && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation())
- throw new IllegalBlockingModeException();
-
- getImpl().receive(p);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null && isConnected())
- s.checkAccept(p.getAddress().getHostName(), p.getPort());
- }
-
- /**
- * Sends the specified packet. The host and port to which the packet
- * are to be sent should be set inside the packet.
- *
- * @param p The datagram packet to send.
- *
- * @exception IOException If an error occurs.
- * @exception SecurityException If a security manager exists and its
- * checkMulticast or checkConnect method doesn't allow the send.
- * @exception PortUnreachableException If the socket is connected to a
- * currently unreachable destination. Note, there is no guarantee that the
- * exception will be thrown.
- * @exception IllegalBlockingModeException If this socket has an associated
- * channel, and the channel is in non-blocking mode.
- */
- public void send(DatagramPacket p) throws IOException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api.
- SecurityManager s = System.getSecurityManager();
- if (s != null && ! isConnected())
- {
- InetAddress addr = p.getAddress();
- if (addr.isMulticastAddress())
- s.checkMulticast(addr);
- else
- s.checkConnect(addr.getHostAddress(), p.getPort());
- }
-
- if (isConnected())
- {
- if (p.getAddress() != null
- && (remoteAddress != p.getAddress() || remotePort != p.getPort()))
- throw new IllegalArgumentException
- ("DatagramPacket address does not match remote address");
- }
-
- // FIXME: if this is a subclass of MulticastSocket,
- // use getTimeToLive for TTL val.
- if (getChannel() != null && ! getChannel().isBlocking()
- && ! ((DatagramChannelImpl) getChannel()).isInChannelOperation())
- throw new IllegalBlockingModeException();
-
- getImpl().send(p);
- }
-
- /**
- * Binds the socket to the given socket address.
- *
- * @param address The socket address to bind to.
- *
- * @exception SocketException If an error occurs.
- * @exception SecurityException If a security manager exists and
- * its checkListen method doesn't allow the operation.
- * @exception IllegalArgumentException If address type is not supported.
- *
- * @since 1.4
- */
- public void bind(SocketAddress address) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetAddress addr = ((InetSocketAddress) address).getAddress();
- int port = ((InetSocketAddress) address).getPort();
-
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkListen(port);
-
- if (addr == null)
- addr = NativeInetAddress.ANY_IF;
-
- try
- {
- getImpl().bind(port, addr);
- bound = true;
- }
- catch (SocketException exception)
- {
- getImpl().close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- getImpl().close();
- throw exception;
- }
- catch (Error error)
- {
- getImpl().close();
- throw error;
- }
- }
-
- /**
- * Checks if the datagram socket is closed.
- *
- * @return True if socket is closed, false otherwise.
- *
- * @since 1.4
- */
- public boolean isClosed()
- {
- return impl == null;
- }
-
- /**
- * Returns the datagram channel assoziated with this datagram socket.
- *
- * @return The associated <code>DatagramChannel</code> object or null
- *
- * @since 1.4
- */
- public DatagramChannel getChannel()
- {
- return null;
- }
-
- /**
- * Connects the datagram socket to a specified socket address.
- *
- * @param address The socket address to connect to.
- *
- * @exception SocketException If an error occurs.
- * @exception IllegalArgumentException If address type is not supported.
- *
- * @since 1.4
- */
- public void connect(SocketAddress address) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- connect(tmp.getAddress(), tmp.getPort());
- }
-
- /**
- * Returns the binding state of the socket.
- *
- * @return True if socket bound, false otherwise.
- *
- * @since 1.4
- */
- public boolean isBound()
- {
- return bound;
- }
-
- /**
- * Returns the connection state of the socket.
- *
- * @return True if socket is connected, false otherwise.
- *
- * @since 1.4
- */
- public boolean isConnected()
- {
- return remoteAddress != null;
- }
-
- /**
- * Returns the SocketAddress of the host this socket is conneted to
- * or null if this socket is not connected.
- *
- * @return The socket address of the remote host if connected or null
- *
- * @since 1.4
- */
- public SocketAddress getRemoteSocketAddress()
- {
- if (! isConnected())
- return null;
-
- return new InetSocketAddress(remoteAddress, remotePort);
- }
-
- /**
- * Returns the local SocketAddress this socket is bound to.
- *
- * @return The local SocketAddress or null if the socket is not bound.
- *
- * @since 1.4
- */
- public SocketAddress getLocalSocketAddress()
- {
- if (! isBound())
- return null;
-
- return new InetSocketAddress(getLocalAddress(), getLocalPort());
- }
-
- /**
- * Enables/Disables SO_REUSEADDR.
- *
- * @param on Whether or not to have SO_REUSEADDR turned on.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public void setReuseAddress(boolean on) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
- }
-
- /**
- * Checks if SO_REUSEADDR is enabled.
- *
- * @return True if SO_REUSEADDR is set on the socket, false otherwise.
- *
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public boolean getReuseAddress() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_REUSEADDR);
-
- if (buf instanceof Boolean)
- return ((Boolean) buf).booleanValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Enables/Disables SO_BROADCAST
- *
- * @param enable True if SO_BROADCAST should be enabled, false otherwise.
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public void setBroadcast(boolean enable) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable));
- }
-
- /**
- * Checks if SO_BROADCAST is enabled
- *
- * @return Whether SO_BROADCAST is set
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public boolean getBroadcast() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.SO_BROADCAST);
-
- if (buf instanceof Boolean)
- return ((Boolean) buf).booleanValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the traffic class value
- *
- * @param tc The traffic class
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If tc value is illegal
- *
- * @see DatagramSocket#getTrafficClass()
- *
- * @since 1.4
- */
- public void setTrafficClass(int tc) throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- if (tc < 0 || tc > 255)
- throw new IllegalArgumentException();
-
- getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
- }
-
- /**
- * Returns the current traffic class
- *
- * @return The current traffic class.
- *
- * @see DatagramSocket#setTrafficClass(int tc)
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- public int getTrafficClass() throws SocketException
- {
- if (isClosed())
- throw new SocketException("socket is closed");
-
- Object buf = getImpl().getOption(SocketOptions.IP_TOS);
-
- if (buf instanceof Integer)
- return ((Integer) buf).intValue();
-
- throw new SocketException("unexpected type");
- }
-
- /**
- * Sets the datagram socket implementation factory for the application
- *
- * @param fac The factory to set
- *
- * @exception IOException If an error occurs
- * @exception SocketException If the factory is already defined
- * @exception SecurityException If a security manager exists and its
- * checkSetFactory method doesn't allow the operation
- */
- public static void setDatagramSocketImplFactory(DatagramSocketImplFactory fac)
- throws IOException
- {
- if (factory != null)
- throw new SocketException("DatagramSocketImplFactory already defined");
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkSetFactory();
-
- factory = fac;
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/MimeTypeMapper.java
===================================================================
--- trunk/core/src/classpath/java/java/net/MimeTypeMapper.java 2009-03-19 16:23:45 UTC (rev 5118)
+++ trunk/core/src/classpath/java/java/net/MimeTypeMapper.java 2009-03-19 18:13:36 UTC (rev 5119)
@@ -1,346 +0,0 @@
-/* MimeTypeMapper.java -- A class for mapping file names to MIME types
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published b...
[truncated message content] |