You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/05/16 15:52:07 UTC
svn commit: r406944 [29/30] - in
/incubator/harmony/enhanced/classlib/trunk/modules/rmi2: ./ build/ doc/
doc/testing/ doc/testing/rmi http tunneling/ doc/testing/rmi http
tunneling/Results - ITC/ doc/testing/rmi http tunneling/Results - SUN/
doc/testin...
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/ActivationSystem.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/Activator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/Activator.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/Activator.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/Activator.java Tue May 16 06:51:00 2006
@@ -0,0 +1,35 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.activation;
+
+import java.rmi.MarshalledObject;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface Activator extends Remote {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ MarshalledObject activate(ActivationID id, boolean force)
+ throws ActivationException, UnknownObjectException, RemoteException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/Activator.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownGroupException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownGroupException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownGroupException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownGroupException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,37 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.activation;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class UnknownGroupException extends ActivationException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7056094974750002460L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public UnknownGroupException(String s) {
+ super(s);
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownGroupException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownObjectException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownObjectException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownObjectException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownObjectException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,37 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.activation;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class UnknownObjectException extends ActivationException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3425547551622251430L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public UnknownObjectException(String s) {
+ super(s);
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/activation/UnknownObjectException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/DGC.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/DGC.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/DGC.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/DGC.java Tue May 16 06:51:00 2006
@@ -0,0 +1,39 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.dgc;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.server.ObjID;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface DGC extends Remote {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong)
+ throws RemoteException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ Lease dirty(ObjID[] ids, long sequenceNum, Lease lease)
+ throws RemoteException;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/DGC.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/Lease.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/Lease.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/Lease.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/Lease.java Tue May 16 06:51:00 2006
@@ -0,0 +1,64 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.dgc;
+
+import java.io.Serializable;
+
+/**
+ * @ar.org.fitc.spec_ref
+ * @author Gustavo Petri
+ */
+
+public final class Lease implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5713411624328831948L;
+
+ /**
+ * The duation of the <code>Lease</code>.
+ */
+ private long duration;
+
+ /**
+ * The <code>VMID</code> of the <code>Lease</code>.
+ */
+ private VMID id;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ public Lease(VMID id, long duration) {
+ // Constructor
+ this.duration = duration;
+ this.id = id;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ public VMID getVMID() {
+ return id;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ public long getValue() {
+ return duration;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/Lease.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/VMID.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/VMID.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/VMID.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/VMID.java Tue May 16 06:51:00 2006
@@ -0,0 +1,106 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.dgc;
+
+import java.io.Serializable;
+import java.rmi.server.UID;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.SecureRandom;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public final class VMID implements Serializable {
+
+ private static final long serialVersionUID = -538642295484486218L;
+
+ private UID uid;
+
+ // Address should be unique and constant for the lifetime of this object.
+ private static String address;
+
+ private static boolean isUnique;
+
+ private String instanceAddress;
+
+ // Obtains the localhost address, if not, obtains a random value.
+ static {
+ try {
+ address = InetAddress.getLocalHost().getHostAddress();
+ isUnique = true;
+ } catch (UnknownHostException e) {
+ /*
+ * REVIEW: We are using a Random Long when we cannot get the local
+ * host address.
+ */
+ address = Long.valueOf(new SecureRandom().nextLong()).toString();
+ isUnique = false;
+ }
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ */
+ public VMID() {
+ uid = new UID();
+ instanceAddress = address;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public int hashCode() {
+ return instanceAddress.hashCode() ^ uid.hashCode();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null)
+ return false;
+ if (obj == this)
+ return true;
+ if (!(obj instanceof VMID))
+ return false;
+ return (this.instanceAddress.equals(((VMID) obj).instanceAddress) && this.uid
+ .equals(((VMID) obj).uid));
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public String toString() {
+ return "[VMID: " + uid + ", " + instanceAddress + "]";
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Deprecated
+ public static boolean isUnique() {
+ return isUnique;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/dgc/VMID.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/LocateRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/LocateRegistry.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/LocateRegistry.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/LocateRegistry.java Tue May 16 06:51:00 2006
@@ -0,0 +1,94 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.registry;
+
+import java.rmi.RemoteException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+
+import ar.org.fitc.rmi.registry.RegistryImpl;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public final class LocateRegistry {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry createRegistry(int port) throws RemoteException {
+ RegistryImpl registry = new RegistryImpl();
+ registry.exportObject(port, null, null, false);
+ return registry;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry createRegistry(int port, RMIClientSocketFactory csf,
+ RMIServerSocketFactory ssf) throws RemoteException {
+ RegistryImpl registry = new RegistryImpl();
+ registry.exportObject(port, csf, ssf, true);
+ return registry;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry getRegistry() throws RemoteException {
+ return (Registry) RegistryImpl.createStub(Registry.REGISTRY_PORT, null,
+ null, false);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry getRegistry(int port) throws RemoteException {
+ return (Registry) RegistryImpl.createStub(port, null, null, false);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry getRegistry(String host) throws RemoteException {
+ return (Registry) RegistryImpl.createStub(Registry.REGISTRY_PORT, host,
+ null, false);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry getRegistry(String host, int port)
+ throws RemoteException {
+ return (Registry) RegistryImpl.createStub(port, host, null, false);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Registry getRegistry(String host, int port,
+ RMIClientSocketFactory csf) throws RemoteException {
+ return (Registry) RegistryImpl.createStub(port, host, csf, true);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/LocateRegistry.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/Registry.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/Registry.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/Registry.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/Registry.java Tue May 16 06:51:00 2006
@@ -0,0 +1,65 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.registry;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface Registry extends Remote {
+
+ static int REGISTRY_PORT = 1099;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ String[] list() throws RemoteException, AccessException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Remote lookup(String name) throws RemoteException, NotBoundException,
+ AccessException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void bind(String name, Remote obj) throws RemoteException,
+ AlreadyBoundException, AccessException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void rebind(String name, Remote obj) throws RemoteException,
+ AccessException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void unbind(String name) throws RemoteException, NotBoundException,
+ AccessException;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/Registry.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/RegistryHandler.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/RegistryHandler.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/RegistryHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/RegistryHandler.java Tue May 16 06:51:00 2006
@@ -0,0 +1,39 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.registry;
+
+import java.rmi.RemoteException;
+import java.rmi.UnknownHostException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RegistryHandler {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Registry registryImpl(int port) throws RemoteException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Registry registryStub(String host, int port) throws RemoteException,
+ UnknownHostException;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/registry/RegistryHandler.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ExportException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ExportException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ExportException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ExportException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,46 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class ExportException extends RemoteException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -9155485338494060170L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ExportException(String s) {
+ super(s);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ExportException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ExportException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LoaderHandler.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LoaderHandler.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LoaderHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LoaderHandler.java Tue May 16 06:51:00 2006
@@ -0,0 +1,49 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface LoaderHandler {
+
+ static final String packagePrefix = "sun.rmi.server";
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Class<?> loadClass(String name) throws MalformedURLException,
+ ClassNotFoundException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Class<?> loadClass(URL codebase, String name) throws MalformedURLException,
+ ClassNotFoundException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Object getSecurityContext(ClassLoader loader);
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LoaderHandler.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LogStream.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LogStream.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LogStream.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LogStream.java Tue May 16 06:51:00 2006
@@ -0,0 +1,112 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class LogStream extends PrintStream {
+
+ public static final int SILENT = 0;
+
+ public static final int BRIEF = 10;
+
+ public static final int VERBOSE = 20;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public LogStream(OutputStream out) {
+ super(out);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public synchronized void setOutputStream(OutputStream out) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public String toString() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public void write(int b) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public void write(byte[] b, int off, int len) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public synchronized OutputStream getOutputStream() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static synchronized PrintStream getDefaultStream() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static int parseLevel(String s) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static synchronized void setDefaultStream(PrintStream newDefault) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static LogStream log(String name) {
+ throw new UnsupportedOperationException();
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/LogStream.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ObjID.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ObjID.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ObjID.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ObjID.java Tue May 16 06:51:00 2006
@@ -0,0 +1,168 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.security.SecureRandom;
+
+import ar.org.fitc.rmi.utils.PropertiesReader;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public final class ObjID implements Serializable {
+
+ /**
+ * This class defines unique Object Identifiers. It uses an UID and a
+ * counter or a Random generated number to identify between objects within
+ * the same UID.
+ */
+ private static final long serialVersionUID = -6386392263968365220L;
+
+ public static final int REGISTRY_ID = 0;
+
+ public static final int ACTIVATOR_ID = 1;
+
+ public static final int DGC_ID = 2;
+
+ private static long objNumCounter = 0;
+
+ /*
+ * REVIEW: It's assumed that we need the same UID for every object in the
+ * same JVM. This satisfies the specification, though the same UID could be
+ * needed somewhere else, so it may be neccesary to obtain the UID from
+ * somewhere else instead of creating a static one in this class.
+ */
+
+ private static final UID objUIDConst = new UID();
+
+ private static final SecureRandom random = new SecureRandom();
+
+ private static final boolean IsSecureRandom;
+
+ private long objNum;
+
+ private UID objUID;
+
+ /*
+ * The random number generator is set to a default by the SecureRandom()
+ * constructor. The seed is automaticaly set in the first call to
+ * nextLong().
+ */
+ static {
+ String randomIds =
+ PropertiesReader.readString("java.rmi.server.randomIDs");
+ if (randomIds == null) {
+ IsSecureRandom = false;
+ } else {
+ IsSecureRandom = randomIds.equalsIgnoreCase("true");
+ }
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ObjID() {
+
+ if (IsSecureRandom) {
+ this.objNum = random.nextLong();
+ } else {
+ synchronized (ObjID.class) {
+ this.objNum = objNumCounter;
+ objNumCounter++;
+ }
+ this.objUID = objUIDConst;
+ }
+
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ObjID(int objNum) {
+ this.objNum = objNum;
+ this.objUID = new UID((short) 0);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public int hashCode() {
+
+ /*
+ * REVIEW: This is an arbitrary election for the hash function, that
+ * does not seem to do any harm and it satisfies the specification.
+ */
+ return (int) this.objNum ^ this.objUID.hashCode();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static ObjID read(ObjectInput in) throws IOException {
+ ObjID newObj = new ObjID();
+
+ newObj.objNum = in.readLong();
+ newObj.objUID = UID.read(in);
+
+ return newObj;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public boolean equals(Object obj) {
+
+ if (obj == null)
+ return false;
+ if (obj == this)
+ return true;
+ if (!(obj instanceof ObjID))
+ return false;
+ return (((ObjID) obj).objNum == this.objNum && ((ObjID) obj).objUID
+ .equals(this.objUID));
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public String toString() {
+ return "[ObjID:" + this.objNum + ", " + this.objUID.toString() + "]";
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public void write(ObjectOutput out) throws IOException {
+
+ out.writeLong(this.objNum);
+ this.objUID.write(out);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ObjID.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Operation.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Operation.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Operation.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Operation.java Tue May 16 06:51:00 2006
@@ -0,0 +1,51 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+@Deprecated
+public class Operation {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Deprecated
+ public Operation(String op) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Deprecated
+ public String getOperation() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Deprecated
+ public String toString() {
+ throw new UnsupportedOperationException();
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Operation.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoader.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoader.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoader.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoader.java Tue May 16 06:51:00 2006
@@ -0,0 +1,202 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.ClassLoader;
+import java.rmi.server.RMIClassLoaderSpi;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import ar.org.fitc.rmi.runtime.RMIDefaultClassLoaderSpi;
+import ar.org.fitc.rmi.utils.PropertiesReader;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class RMIClassLoader {
+
+ static private RMIClassLoaderSpi provider = null;
+
+ /*
+ * This initialization is specified in the ClassLoader API, though it is an
+ * awful design.
+ */
+
+ static {
+ String property =
+ PropertiesReader.readString("java.rmi.server.RMIClassLoaderSpi");
+ Class clazz;
+
+ if (property != null) {
+ if (property.equals("default")) {
+ provider = getDefaultProviderInstance();
+ } else {
+ try {
+ clazz = ClassLoader.getSystemClassLoader().loadClass(
+ property);
+ if (RMIClassLoaderSpi.class.isAssignableFrom(clazz)) {
+ provider = (RMIClassLoaderSpi) clazz.newInstance();
+ } else {
+ throw new Error("RMIClassLoader Initialization Failed");
+ }
+ } catch (ClassNotFoundException e) {
+ throw new Error("RMIClassLoader Initialization Failed");
+ } catch (InstantiationException e) {
+ throw new Error("RMIClassLoader Initialization Failed");
+ } catch (IllegalAccessException e) {
+ throw new Error("RMIClassLoader Initialization Failed");
+ }
+ }
+ } else {
+ InputStream in = ClassLoader
+ .getSystemResourceAsStream("META-INF/services/java.rmi.server.RMIClassLoaderSpi");
+ String providerName = null;
+
+ if (in != null) {
+ Scanner scanner = new Scanner(in);
+ Pattern pat = Pattern.compile("\\b[\\w\\.]*\\b",
+ Pattern.COMMENTS);
+ try {
+ while ((in.available() > 0) && provider == null) {
+ if (scanner.hasNext(pat)) {
+ providerName = scanner.next(pat);
+ break;
+ } else if (in.available() > 0) {
+ scanner.nextLine();
+ }
+ }
+ } catch (IOException e) {
+ throw new Error("RMIClassLoader Initialization Failed");
+ }
+ }
+ if (providerName != null) {
+ try {
+ clazz = ClassLoader.getSystemClassLoader().loadClass(
+ providerName);
+ } catch (Exception e) {
+ throw new Error(
+ "RMIClassLoader Initialization Failed from a RMIClassLoaderSpi configuration file");
+ }
+ if (RMIClassLoaderSpi.class.isAssignableFrom(clazz)) {
+ try {
+ provider = (RMIClassLoaderSpi) clazz.newInstance();
+ } catch (Exception e) {
+ throw new Error(
+ "RMIClassLoader Initialization Failed from a RMIClassLoaderSpi configuration file");
+ }
+ } else {
+ throw new Error("RMIClassLoader Initialization Failed");
+ }
+ } else {
+ provider = getDefaultProviderInstance();
+ }
+ }
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static String getClassAnnotation(Class<?> cl)
+ throws NullPointerException {
+
+ return provider.getClassAnnotation(cl);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static ClassLoader getClassLoader(String codebase)
+ throws MalformedURLException, SecurityException {
+
+ return provider.getClassLoader(codebase);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static RMIClassLoaderSpi getDefaultProviderInstance() {
+
+ if (System.getSecurityManager() != null) {
+ System.getSecurityManager().checkPermission(
+ new RuntimePermission("setFactory"));
+ }
+ if (provider == null) {
+ provider = new RMIDefaultClassLoaderSpi();
+ }
+ return provider;
+ }
+
+ @Deprecated
+ public static Object getSecurityContext(@SuppressWarnings("unused") ClassLoader loader) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Deprecated
+ public static Class<?> loadClass(String name) throws MalformedURLException,
+ ClassNotFoundException {
+ return loadClass((String) null, name);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Class<?> loadClass(String codebase, String name)
+ throws MalformedURLException, ClassNotFoundException {
+ return provider.loadClass(codebase, name, null);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Class<?> loadClass(String codebase, String name,
+ ClassLoader defaultLoader) throws MalformedURLException,
+ ClassNotFoundException {
+
+ return provider.loadClass(codebase, name, defaultLoader);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Class<?> loadClass(URL codebase, String name)
+ throws MalformedURLException, ClassNotFoundException {
+ String codebaseStr = codebase == null ? null : codebase.toString();
+
+ return provider.loadClass(codebaseStr, name, null);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Class<?> loadProxyClass(String codebase, String[] interfaces,
+ ClassLoader defaultLoader) throws MalformedURLException,
+ ClassNotFoundException, IllegalArgumentException {
+
+ return provider.loadProxyClass(codebase, interfaces, defaultLoader);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoader.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoaderSpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoaderSpi.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoaderSpi.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoaderSpi.java Tue May 16 06:51:00 2006
@@ -0,0 +1,63 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.net.MalformedURLException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public abstract class RMIClassLoaderSpi {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public RMIClassLoaderSpi() {
+ // Constructor
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract Class<?> loadProxyClass(String codebase,
+ String[] interfaces, ClassLoader defaultLoader)
+ throws MalformedURLException, ClassNotFoundException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract String getClassAnnotation(Class cl);
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract Class<?> loadClass(String codebase, String name,
+ ClassLoader defaultLoader) throws MalformedURLException,
+ ClassNotFoundException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract ClassLoader getClassLoader(String codebase)
+ throws MalformedURLException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClassLoaderSpi.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClientSocketFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClientSocketFactory.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClientSocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClientSocketFactory.java Tue May 16 06:51:00 2006
@@ -0,0 +1,33 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.Socket;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RMIClientSocketFactory {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Socket createSocket(String host, int port) throws IOException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIClientSocketFactory.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIFailureHandler.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIFailureHandler.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIFailureHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIFailureHandler.java Tue May 16 06:51:00 2006
@@ -0,0 +1,30 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RMIFailureHandler {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ boolean failure(Exception ex);
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIFailureHandler.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIServerSocketFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIServerSocketFactory.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIServerSocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIServerSocketFactory.java Tue May 16 06:51:00 2006
@@ -0,0 +1,33 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RMIServerSocketFactory {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ ServerSocket createServerSocket(int port) throws IOException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMIServerSocketFactory.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMISocketFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMISocketFactory.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMISocketFactory.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMISocketFactory.java Tue May 16 06:51:00 2006
@@ -0,0 +1,115 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import ar.org.fitc.rmi.transport.RMIDefaultSocketFactory;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public abstract class RMISocketFactory implements RMIClientSocketFactory,
+ RMIServerSocketFactory {
+
+ private static RMIFailureHandler failureHandler;
+
+ private static RMISocketFactory socketFactory;
+
+ private static RMISocketFactory defaultSocketFactory;
+
+ static {
+ defaultSocketFactory = new RMIDefaultSocketFactory();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public RMISocketFactory() {
+ super();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract Socket createSocket(String host, int port)
+ throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public abstract ServerSocket createServerSocket(int port)
+ throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static RMISocketFactory getDefaultSocketFactory() {
+ return defaultSocketFactory;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static RMIFailureHandler getFailureHandler() {
+ return failureHandler;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static RMISocketFactory getSocketFactory() {
+ return socketFactory;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static void setFailureHandler(RMIFailureHandler fh) {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ security.checkSetFactory();
+ }
+ failureHandler = fh;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static void setSocketFactory(RMISocketFactory fac)
+ throws IOException {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ security.checkSetFactory();
+ }
+ if (socketFactory == null) {
+ socketFactory = fac;
+ } else {
+ throw new IOException("RMI Socket Factory already set");
+ }
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RMISocketFactory.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteCall.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteCall.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteCall.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteCall.java Tue May 16 06:51:00 2006
@@ -0,0 +1,71 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.StreamCorruptedException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RemoteCall {
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ ObjectOutput getResultStream(boolean success) throws IOException,
+ StreamCorruptedException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void releaseInputStream() throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void releaseOutputStream() throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void executeCall() throws Exception;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ ObjectInput getInputStream() throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ ObjectOutput getOutputStream() throws IOException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void done() throws IOException;
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteCall.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObject.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObject.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObject.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObject.java Tue May 16 06:51:00 2006
@@ -0,0 +1,190 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Proxy;
+import java.rmi.NoSuchObjectException;
+import java.rmi.Remote;
+
+import ar.org.fitc.rmi.runtime.RemoteReferenceManager;
+import ar.org.fitc.rmi.server.ReferenceTypes;
+import ar.org.fitc.rmi.server.UnicastRemoteRef2Impl;
+import ar.org.fitc.rmi.server.UnicastRemoteRefImpl;
+import ar.org.fitc.rmi.server.UnicastServerRef2Impl;
+import ar.org.fitc.rmi.server.UnicastServerRefImpl;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public abstract class RemoteObject implements Remote, Serializable {
+
+ private static final long serialVersionUID = -3215090123894869218L;
+
+ protected transient RemoteRef ref;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteObject() {
+ super();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteObject(RemoteRef newRef) {
+ if (newRef == null) {
+ throw new NullPointerException();
+ }
+ ref = newRef;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public int hashCode() {
+ if (ref != null) {
+ return ref.remoteHashCode();
+ } else {
+ return super.hashCode();
+ }
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null) {
+ if (obj == this) {
+ return true;
+ }
+ if (obj instanceof RemoteObject) {
+ if (ref == null) {
+ return false;
+ }
+ return ref.remoteEquals(((RemoteObject) obj).getRef());
+ } else {
+ return obj.equals(this);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ @Override
+ public String toString() {
+ if (ref != null) {
+ return "[" + this.getClass().getName() + " " + ref.remoteToString()
+ + "]";
+ } else {
+ return super.toString();
+ }
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public RemoteRef getRef() {
+ return ref;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static Remote toStub(Remote obj) throws NoSuchObjectException {
+ if (obj == null) {
+ throw new NoSuchObjectException(
+ "Invalid (null) Remote server object.");
+ }
+ if (obj instanceof RemoteStub) {
+ return obj;
+ }
+ if (Proxy.isProxyClass(obj.getClass())) {
+ if (Proxy.getInvocationHandler(obj).getClass().equals(
+ RemoteObjectInvocationHandler.class)) {
+ return obj;
+ }
+ }
+ RemoteReferenceManager rrm = RemoteReferenceManager
+ .getRemoteReferenceManager();
+ return rrm.getStub(obj);
+ }
+
+ /**
+ *
+ *
+ */
+ private void writeObject(ObjectOutputStream out) throws IOException {
+ out.defaultWriteObject();
+ if (ref != null) {
+ String externalRefTypeName = ref.getRefClass(out);
+ if (externalRefTypeName != null && externalRefTypeName.length() > 0) {
+ out.writeUTF(externalRefTypeName);
+ ref.writeExternal(out);
+ } else {
+ out.writeUTF("");
+ out.writeObject(ref);
+ }
+ }
+ }
+
+ /**
+ *
+ *
+ */
+ private void readObject(ObjectInputStream in) throws IOException,
+ ClassNotFoundException {
+ in.defaultReadObject();
+ String externalRefTypeName = in.readUTF();
+ if (externalRefTypeName.length() == 0) {
+ ref = (RemoteRef) in.readObject();
+ } else {
+ if (externalRefTypeName.equals(ReferenceTypes.UNICAST_REF
+ .toString())) {
+ ref = new UnicastRemoteRefImpl();
+ } else if (externalRefTypeName.equals(ReferenceTypes.UNICAST_REF2
+ .toString())) {
+ ref = new UnicastRemoteRef2Impl();
+ } else if (externalRefTypeName
+ .equals(ReferenceTypes.UNICAST_SERVER_REF.toString())) {
+ ref = new UnicastServerRefImpl();
+ } else if (externalRefTypeName
+ .equals(ReferenceTypes.UNICAST_SERVER_REF2.toString())) {
+ ref = new UnicastServerRef2Impl();
+ } else {
+ throw new ClassNotFoundException(
+ "Invalid external ref type name");
+ }
+ ref.readExternal(in);
+ }
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObject.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObjectInvocationHandler.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObjectInvocationHandler.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObjectInvocationHandler.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObjectInvocationHandler.java Tue May 16 06:51:00 2006
@@ -0,0 +1,88 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.rmi.Remote;
+import java.rmi.UnexpectedException;
+import ar.org.fitc.rmi.utils.MethodHashGenerator;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class RemoteObjectInvocationHandler extends RemoteObject implements
+ InvocationHandler {
+
+ private static final long serialVersionUID = 2L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public RemoteObjectInvocationHandler(RemoteRef ref) {
+ super(ref);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+
+ Method hashCode = Object.class.getMethod("hashCode", (Class[]) null);
+ Method equals = Object.class.getMethod("equals", Object.class);
+ Method toString = Object.class.getMethod("toString", (Class[]) null);
+
+ if (method.equals(hashCode)) {
+ return ref.remoteHashCode();
+ }
+ if (method.equals(equals)) {
+ if ((args[0] != null)
+ && (Proxy.isProxyClass(args[0].getClass()))
+ && (this.equals(Proxy.getInvocationHandler(args[0])))) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ if (method.equals(toString)) {
+ return "[" + "Proxy " + ref.remoteToString() + "]";
+ }
+ if (!(proxy instanceof Remote)) {
+ throw new IllegalArgumentException(
+ "Proxy must be an instance of java.rmi.Remote");
+ }
+
+ long methodHash = MethodHashGenerator.getMethodHash(method);
+ try {
+ return ref.invoke((Remote) proxy, method, args, methodHash);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ Class[] exceptions = method.getExceptionTypes();
+ for (Class<Exception> exception : exceptions) {
+ if (exception.isAssignableFrom(e.getClass())) {
+ throw e;
+ }
+ }
+ throw new UnexpectedException("undeclared checked exception", e);
+ }
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteObjectInvocationHandler.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteRef.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteRef.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteRef.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteRef.java Tue May 16 06:51:00 2006
@@ -0,0 +1,84 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.Externalizable;
+import java.io.ObjectOutput;
+import java.lang.reflect.Method;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface RemoteRef extends Externalizable {
+
+ static final long serialVersionUID = 3632638527362204081L;
+
+ static final String packagePrefix = "ar.org.fitc.rmi.server";
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ String getRefClass(ObjectOutput out);
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ boolean remoteEquals(RemoteRef obj);
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ int remoteHashCode();
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ String remoteToString();
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash)
+ throws RemoteException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ Object invoke(Remote obj, Method method, Object[] params, long opnum)
+ throws Exception;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void invoke(RemoteCall call) throws Exception;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void done(RemoteCall call) throws RemoteException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteRef.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteServer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteServer.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteServer.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteServer.java Tue May 16 06:51:00 2006
@@ -0,0 +1,131 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.io.PrintStream;
+import java.io.OutputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.LoggingPermission;
+
+import ar.org.fitc.rmi.transport.TransportManager;
+import ar.org.fitc.rmi.utils.PrintStreamHandler;
+import ar.org.fitc.rmi.utils.PropertiesReader;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public abstract class RemoteServer extends RemoteObject {
+
+ private static final long serialVersionUID = -4100238210092549637L;
+
+ static private PrintStream logStream;
+
+ private static Logger logger;
+
+ private static Logger serverLog;
+
+ private static PrintStreamHandler logHandler;
+
+ // Initialize loggers
+ static {
+ logger = Logger.getLogger("ar.org.fitc.rmi.server");
+ logger.setUseParentHandlers(false);
+ logger.setLevel(Level.ALL);
+
+ String propertyValue =
+ PropertiesReader.readString("java.rmi.server.logCalls");
+ if (propertyValue != null) {
+ boolean logAllowed = propertyValue.equalsIgnoreCase("true");
+ if (logAllowed) {
+ PrintStreamHandler errHandler = new PrintStreamHandler();
+ errHandler.setLevel(Level.ALL);
+ logger.addHandler(errHandler);
+ }
+ }
+
+ // Implementation-specific logger to log server information
+ serverLog = Logger.getLogger("ar.org.fitc.rmi.server.log");
+ propertyValue =
+ PropertiesReader.readString("ar.org.fitc.rmi.server.log");
+
+ if (propertyValue != null
+ && propertyValue.equalsIgnoreCase("true")) {
+ serverLog.setLevel(Level.ALL);
+ } else {
+ serverLog.setLevel(Level.OFF);
+ }
+
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteServer() {
+ super();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteServer(RemoteRef ref) {
+ super(ref);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static String getClientHost() throws ServerNotActiveException {
+ TransportManager tm = TransportManager.getTransportManager();
+ return tm.getClientHost();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static PrintStream getLog() {
+ return logStream;
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public static void setLog(OutputStream out) {
+
+ // Check security permission as stated in specification
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ security.checkPermission(new LoggingPermission("control", null));
+ }
+
+ logger.removeHandler(logHandler);
+ if (out != null) {
+ logStream = new PrintStream(out);
+ logHandler = new PrintStreamHandler(logStream);
+ logHandler.setLevel(Level.ALL);
+ logger.addHandler(logHandler);
+ } else {
+ logStream = null;
+ }
+ return;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteServer.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteStub.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteStub.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteStub.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteStub.java Tue May 16 06:51:00 2006
@@ -0,0 +1,46 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public abstract class RemoteStub extends RemoteObject {
+
+ private static final long serialVersionUID = -1585587260594494182L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteStub() {
+ super();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ protected RemoteStub(RemoteRef ref) {
+ super(ref);
+ }
+
+ @Deprecated
+ protected static void setRef(RemoteStub stub, RemoteRef ref) {
+ throw new UnsupportedOperationException();
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/RemoteStub.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerCloneException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerCloneException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerCloneException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerCloneException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,52 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class ServerCloneException extends CloneNotSupportedException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6617456357664815945L;
+
+ public Exception detail;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ServerCloneException(String s) {
+ super(s);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ServerCloneException(String s, Exception cause) {
+ super(s + "; nested exception is:\n\t" + cause.toString());
+ detail = cause;
+ }
+
+ @Override
+ public Throwable getCause() {
+ return detail.getCause();
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerCloneException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerNotActiveException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerNotActiveException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerNotActiveException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerNotActiveException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,45 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class ServerNotActiveException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4687940720827538231L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ServerNotActiveException() {
+ super();
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public ServerNotActiveException(String s) {
+ super(s);
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerNotActiveException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerRef.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerRef.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerRef.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerRef.java Tue May 16 06:51:00 2006
@@ -0,0 +1,41 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface ServerRef extends RemoteRef {
+
+ static final long serialVersionUID = -4557750989390278438L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ RemoteStub exportObject(Remote obj, Object data) throws RemoteException;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ String getClientHost() throws ServerNotActiveException;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/ServerRef.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Skeleton.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Skeleton.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Skeleton.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Skeleton.java Tue May 16 06:51:00 2006
@@ -0,0 +1,35 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.rmi.Remote;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public interface Skeleton {
+
+ Operation[] getOperations();
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ void dispatch(Remote obj, RemoteCall theCall, int opnum, long hash)
+ throws Exception;
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/Skeleton.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonMismatchException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonMismatchException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonMismatchException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonMismatchException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,39 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class SkeletonMismatchException extends RemoteException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7780460454818859281L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public SkeletonMismatchException(String s) {
+ super(s);
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonMismatchException.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonNotFoundException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonNotFoundException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonNotFoundException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonNotFoundException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,46 @@
+/*
+* Copyright 2005 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.
+*/
+package java.rmi.server;
+
+import java.rmi.RemoteException;
+
+/**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+public class SkeletonNotFoundException extends RemoteException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7860299673822761231L;
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public SkeletonNotFoundException(String s) {
+ super(s);
+ }
+
+ /**
+ * @ar.org.fitc.spec_ref
+ *
+ */
+ public SkeletonNotFoundException(String s, Exception ex) {
+ super(s, ex);
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/java/rmi/server/SkeletonNotFoundException.java
------------------------------------------------------------------------------
svn:executable = *