|
From: <ls...@us...> - 2007-06-17 10:09:43
|
Revision: 3274
http://jnode.svn.sourceforge.net/jnode/?rev=3274&view=rev
Author: lsantha
Date: 2007-06-17 03:09:41 -0700 (Sun, 17 Jun 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/rmi/
trunk/core/src/openjdk/java/java/rmi/AccessException.java
trunk/core/src/openjdk/java/java/rmi/AlreadyBoundException.java
trunk/core/src/openjdk/java/java/rmi/ConnectException.java
trunk/core/src/openjdk/java/java/rmi/ConnectIOException.java
trunk/core/src/openjdk/java/java/rmi/MarshalException.java
trunk/core/src/openjdk/java/java/rmi/MarshalledObject.java
trunk/core/src/openjdk/java/java/rmi/Naming.java
trunk/core/src/openjdk/java/java/rmi/NoSuchObjectException.java
trunk/core/src/openjdk/java/java/rmi/NotBoundException.java
trunk/core/src/openjdk/java/java/rmi/RMISecurityException.java
trunk/core/src/openjdk/java/java/rmi/RMISecurityManager.java
trunk/core/src/openjdk/java/java/rmi/Remote.java
trunk/core/src/openjdk/java/java/rmi/RemoteException.java
trunk/core/src/openjdk/java/java/rmi/ServerError.java
trunk/core/src/openjdk/java/java/rmi/ServerException.java
trunk/core/src/openjdk/java/java/rmi/ServerRuntimeException.java
trunk/core/src/openjdk/java/java/rmi/StubNotFoundException.java
trunk/core/src/openjdk/java/java/rmi/UnexpectedException.java
trunk/core/src/openjdk/java/java/rmi/UnknownHostException.java
trunk/core/src/openjdk/java/java/rmi/UnmarshalException.java
trunk/core/src/openjdk/java/java/rmi/activation/
trunk/core/src/openjdk/java/java/rmi/activation/Activatable.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivateFailedException.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationDesc.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationException.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationGroup.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationGroupDesc.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationGroupID.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationID.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationInstantiator.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationMonitor.java
trunk/core/src/openjdk/java/java/rmi/activation/ActivationSystem.java
trunk/core/src/openjdk/java/java/rmi/activation/Activator.java
trunk/core/src/openjdk/java/java/rmi/activation/UnknownGroupException.java
trunk/core/src/openjdk/java/java/rmi/activation/UnknownObjectException.java
trunk/core/src/openjdk/java/java/rmi/activation/package.html
trunk/core/src/openjdk/java/java/rmi/dgc/
trunk/core/src/openjdk/java/java/rmi/dgc/DGC.java
trunk/core/src/openjdk/java/java/rmi/dgc/Lease.java
trunk/core/src/openjdk/java/java/rmi/dgc/VMID.java
trunk/core/src/openjdk/java/java/rmi/dgc/package.html
trunk/core/src/openjdk/java/java/rmi/package.html
trunk/core/src/openjdk/java/java/rmi/registry/
trunk/core/src/openjdk/java/java/rmi/registry/LocateRegistry.java
trunk/core/src/openjdk/java/java/rmi/registry/Registry.java
trunk/core/src/openjdk/java/java/rmi/registry/RegistryHandler.java
trunk/core/src/openjdk/java/java/rmi/registry/package.html
trunk/core/src/openjdk/java/java/rmi/server/
trunk/core/src/openjdk/java/java/rmi/server/ExportException.java
trunk/core/src/openjdk/java/java/rmi/server/LoaderHandler.java
trunk/core/src/openjdk/java/java/rmi/server/LogStream.java
trunk/core/src/openjdk/java/java/rmi/server/ObjID.java
trunk/core/src/openjdk/java/java/rmi/server/Operation.java
trunk/core/src/openjdk/java/java/rmi/server/RMIClassLoader.java
trunk/core/src/openjdk/java/java/rmi/server/RMIClassLoaderSpi.java
trunk/core/src/openjdk/java/java/rmi/server/RMIClientSocketFactory.java
trunk/core/src/openjdk/java/java/rmi/server/RMIFailureHandler.java
trunk/core/src/openjdk/java/java/rmi/server/RMIServerSocketFactory.java
trunk/core/src/openjdk/java/java/rmi/server/RMISocketFactory.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteCall.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteObject.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteObjectInvocationHandler.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteRef.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteServer.java
trunk/core/src/openjdk/java/java/rmi/server/RemoteStub.java
trunk/core/src/openjdk/java/java/rmi/server/ServerCloneException.java
trunk/core/src/openjdk/java/java/rmi/server/ServerNotActiveException.java
trunk/core/src/openjdk/java/java/rmi/server/ServerRef.java
trunk/core/src/openjdk/java/java/rmi/server/Skeleton.java
trunk/core/src/openjdk/java/java/rmi/server/SkeletonMismatchException.java
trunk/core/src/openjdk/java/java/rmi/server/SkeletonNotFoundException.java
trunk/core/src/openjdk/java/java/rmi/server/SocketSecurityException.java
trunk/core/src/openjdk/java/java/rmi/server/UID.java
trunk/core/src/openjdk/java/java/rmi/server/UnicastRemoteObject.java
trunk/core/src/openjdk/java/java/rmi/server/Unreferenced.java
trunk/core/src/openjdk/java/java/rmi/server/package.html
trunk/core/src/openjdk/sun/sun/rmi/
trunk/core/src/openjdk/sun/sun/rmi/log/
trunk/core/src/openjdk/sun/sun/rmi/log/LogHandler.java
trunk/core/src/openjdk/sun/sun/rmi/log/LogInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/log/LogOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/log/ReliableLog.java
trunk/core/src/openjdk/sun/sun/rmi/registry/
trunk/core/src/openjdk/sun/sun/rmi/registry/RegistryImpl.java
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_de.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_es.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_fr.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_it.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_ja.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_ko.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_sv.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_zh_CN.properties
trunk/core/src/openjdk/sun/sun/rmi/registry/resources/rmiregistry_zh_TW.properties
trunk/core/src/openjdk/sun/sun/rmi/runtime/
trunk/core/src/openjdk/sun/sun/rmi/runtime/Log.java
trunk/core/src/openjdk/sun/sun/rmi/runtime/NewThreadAction.java
trunk/core/src/openjdk/sun/sun/rmi/runtime/RuntimeUtil.java
trunk/core/src/openjdk/sun/sun/rmi/server/
trunk/core/src/openjdk/sun/sun/rmi/server/ActivatableRef.java
trunk/core/src/openjdk/sun/sun/rmi/server/ActivatableServerRef.java
trunk/core/src/openjdk/sun/sun/rmi/server/ActivationGroupImpl.java
trunk/core/src/openjdk/sun/sun/rmi/server/ActivationGroupInit.java
trunk/core/src/openjdk/sun/sun/rmi/server/Dispatcher.java
trunk/core/src/openjdk/sun/sun/rmi/server/InactiveGroupException.java
trunk/core/src/openjdk/sun/sun/rmi/server/LoaderHandler.java
trunk/core/src/openjdk/sun/sun/rmi/server/MarshalInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/server/MarshalOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/server/UnicastRef.java
trunk/core/src/openjdk/sun/sun/rmi/server/UnicastRef2.java
trunk/core/src/openjdk/sun/sun/rmi/server/UnicastServerRef.java
trunk/core/src/openjdk/sun/sun/rmi/server/UnicastServerRef2.java
trunk/core/src/openjdk/sun/sun/rmi/server/Util.java
trunk/core/src/openjdk/sun/sun/rmi/server/WeakClassHashMap.java
trunk/core/src/openjdk/sun/sun/rmi/server/resources/
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_de.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_es.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_fr.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_it.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_ja.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_ko.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_sv.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_zh_CN.properties
trunk/core/src/openjdk/sun/sun/rmi/server/resources/rmid_zh_TW.properties
trunk/core/src/openjdk/sun/sun/rmi/transport/
trunk/core/src/openjdk/sun/sun/rmi/transport/Channel.java
trunk/core/src/openjdk/sun/sun/rmi/transport/Connection.java
trunk/core/src/openjdk/sun/sun/rmi/transport/ConnectionInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/ConnectionOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/DGCAckHandler.java
trunk/core/src/openjdk/sun/sun/rmi/transport/DGCClient.java
trunk/core/src/openjdk/sun/sun/rmi/transport/DGCImpl.java
trunk/core/src/openjdk/sun/sun/rmi/transport/Endpoint.java
trunk/core/src/openjdk/sun/sun/rmi/transport/LiveRef.java
trunk/core/src/openjdk/sun/sun/rmi/transport/ObjectEndpoint.java
trunk/core/src/openjdk/sun/sun/rmi/transport/ObjectTable.java
trunk/core/src/openjdk/sun/sun/rmi/transport/StreamRemoteCall.java
trunk/core/src/openjdk/sun/sun/rmi/transport/Target.java
trunk/core/src/openjdk/sun/sun/rmi/transport/Transport.java
trunk/core/src/openjdk/sun/sun/rmi/transport/TransportConstants.java
trunk/core/src/openjdk/sun/sun/rmi/transport/WeakRef.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/CGIHandler.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpAwareServerSocket.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpReceiveSocket.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpSendInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpSendOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/HttpSendSocket.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/RMIDirectSocketFactory.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/RMIHttpToCGISocketFactory.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/RMIHttpToPortSocketFactory.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/RMIMasterSocketFactory.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/RMISocketInfo.java
trunk/core/src/openjdk/sun/sun/rmi/transport/proxy/WrappedSocket.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/ConnectionMultiplexer.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/MultiplexConnectionInfo.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/MultiplexInputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/MultiplexOutputStream.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/TCPChannel.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/TCPConnection.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/TCPEndpoint.java
trunk/core/src/openjdk/sun/sun/rmi/transport/tcp/TCPTransport.java
trunk/core/src/openjdk/sun/sun/security/action/LoadLibraryAction.java
trunk/core/src/openjdk/vm/sun/rmi/
trunk/core/src/openjdk/vm/sun/rmi/server/
trunk/core/src/openjdk/vm/sun/rmi/server/NativeMarshalInputStream.java
Added: trunk/core/src/openjdk/java/java/rmi/AccessException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/AccessException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/AccessException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * An <code>AccessException</code> is thrown by certain methods of the
+ * <code>java.rmi.Naming</code> class (specifically <code>bind</code>,
+ * <code>rebind</code>, and <code>unbind</code>) and methods of the
+ * <code>java.rmi.activation.ActivationSystem</code> interface to
+ * indicate that the caller does not have permission to perform the action
+ * requested by the method call. If the method was invoked from a non-local
+ * host, then an <code>AccessException</code> is thrown.
+ *
+ * @version 1.19, 05/05/07
+ * @author Ann Wollrath
+ * @author Roger Riggs
+ * @since JDK1.1
+ * @see java.rmi.Naming
+ * @see java.rmi.activation.ActivationSystem
+ */
+public class AccessException extends java.rmi.RemoteException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = 6314925228044966088L;
+
+ /**
+ * Constructs an <code>AccessException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public AccessException(String s) {
+ super(s);
+ }
+
+ /**
+ * Constructs an <code>AccessException</code> with the specified
+ * detail message and nested exception.
+ *
+ * @param s the detail message
+ * @param ex the nested exception
+ * @since JDK1.1
+ */
+ public AccessException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/AlreadyBoundException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/AlreadyBoundException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/AlreadyBoundException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * An <code>AlreadyBoundException</code> is thrown if an attempt
+ * is made to bind an object in the registry to a name that already
+ * has an associated binding.
+ *
+ * @version 1.19, 05/05/07
+ * @since JDK1.1
+ * @author Ann Wollrath
+ * @author Roger Riggs
+ * @see java.rmi.Naming#bind(String, java.rmi.Remote)
+ * @see java.rmi.registry.Registry#bind(String, java.rmi.Remote)
+ */
+public class AlreadyBoundException extends java.lang.Exception {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = 9218657361741657110L;
+
+ /**
+ * Constructs an <code>AlreadyBoundException</code> with no
+ * specified detail message.
+ * @since JDK1.1
+ */
+ public AlreadyBoundException() {
+ super();
+ }
+
+ /**
+ * Constructs an <code>AlreadyBoundException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public AlreadyBoundException(String s) {
+ super(s);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/ConnectException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/ConnectException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/ConnectException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * A <code>ConnectException</code> is thrown if a connection is refused
+ * to the remote host for a remote method call.
+ *
+ * @version 1.20, 05/05/07
+ * @author Ann Wollrath
+ * @since JDK1.1
+ */
+public class ConnectException extends RemoteException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = 4863550261346652506L;
+
+ /**
+ * Constructs a <code>ConnectException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public ConnectException(String s) {
+ super(s);
+ }
+
+ /**
+ * Constructs a <code>ConnectException</code> with the specified
+ * detail message and nested exception.
+ *
+ * @param s the detail message
+ * @param ex the nested exception
+ * @since JDK1.1
+ */
+ public ConnectException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/ConnectIOException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/ConnectIOException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/ConnectIOException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,65 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * A <code>ConnectIOException</code> is thrown if an
+ * <code>IOException</code> occurs while making a connection
+ * to the remote host for a remote method call.
+ *
+ * @version 1.19, 05/05/07
+ * @author Ann Wollrath
+ * @since JDK1.1
+ */
+public class ConnectIOException extends RemoteException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = -8087809532704668744L;
+
+ /**
+ * Constructs a <code>ConnectIOException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public ConnectIOException(String s) {
+ super(s);
+ }
+
+
+ /**
+ * Constructs a <code>ConnectIOException</code> with the specified
+ * detail message and nested exception.
+ *
+ * @param s the detail message
+ * @param ex the nested exception
+ * @since JDK1.1
+ */
+ public ConnectIOException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/MarshalException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/MarshalException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/MarshalException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * A <code>MarshalException</code> is thrown if a
+ * <code>java.io.IOException</code> occurs while marshalling the remote call
+ * header, arguments or return value for a remote method call. A
+ * <code>MarshalException</code> is also thrown if the receiver does not
+ * support the protocol version of the sender.
+ *
+ * <p>If a <code>MarshalException</code> occurs during a remote method call,
+ * the call may or may not have reached the server. If the call did reach the
+ * server, parameters may have been deserialized. A call may not be
+ * retransmitted after a <code>MarshalException</code> and reliably preserve
+ * "at most once" call semantics.
+ *
+ * @version 1.19, 05/05/07
+ * @author Ann Wollrath
+ * @since JDK1.1
+ */
+public class MarshalException extends RemoteException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = 6223554758134037936L;
+
+ /**
+ * Constructs a <code>MarshalException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public MarshalException(String s) {
+ super(s);
+ }
+
+ /**
+ * Constructs a <code>MarshalException</code> with the specified
+ * detail message and nested exception.
+ *
+ * @param s the detail message
+ * @param ex the nested exception
+ * @since JDK1.1
+ */
+ public MarshalException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/MarshalledObject.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/MarshalledObject.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/MarshalledObject.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,317 @@
+/*
+ * Copyright 1997-2005 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.rmi;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamConstants;
+import java.io.OutputStream;
+import java.io.Serializable;
+import sun.rmi.server.MarshalInputStream;
+import sun.rmi.server.MarshalOutputStream;
+
+/**
+ * A <code>MarshalledObject</code> contains a byte stream with the serialized
+ * representation of an object given to its constructor. The <code>get</code>
+ * method returns a new copy of the original object, as deserialized from
+ * the contained byte stream. The contained object is serialized and
+ * deserialized with the same serialization semantics used for marshaling
+ * and unmarshaling parameters and return values of RMI calls: When the
+ * serialized form is created:
+ *
+ * <ul>
+ * <li> classes are annotated with a codebase URL from where the class
+ * can be loaded (if available), and
+ * <li> any remote object in the <code>MarshalledObject</code> is
+ * represented by a serialized instance of its stub.
+ * </ul>
+ *
+ * <p>When copy of the object is retrieved (via the <code>get</code> method),
+ * if the class is not available locally, it will be loaded from the
+ * appropriate location (specified the URL annotated with the class descriptor
+ * when the class was serialized.
+ *
+ * <p><code>MarshalledObject</code> facilitates passing objects in RMI calls
+ * that are not automatically deserialized immediately by the remote peer.
+ *
+ * @param <T> the type of the object contained in this
+ * <code>MarshalledObject</code>
+ *
+ * @version 1.41, 05/05/07
+ * @author Ann Wollrath
+ * @author Peter Jones
+ * @since 1.2
+ */
+public final class MarshalledObject<T> implements Serializable {
+ /**
+ * @serial Bytes of serialized representation. If <code>objBytes</code> is
+ * <code>null</code> then the object marshalled was a <code>null</code>
+ * reference.
+ */
+ private byte[] objBytes = null;
+
+ /**
+ * @serial Bytes of location annotations, which are ignored by
+ * <code>equals</code>. If <code>locBytes</code> is null, there were no
+ * non-<code>null</code> annotations during marshalling.
+ */
+ private byte[] locBytes = null;
+
+ /**
+ * @serial Stored hash code of contained object.
+ *
+ * @see #hashCode
+ */
+ private int hash;
+
+ /** Indicate compatibility with 1.2 version of class. */
+ private static final long serialVersionUID = 8988374069173025854L;
+
+ /**
+ * Creates a new <code>MarshalledObject</code> that contains the
+ * serialized representation of the current state of the supplied object.
+ * The object is serialized with the semantics used for marshaling
+ * parameters for RMI calls.
+ *
+ * @param obj the object to be serialized (must be serializable)
+ * @exception IOException if an <code>IOException</code> occurs; an
+ * <code>IOException</code> may occur if <code>obj</code> is not
+ * serializable.
+ * @since 1.2
+ */
+ public MarshalledObject(T obj) throws IOException {
+ if (obj == null) {
+ hash = 13;
+ return;
+ }
+
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ ByteArrayOutputStream lout = new ByteArrayOutputStream();
+ MarshalledObjectOutputStream out =
+ new MarshalledObjectOutputStream(bout, lout);
+ out.writeObject(obj);
+ out.flush();
+ objBytes = bout.toByteArray();
+ // locBytes is null if no annotations
+ locBytes = (out.hadAnnotations() ? lout.toByteArray() : null);
+
+ /*
+ * Calculate hash from the marshalled representation of object
+ * so the hashcode will be comparable when sent between VMs.
+ */
+ int h = 0;
+ for (int i = 0; i < objBytes.length; i++) {
+ h = 31 * h + objBytes[i];
+ }
+ hash = h;
+ }
+
+ /**
+ * Returns a new copy of the contained marshalledobject. The internal
+ * representation is deserialized with the semantics used for
+ * unmarshaling paramters for RMI calls.
+ *
+ * @return a copy of the contained object
+ * @exception IOException if an <code>IOException</code> occurs while
+ * deserializing the object from its internal representation.
+ * @exception ClassNotFoundException if a
+ * <code>ClassNotFoundException</code> occurs while deserializing the
+ * object from its internal representation.
+ * could not be found
+ * @since 1.2
+ */
+ public T get() throws IOException, ClassNotFoundException {
+ if (objBytes == null) // must have been a null object
+ return null;
+
+ ByteArrayInputStream bin = new ByteArrayInputStream(objBytes);
+ // locBytes is null if no annotations
+ ByteArrayInputStream lin =
+ (locBytes == null ? null : new ByteArrayInputStream(locBytes));
+ MarshalledObjectInputStream in =
+ new MarshalledObjectInputStream(bin, lin);
+ T obj = (T) in.readObject();
+ in.close();
+ return obj;
+ }
+
+ /**
+ * Return a hash code for this <code>MarshalledObject</code>.
+ *
+ * @return a hash code
+ */
+ public int hashCode() {
+ return hash;
+ }
+
+ /**
+ * Compares this <code>MarshalledObject</code> to another object.
+ * Returns true if and only if the argument refers to a
+ * <code>MarshalledObject</code> that contains exactly the same
+ * serialized representation of an object as this one does. The
+ * comparison ignores any class codebase annotation, meaning that
+ * two objects are equivalent if they have the same serialized
+ * representation <i>except</i> for the codebase of each class
+ * in the serialized representation.
+ *
+ * @param obj the object to compare with this <code>MarshalledObject</code>
+ * @return <code>true</code> if the argument contains an equaivalent
+ * serialized object; <code>false</code> otherwise
+ * @since 1.2
+ */
+ public boolean equals(Object obj) {
+ if (obj == this)
+ return true;
+
+ if (obj != null && obj instanceof MarshalledObject) {
+ MarshalledObject other = (MarshalledObject) obj;
+
+ // if either is a ref to null, both must be
+ if (objBytes == null || other.objBytes == null)
+ return objBytes == other.objBytes;
+
+ // quick, easy test
+ if (objBytes.length != other.objBytes.length)
+ return false;
+
+ //!! There is talk about adding an array comparision method
+ //!! at 1.2 -- if so, this should be rewritten. -arnold
+ for (int i = 0; i < objBytes.length; ++i) {
+ if (objBytes[i] != other.objBytes[i])
+ return false;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * This class is used to marshal objects for
+ * <code>MarshalledObject</code>. It places the location annotations
+ * to one side so that two <code>MarshalledObject</code>s can be
+ * compared for equality if they differ only in location
+ * annotations. Objects written using this stream should be read back
+ * from a <code>MarshalledObjectInputStream</code>.
+ *
+ * @see java.rmi.MarshalledObject
+ * @see MarshalledObjectInputStream
+ */
+ private static class MarshalledObjectOutputStream
+ extends MarshalOutputStream
+ {
+ /** The stream on which location objects are written. */
+ private ObjectOutputStream locOut;
+
+ /** <code>true</code> if non-<code>null</code> annotations are
+ * written.
+ */
+ private boolean hadAnnotations;
+
+ /**
+ * Creates a new <code>MarshalledObjectOutputStream</code> whose
+ * non-location bytes will be written to <code>objOut</code> and whose
+ * location annotations (if any) will be written to
+ * <code>locOut</code>.
+ */
+ MarshalledObjectOutputStream(OutputStream objOut, OutputStream locOut)
+ throws IOException
+ {
+ super(objOut);
+ this.useProtocolVersion(ObjectStreamConstants.PROTOCOL_VERSION_2);
+ this.locOut = new ObjectOutputStream(locOut);
+ hadAnnotations = false;
+ }
+
+ /**
+ * Returns <code>true</code> if any non-<code>null</code> location
+ * annotations have been written to this stream.
+ */
+ boolean hadAnnotations() {
+ return hadAnnotations;
+ }
+
+ /**
+ * Overrides MarshalOutputStream.writeLocation implementation to write
+ * annotations to the location stream.
+ */
+ protected void writeLocation(String loc) throws IOException {
+ hadAnnotations |= (loc != null);
+ locOut.writeObject(loc);
+ }
+
+
+ public void flush() throws IOException {
+ super.flush();
+ locOut.flush();
+ }
+ }
+
+ /**
+ * The counterpart to <code>MarshalledObjectOutputStream</code>.
+ *
+ * @see MarshalledObjectOutputStream
+ */
+ private static class MarshalledObjectInputStream
+ extends MarshalInputStream
+ {
+ /**
+ * The stream from which annotations will be read. If this is
+ * <code>null</code>, then all annotations were <code>null</code>.
+ */
+ private ObjectInputStream locIn;
+
+ /**
+ * Creates a new <code>MarshalledObjectInputStream</code> that
+ * reads its objects from <code>objIn</code> and annotations
+ * from <code>locIn</code>. If <code>locIn</code> is
+ * <code>null</code>, then all annotations will be
+ * <code>null</code>.
+ */
+ MarshalledObjectInputStream(InputStream objIn, InputStream locIn)
+ throws IOException
+ {
+ super(objIn);
+ this.locIn = (locIn == null ? null : new ObjectInputStream(locIn));
+ }
+
+ /**
+ * Overrides MarshalInputStream.readLocation to return locations from
+ * the stream we were given, or <code>null</code> if we were given a
+ * <code>null</code> location stream.
+ */
+ protected Object readLocation()
+ throws IOException, ClassNotFoundException
+ {
+ return (locIn == null ? null : locIn.readObject());
+ }
+ }
+
+}
Added: trunk/core/src/openjdk/java/java/rmi/Naming.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/Naming.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/Naming.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,357 @@
+/*
+ * Copyright 1996-2005 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.rmi;
+
+import java.rmi.registry.*;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * The <code>Naming</code> class provides methods for storing and obtaining
+ * references to remote objects in a remote object registry. Each method of
+ * the <code>Naming</code> class takes as one of its arguments a name that
+ * is a <code>java.lang.String</code> in URL format (without the
+ * scheme component) of the form:
+ *
+ * <PRE>
+ * //host:port/name
+ * </PRE>
+ *
+ * <P>where <code>host</code> is the host (remote or local) where the registry
+ * is located, <code>port</code> is the port number on which the registry
+ * accepts calls, and where <code>name</code> is a simple string uninterpreted
+ * by the registry. Both <code>host</code> and <code>port</code> are optional.
+ * If <code>host</code> is omitted, the host defaults to the local host. If
+ * <code>port</code> is omitted, then the port defaults to 1099, the
+ * "well-known" port that RMI's registry, <code>rmiregistry</code>, uses.
+ *
+ * <P><em>Binding</em> a name for a remote object is associating or
+ * registering a name for a remote object that can be used at a later time to
+ * look up that remote object. A remote object can be associated with a name
+ * using the <code>Naming</code> class's <code>bind</code> or
+ * <code>rebind</code> methods.
+ *
+ * <P>Once a remote object is registered (bound) with the RMI registry on the
+ * local host, callers on a remote (or local) host can lookup the remote
+ * object by name, obtain its reference, and then invoke remote methods on the
+ * object. A registry may be shared by all servers running on a host or an
+ * individual server process may create and use its own registry if desired
+ * (see <code>java.rmi.registry.LocateRegistry.createRegistry</code> method
+ * for details).
+ *
+ * @version 1.13, 09/05/99
+ * @author Ann Wollrath
+ * @author Roger Riggs
+ * @since JDK1.1
+ * @see java.rmi.registry.Registry
+ * @see java.rmi.registry.LocateRegistry
+ * @see java.rmi.registry.LocateRegistry#createRegistry(int)
+ */
+public final class Naming {
+ /**
+ * Disallow anyone from creating one of these
+ */
+ private Naming() {}
+
+ /**
+ * Returns a reference, a stub, for the remote object associated
+ * with the specified <code>name</code>.
+ *
+ * @param name a name in URL format (without the scheme component)
+ * @return a reference for a remote object
+ * @exception NotBoundException if name is not currently bound
+ * @exception RemoteException if registry could not be contacted
+ * @exception AccessException if this operation is not permitted
+ * @exception MalformedURLException if the name is not an appropriately
+ * formatted URL
+ * @since JDK1.1
+ */
+ public static Remote lookup(String name)
+ throws NotBoundException,
+ java.net.MalformedURLException,
+ RemoteException
+ {
+ ParsedNamingURL parsed = parseURL(name);
+ Registry registry = getRegistry(parsed);
+
+ if (parsed.name == null)
+ return registry;
+ return registry.lookup(parsed.name);
+ }
+
+ /**
+ * Binds the specified <code>name</code> to a remote object.
+ *
+ * @param name a name in URL format (without the scheme component)
+ * @param obj a reference for the remote object (usually a stub)
+ * @exception AlreadyBoundException if name is already bound
+ * @exception MalformedURLException if the name is not an appropriately
+ * formatted URL
+ * @exception RemoteException if registry could not be contacted
+ * @exception AccessException if this operation is not permitted (if
+ * originating from a non-local host, for example)
+ * @since JDK1.1
+ */
+ public static void bind(String name, Remote obj)
+ throws AlreadyBoundException,
+ java.net.MalformedURLException,
+ RemoteException
+ {
+ ParsedNamingURL parsed = parseURL(name);
+ Registry registry = getRegistry(parsed);
+
+ if (obj == null)
+ throw new NullPointerException("cannot bind to null");
+
+ registry.bind(parsed.name, obj);
+ }
+
+ /**
+ * Destroys the binding for the specified name that is associated
+ * with a remote object.
+ *
+ * @param name a name in URL format (without the scheme component)
+ * @exception NotBoundException if name is not currently bound
+ * @exception MalformedURLException if the name is not an appropriately
+ * formatted URL
+ * @exception RemoteException if registry could not be contacted
+ * @exception AccessException if this operation is not permitted (if
+ * originating from a non-local host, for example)
+ * @since JDK1.1
+ */
+ public static void unbind(String name)
+ throws RemoteException,
+ NotBoundException,
+ java.net.MalformedURLException
+ {
+ ParsedNamingURL parsed = parseURL(name);
+ Registry registry = getRegistry(parsed);
+
+ registry.unbind(parsed.name);
+ }
+
+ /**
+ * Rebinds the specified name to a new remote object. Any existing
+ * binding for the name is replaced.
+ *
+ * @param name a name in URL format (without the scheme component)
+ * @param obj new remote object to associate with the name
+ * @exception MalformedURLException if the name is not an appropriately
+ * formatted URL
+ * @exception RemoteException if registry could not be contacted
+ * @exception AccessException if this operation is not permitted (if
+ * originating from a non-local host, for example)
+ * @since JDK1.1
+ */
+ public static void rebind(String name, Remote obj)
+ throws RemoteException, java.net.MalformedURLException
+ {
+ ParsedNamingURL parsed = parseURL(name);
+ Registry registry = getRegistry(parsed);
+
+ if (obj == null)
+ throw new NullPointerException("cannot bind to null");
+
+ registry.rebind(parsed.name, obj);
+ }
+
+ /**
+ * Returns an array of the names bound in the registry. The names are
+ * URL-formatted (without the scheme component) strings. The array contains
+ * a snapshot of the names present in the registry at the time of the
+ * call.
+ *
+ * @param name a registry name in URL format (without the scheme
+ * component)
+ * @return an array of names (in the appropriate format) bound
+ * in the registry
+ * @exception MalformedURLException if the name is not an appropriately
+ * formatted URL
+ * @exception RemoteException if registry could not be contacted.
+ * @since JDK1.1
+ */
+ public static String[] list(String name)
+ throws RemoteException, java.net.MalformedURLException
+ {
+ ParsedNamingURL parsed = parseURL(name);
+ Registry registry = getRegistry(parsed);
+
+ String prefix = "";
+ if (parsed.port > 0 || !parsed.host.equals(""))
+ prefix += "//" + parsed.host;
+ if (parsed.port > 0)
+ prefix += ":" + parsed.port;
+ prefix += "/";
+
+ String[] names = registry.list();
+ for (int i = 0; i < names.length; i++) {
+ names[i] = prefix + names[i];
+ }
+ return names;
+ }
+
+ /**
+ * Returns a registry reference obtained from information in the URL.
+ */
+ private static Registry getRegistry(ParsedNamingURL parsed)
+ throws RemoteException
+ {
+ return LocateRegistry.getRegistry(parsed.host, parsed.port);
+ }
+
+ /**
+ * Dissect Naming URL strings to obtain referenced host, port and
+ * object name.
+ *
+ * @return an object which contains each of the above
+ * components.
+ *
+ * @exception MalformedURLException if given url string is malformed
+ */
+ private static ParsedNamingURL parseURL(String str)
+ throws MalformedURLException
+ {
+ try {
+ return intParseURL(str);
+ } catch (URISyntaxException ex) {
+ /* With RFC 3986 URI handling, 'rmi://:<port>' and
+ * '//:<port>' forms will result in a URI syntax exception
+ * Convert the authority to a localhost:<port> form
+ */
+ MalformedURLException mue = new MalformedURLException(
+ "invalid URL String: " + str);
+ mue.initCause(ex);
+ int indexSchemeEnd = str.indexOf(':');
+ int indexAuthorityBegin = str.indexOf("//:");
+ if (indexAuthorityBegin < 0) {
+ throw mue;
+ }
+ if ((indexAuthorityBegin == 0) ||
+ ((indexSchemeEnd > 0) &&
+ (indexAuthorityBegin == indexSchemeEnd + 1))) {
+ int indexHostBegin = indexAuthorityBegin + 2;
+ String newStr = str.substring(0, indexHostBegin) +
+ "localhost" +
+ str.substring(indexHostBegin);
+ try {
+ return intParseURL(newStr);
+ } catch (URISyntaxException inte) {
+ throw mue;
+ } catch (MalformedURLException inte) {
+ throw inte;
+ }
+ }
+ throw mue;
+ }
+ }
+
+ private static ParsedNamingURL intParseURL(String str)
+ throws MalformedURLException, URISyntaxException
+ {
+ URI uri = new URI(str);
+ if (uri.isOpaque()) {
+ throw new MalformedURLException(
+ "not a hierarchical URL: " + str);
+ }
+ if (uri.getFragment() != null) {
+ throw new MalformedURLException(
+ "invalid character, '#', in URL name: " + str);
+ } else if (uri.getQuery() != null) {
+ throw new MalformedURLException(
+ "invalid character, '?', in URL name: " + str);
+ } else if (uri.getUserInfo() != null) {
+ throw new MalformedURLException(
+ "invalid character, '@', in URL host: " + str);
+ }
+ String scheme = uri.getScheme();
+ if (scheme != null && !scheme.equals("rmi")) {
+ throw new MalformedURLException("invalid URL scheme: " + str);
+ }
+
+ String name = uri.getPath();
+ if (name != null) {
+ if (name.startsWith("/")) {
+ name = name.substring(1);
+ }
+ if (name.length() == 0) {
+ name = null;
+ }
+ }
+
+ String host = uri.getHost();
+ if (host == null) {
+ host = "";
+ try {
+ /*
+ * With 2396 URI handling, forms such as 'rmi://host:bar'
+ * or 'rmi://:<port>' are parsed into a registry based
+ * authority. We only want to allow server based naming
+ * authorities.
+ */
+ uri.parseServerAuthority();
+ } catch (URISyntaxException use) {
+ // Check if the authority is of form ':<port>'
+ String authority = uri.getAuthority();
+ if (authority != null && authority.startsWith(":")) {
+ // Convert the authority to 'localhost:<port>' form
+ authority = "localhost" + authority;
+ try {
+ uri = new URI(null, authority, null, null, null);
+ // Make sure it now parses to a valid server based
+ // naming authority
+ uri.parseServerAuthority();
+ } catch (URISyntaxException use2) {
+ throw new
+ MalformedURLException("invalid authority: " + str);
+ }
+ } else {
+ throw new
+ MalformedURLException("invalid authority: " + str);
+ }
+ }
+ }
+ int port = uri.getPort();
+ if (port == -1) {
+ port = Registry.REGISTRY_PORT;
+ }
+ return new ParsedNamingURL(host, port, name);
+ }
+
+ /**
+ * Simple class to enable multiple URL return values.
+ */
+ private static class ParsedNamingURL {
+ String host;
+ int port;
+ String name;
+
+ ParsedNamingURL(String host, int port, String name) {
+ this.host = host;
+ this.port = port;
+ this.name = name;
+ }
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/NoSuchObjectException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/NoSuchObjectException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/NoSuchObjectException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * A <code>NoSuchObjectException</code> is thrown if an attempt is made to
+ * invoke a method on an object that no longer exists in the remote virtual
+ * machine. If a <code>NoSuchObjectException</code> occurs attempting to
+ * invoke a method on a remote object, the call may be retransmitted and still
+ * preserve RMI's "at most once" call semantics.
+ *
+ * A <code>NoSuchObjectException</code> is also thrown by the method
+ * <code>java.rmi.server.RemoteObject.toStub</code> and by the
+ * <code>unexportObject</code> methods of
+ * <code>java.rmi.server.UnicastRemoteObject</code> and
+ * <code>java.rmi.activation.Activatable</code> and
+ *
+ * @version 1.19, 05/05/07
+ * @author Ann Wollrath
+ * @since JDK1.1
+ * @see java.rmi.server.RemoteObject#toStub(Remote)
+ * @see java.rmi.server.UnicastRemoteObject#unexportObject(Remote,boolean)
+ * @see java.rmi.activation.Activatable#unexportObject(Remote,boolean)
+ */
+public class NoSuchObjectException extends RemoteException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = 6619395951570472985L;
+
+ /**
+ * Constructs a <code>NoSuchObjectException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public NoSuchObjectException(String s) {
+ super(s);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/NotBoundException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/NotBoundException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/NotBoundException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,65 @@
+/*
+ * Copyright 1996-1998 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.rmi;
+
+/**
+ * A <code>NotBoundException</code> is thrown if an attempt
+ * is made to lookup or unbind in the registry a name that has
+ * no associated binding.
+ *
+ * @version 1.19, 05/05/07
+ * @since JDK1.1
+ * @author Ann Wollrath
+ * @author Roger Riggs
+ * @see java.rmi.Naming#lookup(String)
+ * @see java.rmi.Naming#unbind(String)
+ * @see java.rmi.registry.Registry#lookup(String)
+ * @see java.rmi.registry.Registry#unbind(String)
+ */
+public class NotBoundException extends java.lang.Exception {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = -1857741824849069317L;
+
+ /**
+ * Constructs a <code>NotBoundException</code> with no
+ * specified detail message.
+ * @since JDK1.1
+ */
+ public NotBoundException() {
+ super();
+ }
+
+ /**
+ * Constructs a <code>NotBoundException</code> with the specified
+ * detail message.
+ *
+ * @param s the detail message
+ * @since JDK1.1
+ */
+ public NotBoundException(String s) {
+ super(s);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/RMISecurityException.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/RMISecurityException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/RMISecurityException.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 1996-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.rmi;
+
+/**
+ * An <code>RMISecurityException</code> signals that a security exception
+ * has occurred during the execution of one of
+ * <code>java.rmi.RMISecurityManager</code>'s methods.
+ *
+ * @version 1.23, 05/05/07
+ * @author Roger Riggs
+ * @since JDK1.1
+ * @deprecated Use {@link java.lang.SecurityException} instead.
+ * Application code should never directly reference this class, and
+ * <code>RMISecurityManager</code> no longer throws this subclass of
+ * <code>java.lang.SecurityException</code>.
+ */
+@Deprecated
+public class RMISecurityException extends java.lang.SecurityException {
+
+ /* indicate compatibility with JDK 1.1.x version of class */
+ private static final long serialVersionUID = -8433406075740433514L;
+
+ /**
+ * Construct an <code>RMISecurityException</code> with a detail message.
+ * @param name the detail message
+ * @since JDK1.1
+ * @deprecated no replacement
+ */
+ @Deprecated
+ public RMISecurityException(String name) {
+ super(name);
+ }
+
+ /**
+ * Construct an <code>RMISecurityException</code> with a detail message.
+ * @param name the detail message
+ * @param arg ignored
+ * @since JDK1.1
+ * @deprecated no replacement
+ */
+ @Deprecated
+ public RMISecurityException(String name, String arg) {
+ this(name);
+ }
+}
Added: trunk/core/src/openjdk/java/java/rmi/RMISecurityManager.java
===================================================================
--- trunk/core/src/openjdk/java/java/rmi/RMISecurityManager.java (rev 0)
+++ trunk/core/src/openjdk/java/java/rmi/RMISecurityManager.java 2007-06-17 10:09:41 UTC (rev 3274)
@@ -0,0 +1,65 @@
+/*
+ * Copyright 1996-2003 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.rmi;
+
+import java.security.*;
+
+/**
+ * A subclass of {@link SecurityManager} used by RMI applications that use
+ * downloaded code. RMI's class loader will not download an...
[truncated message content] |