harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r407625 [3/16] - in /incubator/harmony/enhanced/classlib/trunk/modules/rmi3: ./ doc/ make/ src/ src/common/ src/common/javasrc/ src/common/javasrc/java/ src/common/javasrc/java/rmi/ src/common/javasrc/java/rmi/activation/ src/common/javasrc...
Date Thu, 18 May 2006 20:01:30 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationID.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationID.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationID.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationID.java Thu May 18 13:01:22 2006
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.15.2.3 $
+ */
+package java.rmi.activation;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.rmi.MarshalledObject;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.server.RMIClassLoader;
+import java.rmi.server.RemoteObject;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.UID;
+
+import org.apache.harmony.rmi.common.RMILog;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.15.2.3 $
+ */
+public class ActivationID implements Serializable {
+
+    /**
+     * Serial Version UID
+     */
+    private static final long serialVersionUID = -4608673054848209235L;
+
+    /**
+     * A unique identifier for the object.
+     */
+    private transient UID uid = new UID();
+
+    /**
+     * A remote reference to the object's activator.
+     */
+    private transient Activator activator;
+
+    private static RMILog rlog = RMILog.getActivationLog();
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationID(Activator activator) {
+        this.activator = activator;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Remote activate(boolean force) throws ActivationException,
+            UnknownObjectException, RemoteException {
+        rlog.log(RMILog.VERBOSE, "ActivationID.activate: activator = "
+                + activator);
+
+        try {
+            MarshalledObject stub = (MarshalledObject) activator.activate(this,
+                    force);
+            rlog.log(RMILog.VERBOSE, "ActivationID.activate:stub=" + stub);
+            Remote deserialized_stub = (Remote) stub.get();
+            rlog.log(RMILog.VERBOSE,
+                    "ActivationID.activate: deserialized_stub = "
+                            + deserialized_stub);
+
+            rlog.log(RMILog.VERBOSE,
+                    "<<<<<<<<< ActivationID.activate COMPLETED.");
+
+            return deserialized_stub;
+        } catch (IOException ioe) {
+            throw new RemoteException(
+                    "An IOException occured while deserializing the object" +
+                    " from its internal representation.");
+        } catch (ClassNotFoundException cnfe) {
+            throw new RemoteException(
+                    "A ClassNotFoundException occured while deserializing the " +
+                    "object from its internal representation.");
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof ActivationID) {
+            ActivationID castedObj = (ActivationID) obj;
+            boolean p0, p1;
+            p0 = uid.equals(castedObj.uid);
+            p1 = activator.equals(castedObj.activator);
+            return p0 && p1;
+        }
+        return false;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public int hashCode() {
+        return activator.hashCode() ^ uid.hashCode();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    private void readObject(ObjectInputStream in) throws IOException,
+            ClassNotFoundException {
+        rlog.log(RMILog.VERBOSE, "ActivationID.readObject:");
+        try {
+            uid = (UID) in.readObject();
+            rlog.log(RMILog.VERBOSE, "UID=" + uid);
+
+            String refType = in.readUTF();
+            rlog.log(RMILog.VERBOSE, "refType=" + refType);
+
+            Class cl = Class.forName("org.apache.harmony.rmi.remoteref."
+                    + refType);
+            RemoteRef ref = (RemoteRef) cl.newInstance();
+            rlog.log(RMILog.VERBOSE, "ref = " + ref);
+            ref.readExternal(in);
+            rlog.log(RMILog.VERBOSE, "readExternal finished successfully.");
+
+            Class activator_class = RMIClassLoader.loadClass((String) null,
+                    "org.apache.harmony.rmi.activation.Rmid_Stub");
+            Class constructor_parameter_classes[] = { RemoteRef.class };
+            Constructor constructor = activator_class
+                    .getConstructor(constructor_parameter_classes);
+            Object[] constructor_parameters = { ref };
+            activator = (Activator) constructor
+                    .newInstance(constructor_parameters);
+            rlog.log(RMILog.VERBOSE,
+                    "ActivationID.readObject COMPLETED.");
+        } catch (Throwable t) {
+            throw new IOException("Unable to deserialize ActivationID: " + t);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    private void writeObject(ObjectOutputStream out) throws IOException,
+            ClassNotFoundException {
+        rlog.log(RMILog.VERBOSE, "ActivationID.writeObject:");
+        try {
+            out.writeObject(uid);
+            rlog.log(RMILog.VERBOSE, "activator = " + activator);
+
+            RemoteRef ref = ((RemoteObject) activator).getRef();
+            rlog.log(RMILog.VERBOSE, "ref = " + ref);
+
+            String refType = ref.getRefClass(out);
+            rlog.log(RMILog.VERBOSE, "refType = " + refType);
+            out.writeUTF(refType);
+            ref.writeExternal(out);
+            rlog.log(RMILog.VERBOSE,
+                    "ActivationID.writeObject COMPLETED.");
+
+        } catch (Throwable t) {
+            throw new IOException("Unable to serialize ActivationID: "
+                    + t.getMessage());
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String toString() {
+        return "ActivationID: " + "[" + uid + "; " + activator + "]";
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationID.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationInstantiator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationInstantiator.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationInstantiator.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationInstantiator.java Thu May 18 13:01:22 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.5.4.3 $
+ */
+package java.rmi.activation;
+
+import java.rmi.MarshalledObject;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.5.4.3 $
+ */
+public interface ActivationInstantiator extends Remote {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public MarshalledObject newInstance(ActivationID a0, ActivationDesc a1)
+            throws ActivationException, RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationInstantiator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationMonitor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationMonitor.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationMonitor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationMonitor.java Thu May 18 13:01:22 2006
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.5.4.2 $
+ */
+package java.rmi.activation;
+
+import java.rmi.MarshalledObject;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.5.4.2 $
+ */
+public interface ActivationMonitor extends Remote {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void activeObject(ActivationID a0, MarshalledObject a1)
+            throws UnknownObjectException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void inactiveObject(ActivationID a0)
+            throws UnknownObjectException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void inactiveGroup(ActivationGroupID a0, long a1)
+            throws UnknownGroupException, RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationSystem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationSystem.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationSystem.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationSystem.java Thu May 18 13:01:22 2006
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.2.3 $
+ */
+package java.rmi.activation;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.2.3 $
+ */
+public interface ActivationSystem extends Remote {
+
+    public static final int SYSTEM_PORT = 1098;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationMonitor activeGroup(ActivationGroupID gID,
+                                         ActivationInstantiator aInst,
+                                         long incarnation)
+            throws UnknownGroupException, ActivationException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID gID,
+                                                      ActivationGroupDesc gDesc)
+            throws ActivationException, UnknownGroupException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationDesc setActivationDesc(ActivationID aID,
+                                            ActivationDesc aDesc)
+            throws ActivationException, UnknownObjectException,
+                   UnknownGroupException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationID registerObject(ActivationDesc aDesc)
+            throws ActivationException, UnknownGroupException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationGroupID registerGroup(ActivationGroupDesc gDesc)
+            throws ActivationException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID gID)
+            throws ActivationException, UnknownGroupException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ActivationDesc getActivationDesc(ActivationID aID)
+            throws ActivationException, UnknownObjectException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void unregisterObject(ActivationID aID)
+            throws ActivationException, UnknownObjectException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void unregisterGroup(ActivationGroupID gID)
+            throws ActivationException, UnknownGroupException, RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void shutdown() throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/ActivationSystem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/Activator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/Activator.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/Activator.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/Activator.java Thu May 18 13:01:22 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.4.2 $
+ */
+package java.rmi.activation;
+
+import java.rmi.MarshalledObject;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.4.2 $
+ */
+public interface Activator extends Remote {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public MarshalledObject activate(ActivationID id, boolean force)
+            throws ActivationException, UnknownObjectException, RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownGroupException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownGroupException.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownGroupException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownGroupException.java Thu May 18 13:01:22 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.4.3 $
+ */
+package java.rmi.activation;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.6.4.3 $
+ */
+public class UnknownGroupException extends ActivationException {
+
+    private static final long serialVersionUID = 7056094974750002460L;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public UnknownGroupException(String message) {
+        super(message);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownGroupException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownObjectException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownObjectException.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownObjectException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownObjectException.java Thu May 18 13:01:22 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.7.4.3 $
+ */
+package java.rmi.activation;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Victor A. Martynov
+ * @version $Revision: 1.7.4.3 $
+ */
+public class UnknownObjectException extends ActivationException {
+
+    private static final long serialVersionUID = 3425547551622251430L;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public UnknownObjectException(String message) {
+        super(message);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/UnknownObjectException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/package.html
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/package.html?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/package.html (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/package.html Thu May 18 13:01:22 2006
@@ -0,0 +1,25 @@
+<html>
+<!--
+Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+Author:  Vasily Zakharov
+Version: $Revision: 1.1.2.1 $
+-->
+<body>
+RMI Activation package.
+</body>
+</html>

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/activation/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/DGC.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/DGC.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/DGC.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/DGC.java Thu May 18 13:01:22 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.dgc;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.server.ObjID;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public interface DGC extends Remote {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Lease dirty(ObjID[] ids, long seqNum, Lease lease)
+            throws RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void clean(ObjID[] ids, long seqNum, VMID vmid, boolean strong)
+            throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/DGC.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/Lease.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/Lease.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/Lease.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/Lease.java Thu May 18 13:01:22 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.dgc;
+
+import java.io.Serializable;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public final class Lease implements Serializable {
+    private static final long serialVersionUID = -5713411624328831948L;
+    private VMID vmid;
+    private long value;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Lease(VMID vmid, long l) {
+        this.vmid = vmid;
+        this.value = l;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public VMID getVMID() {
+        return vmid;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public long getValue() {
+        return value;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/Lease.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/VMID.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/VMID.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/VMID.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/VMID.java Thu May 18 13:01:22 2006
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.7.4.2 $
+ */
+package java.rmi.dgc;
+
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.net.InetAddress;
+import java.rmi.server.UID;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Arrays;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.7.4.2 $
+ */
+public final class VMID implements Serializable {
+    private static final long serialVersionUID = -538642295484486218L;
+    private byte[] addr;
+    private UID uid;
+
+    /*
+     * If true then we successfully obtained host address and this VMID could
+     * be treated as unique.
+     */
+    private static boolean unique = true;
+
+    /*
+     * This VM local address. If it was successfully obtained then isUnique()
+     * method for VMIDs created in this VM will return true, otherwise addr
+     * fields will be set to address 127.0.0.1 and isUnique() method will
+     * return false.
+     */
+    private static byte[] localAddr = (byte[]) AccessController.doPrivileged(
+            new PrivilegedAction() {
+                public Object run() {
+                    try {
+                        return InetAddress.getLocalHost().getAddress();
+                    } catch (Exception ex) {
+                        unique = false;
+                        return new byte[] { 127, 0, 0, 1 };
+                    }
+                }
+            });
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public VMID() {
+        addr = localAddr;
+        uid = new UID();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * It returns hexadecimal representation of address with 2 positions for
+     * each byte.
+     */
+    public String toString() {
+        String str = "VMID[";
+
+        for (int i = 0; i < addr.length; ++i) {
+            int ibyte = addr[i] & 255; // quick way to have a module of the byte
+
+            str += ((ibyte < 16) ? "0" : "") + Integer.toString(ibyte, 16);
+        }
+        return str + ", " + uid + "]";
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof VMID)) {
+            return false;
+        }
+        VMID vmid = (VMID) obj;
+        return uid.equals(vmid.uid) && Arrays.equals(addr, vmid.addr);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public int hashCode() {
+        return uid.hashCode();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static boolean isUnique() {
+        return unique;
+    }
+
+    private void readObject(ObjectInput in)
+            throws IOException, ClassNotFoundException {
+        addr = (byte []) in.readObject();
+        uid = UID.read(in);
+    }
+
+    private void writeObject(ObjectOutput out) throws IOException {
+        out.writeObject(addr);
+        uid.write(out);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/VMID.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/package.html
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/package.html?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/package.html (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/package.html Thu May 18 13:01:22 2006
@@ -0,0 +1,25 @@
+<html>
+<!--
+Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+Author:  Vasily Zakharov
+Version: $Revision: 1.1.2.1 $
+-->
+<body>
+RMI distributed garbage collector package.
+</body>
+</html>

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/dgc/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/package.html
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/package.html?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/package.html (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/package.html Thu May 18 13:01:22 2006
@@ -0,0 +1,25 @@
+<html>
+<!--
+Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+Author:  Vasily Zakharov
+Version: $Revision: 1.1.2.1 $
+-->
+<body>
+Core RMI package.
+</body>
+</html>

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/LocateRegistry.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/LocateRegistry.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/LocateRegistry.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/LocateRegistry.java Thu May 18 13:01:22 2006
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.8.4.3 $
+ */
+package java.rmi.registry;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.rmi.RemoteException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.ObjID;
+import java.rmi.server.RemoteRef;
+
+import org.apache.harmony.rmi.registry.RegistryImpl;
+import org.apache.harmony.rmi.remoteref.UnicastRef;
+import org.apache.harmony.rmi.remoteref.UnicastRef2;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * This class could not be instantiated.
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.8.4.3 $
+ */
+public final class LocateRegistry {
+
+    // This class could not be instantiated.
+    private LocateRegistry() {
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry createRegistry(int port,
+                                          RMIClientSocketFactory csf,
+                                          RMIServerSocketFactory ssf)
+            throws RemoteException {
+        return new RegistryImpl(port, csf, ssf);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry getRegistry(String host,
+                                       int port,
+                                       RMIClientSocketFactory csf)
+            throws RemoteException {
+        if (host == null) {
+            try {
+                host = InetAddress.getLocalHost().getHostName();
+            } catch (UnknownHostException uhe) {
+                host = "localhost";
+            }
+        }
+
+        if (port <= 0) {
+            port = Registry.REGISTRY_PORT;
+        }
+
+        try {
+            Class regClass = Class.forName(
+                    "org.apache.harmony.rmi.registry.RegistryImpl_Stub");
+            RemoteRef ref;
+
+            if (csf == null) {
+                ref = new UnicastRef(host, port, new ObjID(ObjID.REGISTRY_ID));
+            } else {
+                ref = new UnicastRef2(host, port, csf,
+                        new ObjID(ObjID.REGISTRY_ID));
+            }
+            return (Registry) regClass.getConstructor(
+                    new Class[] { RemoteRef.class }).newInstance(
+                            new Object[] { ref });
+        } catch (Exception ex) {
+            throw new RemoteException("Unable to get registry.", ex);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry getRegistry(String host, int port)
+            throws RemoteException {
+        return getRegistry(host, port, null);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry getRegistry(String host) throws RemoteException {
+        return getRegistry(host, Registry.REGISTRY_PORT);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry getRegistry(int port) throws RemoteException {
+        return getRegistry(null, port);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry createRegistry(int port) throws RemoteException {
+        return createRegistry(port, null, null);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Registry getRegistry() throws RemoteException {
+        return getRegistry(Registry.REGISTRY_PORT);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/LocateRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/Registry.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/Registry.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/Registry.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/Registry.java Thu May 18 13:01:22 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.registry;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public interface Registry extends Remote {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final int REGISTRY_PORT = 1099;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void rebind(String name, Remote obj)
+            throws RemoteException, AccessException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void bind(String name, Remote obj)
+            throws RemoteException, AlreadyBoundException, AccessException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Remote lookup(String name)
+            throws RemoteException, NotBoundException, AccessException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void unbind(String name)
+            throws RemoteException, NotBoundException, AccessException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String[] list()
+            throws RemoteException, AccessException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/Registry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/RegistryHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/RegistryHandler.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/RegistryHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/RegistryHandler.java Thu May 18 13:01:22 2006
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.1 $
+ */
+package java.rmi.registry;
+
+import java.rmi.RemoteException;
+import java.rmi.UnknownHostException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.1 $
+ */
+public interface RegistryHandler {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Registry registryImpl(int port) throws RemoteException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Registry registryStub(String host, int port)
+            throws RemoteException, UnknownHostException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/RegistryHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/package.html
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/package.html?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/package.html (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/package.html Thu May 18 13:01:22 2006
@@ -0,0 +1,25 @@
+<html>
+<!--
+Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+Author:  Vasily Zakharov
+Version: $Revision: 1.1.2.1 $
+-->
+<body>
+RMI Registry package.
+</body>
+</html>

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/registry/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ExportException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ExportException.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ExportException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ExportException.java Thu May 18 13:01:22 2006
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.2 $
+ */
+package java.rmi.server;
+
+import java.rmi.RemoteException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.2 $
+ */
+public class ExportException extends RemoteException {
+
+    private static final long serialVersionUID = -9155485338494060170L;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ExportException(String msg, Exception cause) {
+        super(msg, cause);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ExportException(String msg) {
+        super(msg);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ExportException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LoaderHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LoaderHandler.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LoaderHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LoaderHandler.java Thu May 18 13:01:22 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.2 $
+ */
+package java.rmi.server;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.2 $
+ */
+public interface LoaderHandler {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final String packagePrefix = "org.apache.harmony.rmi";
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Object getSecurityContext(ClassLoader loader);
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Class loadClass(URL codebase, String name)
+            throws MalformedURLException, ClassNotFoundException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Class loadClass(String name)
+            throws MalformedURLException, ClassNotFoundException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LoaderHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LogStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LogStream.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LogStream.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LogStream.java Thu May 18 13:01:22 2006
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.2 $
+ */
+package java.rmi.server;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Hashtable;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * Note: this class is not used by RMI runtime.
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.2 $
+ */
+public class LogStream extends PrintStream {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final int SILENT = 0;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final int BRIEF = 10;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static final int VERBOSE = 20;
+
+    // The default print stream.
+    private static PrintStream defaultStream = System.err;
+
+    // The list of created LogStreams. Their names are keys in the table.
+    private static Hashtable logStreams = new Hashtable();
+
+    // The name of this LogStream
+    private String name;
+
+    /*
+     * True if write method was never called or '\n' (new-line symbol was
+     * the last symbol written to the underlying stream.
+     */
+    private boolean isFirstByte = true;
+
+    /*
+     * Constructs LogStream having the given name and writing to the given
+     * OutputStream.
+     */
+    private LogStream(String name, OutputStream out) {
+        super(out);
+        this.name = name;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String toString() {
+        return "LogStream[" + name + "]";
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void write(byte[] b, int off, int len) {
+        for (int i = 0; i < len; ++i) {
+            write(b[off + i]);
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void write(int b) {
+        synchronized (this) {
+            if (b == '\n') {
+                write(b);
+                isFirstByte = true;
+            } else {
+                if (isFirstByte) {
+                    print(toString() + ":");
+                    isFirstByte = false;
+                }
+                super.write(b);
+            }
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public synchronized void setOutputStream(OutputStream out) {
+        this.out = out;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public synchronized OutputStream getOutputStream() {
+        return out;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static int parseLevel(String levelStr) {
+        if (levelStr == null) {
+            return -1;
+        }
+        levelStr = levelStr.trim().toUpperCase();
+
+        if (levelStr.equals("SILENT")) {
+            return SILENT;
+        } else if (levelStr.equals("BRIEF")) {
+            return BRIEF;
+        } else if (levelStr.equals("VERBOSE")) {
+            return VERBOSE;
+        } else {
+            try {
+                return Integer.parseInt(levelStr);
+            } catch (NumberFormatException nfe) {
+                return -1;
+            }
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized void setDefaultStream(PrintStream stream) {
+        defaultStream = stream;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized PrintStream getDefaultStream() {
+        return defaultStream;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static LogStream log(String name) {
+        synchronized (logStreams) {
+            LogStream stream = (LogStream) logStreams.get(name);
+
+            if (stream != null) {
+                return stream;
+            } else {
+                stream = new LogStream(name, defaultStream);
+                logStreams.put(name, stream);
+                return stream;
+            }
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/LogStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ObjID.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ObjID.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ObjID.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ObjID.java Thu May 18 13:01:22 2006
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.6.4.3 $
+ */
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.security.AccessController;
+import java.security.SecureRandom;
+
+import org.apache.harmony.rmi.common.GetBooleanPropAction;
+import org.apache.harmony.rmi.common.RMIProperties;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.6.4.3 $
+ */
+public final class ObjID implements Serializable {
+
+    private static final long serialVersionUID = -6386392263968365220L;
+
+    /** @com.intel.drl.spec_ref */
+    public static final int REGISTRY_ID = 0;
+
+    /** @com.intel.drl.spec_ref */
+    public static final int ACTIVATOR_ID = 1;
+
+    /** @com.intel.drl.spec_ref */
+    public static final int DGC_ID = 2;
+
+    private long objNum;
+    private UID space;
+
+    /*
+     * If true then we should use cryptographically strong random number
+     * generator.
+     */
+    private static final boolean useRandom =
+            ((Boolean) AccessController.doPrivileged(new GetBooleanPropAction(
+                    RMIProperties.RANDOMIDS_PROP))).booleanValue();
+
+    /*
+     * Number generator for initializing objNum fields.
+     */
+    private static final NumberGenerator numGenerator = new NumberGenerator();
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ObjID(int num) {
+        objNum = num;
+        space = new UID((short) 0);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ObjID() {
+        objNum = numGenerator.nextLong();
+        space = new UID();
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String toString() {
+        return "ObjID[" + objNum + ", " + space + "]";
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public boolean equals(Object obj) {
+        if (obj != null && (obj instanceof ObjID)) {
+            ObjID id = (ObjID) obj;
+            return (objNum == id.objNum) && space.equals(id.space);
+        }
+        return false;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void write(ObjectOutput out) throws IOException {
+        out.writeLong(objNum);
+        space.write(out);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public int hashCode() {
+        return (int) objNum;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static ObjID read(ObjectInput in) throws IOException {
+        ObjID id = new ObjID(-1);
+        id.objNum = in.readLong();
+        id.space = UID.read(in);
+        return id;
+    }
+
+
+    /*
+     * Generator used for obtaining long numbers both in secure and insecure
+     * variants.
+     */
+    private static class NumberGenerator {
+        // Counter to be used in case of insecure mode.
+        static long numCounter = 65536; // 2^16
+
+        // Secure generator.
+        SecureRandom sGenerator;
+
+        /*
+         * Constructs NumberGenerator for secure/unsecure variants.
+         */
+        NumberGenerator() {
+            if (useRandom) {
+                sGenerator = new SecureRandom();
+            }
+        }
+
+        /*
+         * Returns next long number.
+         */
+        synchronized long nextLong() {
+            return useRandom ? sGenerator.nextLong() : numCounter++;
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/ObjID.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/Operation.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/Operation.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/Operation.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/Operation.java Thu May 18 13:01:22 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.2 $
+ */
+package java.rmi.server;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.2 $
+ */
+public class Operation {
+
+    private String op;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Operation(String op) {
+        this.op = op;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String toString() {
+        return op;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public String getOperation() {
+        return op;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/Operation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoader.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoader.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoader.java Thu May 18 13:01:22 2006
@@ -0,0 +1,237 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.8.4.2 $
+ */
+package java.rmi.server;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.StringTokenizer;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.apache.harmony.rmi.DefaultRMIClassLoaderSpi;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ * This class could not be instantiated.
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.8.4.2 $
+ */
+public class RMIClassLoader {
+
+    // The name of property for custom RMIClassLoaderSpi.
+    private static final String spiProp = "java.rmi.server.RMIClassLoaderSpi";
+
+    // The name of resource for custom RMIClassLoaderSpi.
+    private static final String spiResource =
+            "META-INF/services/java.rmi.server.RMIClassLoaderSpi";
+
+    /*
+     * Default RMIClassLoaderSpi instance.
+     */
+    private static RMIClassLoaderSpi defaultSpi =
+            new DefaultRMIClassLoaderSpi();
+
+    /*
+     * Implementation of RMIClassLoaderSpi which will be used for delegating
+     * method calls of this class to.
+     */
+    private static RMIClassLoaderSpi activeSpi =
+            (RMIClassLoaderSpi) AccessController.doPrivileged(
+                    new PrivilegedAction() {
+                        public Object run() {
+                            return initActiveSpi();
+                        }
+                    });
+
+    // This class could not be instantiated.
+    private RMIClassLoader() {
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Class loadProxyClass(String codebase,
+                                       String[] interf,
+                                       ClassLoader defaultCl)
+            throws ClassNotFoundException, MalformedURLException {
+        return activeSpi.loadProxyClass(codebase, interf, defaultCl);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Class loadClass(String codebase,
+                                  String name,
+                                  ClassLoader defaultCl)
+            throws MalformedURLException, ClassNotFoundException {
+        return activeSpi.loadClass(codebase, name, defaultCl);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Class loadClass(URL codebase, String name)
+            throws MalformedURLException, ClassNotFoundException {
+        return activeSpi.loadClass((codebase == null) ? null
+                                    : codebase.toString(), name, null);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Class loadClass(String codebase, String name)
+            throws MalformedURLException, ClassNotFoundException {
+        return activeSpi.loadClass(codebase, name, null);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static String getClassAnnotation(Class cl) {
+        return activeSpi.getClassAnnotation(cl);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     * It's depricated so we just return null.
+     */
+    public static Object getSecurityContext(ClassLoader loader) {
+        return null;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static ClassLoader getClassLoader(String codebase)
+            throws MalformedURLException, SecurityException {
+        return activeSpi.getClassLoader(codebase);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static Class loadClass(String name)
+            throws MalformedURLException, ClassNotFoundException {
+        return loadClass((String) null, name);
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static RMIClassLoaderSpi getDefaultProviderInstance() {
+        SecurityManager mgr = System.getSecurityManager();
+
+        if (mgr != null) {
+            mgr.checkPermission(new RuntimePermission("setFactory"));
+        }
+        return defaultSpi;
+    }
+
+    /*
+     * Initialize active RMIClassLoaderSpi.
+     */
+    private static RMIClassLoaderSpi initActiveSpi() {
+        String spi = System.getProperty(spiProp);
+
+        if (spi != null) {
+            if (spi.equals("default")) {
+                return defaultSpi;
+            }
+
+            try {
+                return (RMIClassLoaderSpi) (Class.forName(spi, false,
+                        ClassLoader.getSystemClassLoader()).newInstance());
+            } catch (Exception ex) {
+                throw new Error(
+                        "Unable to initialize RMIClassLoaderSpi instance " + spi
+                        + ", specified in " + spiProp + " property", ex);
+            }
+        }
+
+        try {
+            spi = getSpiFromResource();
+        } catch (IOException ioe) {
+            throw new Error("Unable to get RMIClassLoaderSpi name from "
+                    + "resource " + spiResource, ioe);
+        }
+
+        if (spi != null) {
+            try {
+                return (RMIClassLoaderSpi) (Class.forName(spi, true,
+                        ClassLoader.getSystemClassLoader()).newInstance());
+            } catch (Exception ex) {
+                throw new Error(
+                        "Unable to initialize RMIClassLoaderSpi instance " + spi
+                        + ", specified in " + spiResource + " resource", ex);
+            }
+        }
+        return defaultSpi;
+    }
+
+    /*
+     * Returns provider obtained from default resource.
+     *
+     * @return provider obtained from default resource
+     *
+     * @throws IOException if any I/O error occured while trying to read
+     *         provider name from default resource
+     */
+    private static String getSpiFromResource() throws IOException {
+        InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(
+                spiResource);
+
+        if (in == null) {
+            // resource not found
+            return null;
+        }
+        Object obj = null;
+        byte[] buf = new byte[in.available()];
+        in.read(buf);
+        String str = new String(buf, "UTF-8");
+        StringTokenizer tok = new StringTokenizer(str, "\n\r");
+
+        while (tok.hasMoreTokens()) {
+            String spiName = tok.nextToken();
+            int idx = spiName.indexOf("#");
+
+            if (idx != -1) {
+                // this is commented line
+                spiName = spiName.substring(0, idx);
+            }
+            spiName = spiName.trim();
+
+            if (spiName.length() > 0) {
+                // not empty line
+                return spiName;
+            }
+
+            // skip empty line
+        }
+
+        // we did not found any uncommented non-empty lines
+        return "";
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoaderSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoaderSpi.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoaderSpi.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoaderSpi.java Thu May 18 13:01:22 2006
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.server;
+
+import java.net.MalformedURLException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public abstract class RMIClassLoaderSpi {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public RMIClassLoaderSpi() {
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract Class loadProxyClass(String codebase,
+                                         String[] interf,
+                                         ClassLoader defaultCl)
+            throws MalformedURLException, ClassNotFoundException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract Class loadClass(String codebase,
+                                    String name,
+                                    ClassLoader defaultCl)
+            throws MalformedURLException, ClassNotFoundException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract String getClassAnnotation(Class cl);
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract ClassLoader getClassLoader(String name)
+            throws MalformedURLException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClassLoaderSpi.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClientSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClientSocketFactory.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClientSocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClientSocketFactory.java Thu May 18 13:01:22 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.Socket;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public interface RMIClientSocketFactory {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public Socket createSocket(String host, int port) throws IOException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIClientSocketFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIFailureHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIFailureHandler.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIFailureHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIFailureHandler.java Thu May 18 13:01:22 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.server;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public interface RMIFailureHandler {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public boolean failure(Exception ex);
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIFailureHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIServerSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIServerSocketFactory.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIServerSocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIServerSocketFactory.java Thu May 18 13:01:22 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.4.4.1 $
+ */
+public interface RMIServerSocketFactory {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ServerSocket createServerSocket(int port) throws IOException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMIServerSocketFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMISocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMISocketFactory.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMISocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMISocketFactory.java Thu May 18 13:01:22 2006
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.7.4.3 $
+ */
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import org.apache.harmony.rmi.transport.DefaultRMISocketFactory;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.7.4.3 $
+ */
+public abstract class RMISocketFactory
+        implements RMIClientSocketFactory, RMIServerSocketFactory {
+
+    /*
+     * Global RMISocketFactory set by user application and null
+     * if default RMISocketFactory is used.
+     */
+    private static RMISocketFactory globalRsf = null;
+
+    /*
+     * Global RMIFailureHandler set by user application.
+     */
+    private static RMIFailureHandler globalRfh = null;
+
+    /*
+     * Default RMISocketFactory.
+     */
+    private static RMISocketFactory defaultRsf = null;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public RMISocketFactory() {
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract Socket createSocket(String host, int port)
+            throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public abstract ServerSocket createServerSocket(int port)
+            throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized void setSocketFactory(RMISocketFactory rsf)
+            throws IOException, SecurityException {
+        SecurityManager mgr = System.getSecurityManager();
+
+        if (mgr != null) {
+            mgr.checkSetFactory();
+        }
+
+        if (globalRsf == null) {
+            throw new IOException("RMISocketFactory has been already set.");
+        }
+        globalRsf = rsf;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized RMISocketFactory getSocketFactory() {
+        return globalRsf;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized RMISocketFactory getDefaultSocketFactory() {
+        if (defaultRsf == null) {
+            defaultRsf = new DefaultRMISocketFactory();
+        }
+        return defaultRsf;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized void setFailureHandler(RMIFailureHandler rfh)
+            throws SecurityException {
+        SecurityManager mgr = System.getSecurityManager();
+
+        if (mgr != null) {
+            mgr.checkSetFactory();
+        }
+        globalRfh = rfh;
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public static synchronized RMIFailureHandler getFailureHandler() {
+        return globalRfh;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RMISocketFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RemoteCall.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RemoteCall.java?rev=407625&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RemoteCall.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RemoteCall.java Thu May 18 13:01:22 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.1 $
+ */
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.StreamCorruptedException;
+
+
+/**
+ * @com.intel.drl.spec_ref
+ *
+ * @author  Mikhail A. Markov
+ * @version $Revision: 1.3.4.1 $
+ */
+public interface RemoteCall {
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void done() throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void executeCall() throws Exception;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ObjectOutput getResultStream(boolean success)
+            throws IOException, StreamCorruptedException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void releaseInputStream() throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ObjectInput getInputStream() throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public void releaseOutputStream() throws IOException;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public ObjectOutput getOutputStream() throws IOException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi3/src/common/javasrc/java/rmi/server/RemoteCall.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message