You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/05/19 08:00:56 UTC

svn commit: r407724 [8/11] - in /incubator/harmony/enhanced/classlib/trunk: make/ modules/rmi/make/ modules/rmi/src/main/java/java/rmi/ modules/rmi/src/main/java/java/rmi/registry/ modules/rmi/src/main/java/java/rmi/server/ modules/rmi/src/main/java/or...

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/ServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/ServerConnectionFactory.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/ServerConnectionFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/ServerConnectionFactory.java Thu May 18 23:00:52 2006
@@ -1,52 +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 ar.org.fitc.rmi.transport;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-
-import ar.org.fitc.rmi.transport.http.HttpSocketServerSide;
-
-/**
- * Factory for Server Connections. 
- * @author Gustavo Petri
- */
-public final class ServerConnectionFactory {
-
-    /** Prevents instantiation */ 
-    private ServerConnectionFactory() {}
-    
-    /**
-     * Creates a Connection acording to the type of the {@link Socket} argument 
-     * @param in the {@link InputStream} for the Connection to be created
-     * @param out the {@link OutputStream} for the Connection to be created
-     * @param clientEP the {@link Endpoint} of the client for this Connection
-     * @param sock the {@link Socket} for this connection
-     * @return a Connection to serve client requests  
-     */
-    public final static AbstractServerConnection getServerConnection(InputStream in,
-            OutputStream out, EndpointID clientEP, Socket sock) {
-        AbstractServerConnection ret;
-
-        if (sock instanceof HttpSocketServerSide) {
-            ret = new SingleOpServerConnection(in, out, clientEP, sock);
-        } else {
-            ret = new StreamServerConnection(in, out, clientEP, sock);
-        }
-        return ret;
-    }
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+
+import org.apache.harmony.rmi.internal.transport.http.HttpSocketServerSide;
+
+/**
+ * Factory for Server Connections. 
+ * @author Gustavo Petri
+ */
+public final class ServerConnectionFactory {
+
+    /** Prevents instantiation */ 
+    private ServerConnectionFactory() {}
+    
+    /**
+     * Creates a Connection acording to the type of the {@link Socket} argument 
+     * @param in the {@link InputStream} for the Connection to be created
+     * @param out the {@link OutputStream} for the Connection to be created
+     * @param clientEP the {@link Endpoint} of the client for this Connection
+     * @param sock the {@link Socket} for this connection
+     * @return a Connection to serve client requests  
+     */
+    public final static AbstractServerConnection getServerConnection(InputStream in,
+            OutputStream out, EndpointID clientEP, Socket sock) {
+        AbstractServerConnection ret;
+
+        if (sock instanceof HttpSocketServerSide) {
+            ret = new SingleOpServerConnection(in, out, clientEP, sock);
+        } else {
+            ret = new StreamServerConnection(in, out, clientEP, sock);
+        }
+        return ret;
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpClientConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpClientConnection.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpClientConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpClientConnection.java Thu May 18 23:00:52 2006
@@ -1,116 +1,116 @@
-/* 
-*  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 ar.org.fitc.rmi.transport;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.rmi.ConnectIOException;
-import java.rmi.MarshalException;
-import java.rmi.server.ObjID;
-import java.rmi.server.UID;
-
-import ar.org.fitc.rmi.transport.jrmp.ProtocolType;
-import ar.org.fitc.rmi.transport.jrmp.ReturnMessage;
-
-/**
- * Encapsulates the Client events occurring in the JRMP protocol, when is 
- * encapsulated inside an HTTP call. It creates a  socket for the specified 
- * {@link ar.org.fitc.rmi.transport.Endpoint}, it sends all
- * the parameters in the apropriate order and it waits for the results.
- * 
- * @author Gustavo Petri
- */
-final class SingleOpClientConnection extends AbstractClientConnection {
-
-    /**
-     * Creates a new connection to the specified
-     * {@link ar.org.fitc.rmi.transport.Endpoint}.
-     * @param sock 
-     *            the {@link Socket} to be used by this Connection 
-     * @param ep
-     *            the {@link ar.org.fitc.rmi.transport.Endpoint} to connect
-     * @throws ConnectIOException
-     *             if an IOException occurs while making a connection to the
-     *             remote host
-     */
-    public SingleOpClientConnection(Socket sock, Endpoint ep) throws ConnectIOException {
-        super(sock, ep);
-    }
-
-    /**
-     * Establishes a connection.
-     * <li>If {@link #lastUsageTime} is <code>null</code> then starts a
-     * connection.
-     * <li>If the difference between current time and {@link #lastUsageTime} is
-     * bigger or equal than double of the value stored in the table then renew
-     * the connection. The multiplied constant 2 is suggested in this
-     * {@link <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3">link</a>}
-     * 
-     * @throws MarshalException
-     *             if a {@link java.io.IOException} occurs while marshalling the 
-     *             remote call header, arguments or return value for a remote 
-     *             method call
-     * @throws ProtocolException
-     *             if there is an error in the underlying protocol
-     */
-    @Override
-	public final void establishConnection() throws MarshalException, IOException {
-        protocolHandler.writeHandshake(ProtocolType.SINGLE_OP);
-    }
-
-    /**
-     * Writes the call request data into the connection, and reads the 
-     * results of the execution in the server.
-     * 
-     * @param args
-     *            the arguments of the invocation
-     * @param waitReturn
-     *            this parameter indicates whether or not to wait for a return
-     *            value
-     * @return the return value of the remote method call
-     * @throws Exception
-     *             if any exception is thrown on the server side
-     */
-    @Override
-	protected final Object methodCall(ObjID objId, long hash, Object[] args,
-            boolean waitReturn) throws Exception {
-        @SuppressWarnings("unused") 
-        UID uid = null;
-        ReturnMessage result = null;
-        TransportManager tm = TransportManager.getTransportManager();
-        
-        protocolHandler.writeCall(objId, hash, args);
-        out.flush();
-        protocolHandler.readHandshakeResponse();
-        result = protocolHandler.readResult(waitReturn); 
-        uid = result.getUID();
-        if (result.sendsDGCAck()) {
-            tm.acknowledgeDGC(uid, this.ep);
-        }
-        if (result.isException()) {
-            throw result.getException();
-        } 
-        return result.getResult();
-    }
-    
-    /**
-     * Indicates is this {@link Socket} is reusable. 
-     */
-    @Override
-    public boolean isReusable() {
-    	return false;
-    }
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.IOException;
+import java.net.Socket;
+import java.rmi.ConnectIOException;
+import java.rmi.MarshalException;
+import java.rmi.server.ObjID;
+import java.rmi.server.UID;
+
+import org.apache.harmony.rmi.internal.transport.jrmp.ProtocolType;
+import org.apache.harmony.rmi.internal.transport.jrmp.ReturnMessage;
+
+/**
+ * Encapsulates the Client events occurring in the JRMP protocol, when is 
+ * encapsulated inside an HTTP call. It creates a  socket for the specified 
+ * {@link org.apache.harmony.rmi.internal.transport.Endpoint}, it sends all
+ * the parameters in the apropriate order and it waits for the results.
+ * 
+ * @author Gustavo Petri
+ */
+final class SingleOpClientConnection extends AbstractClientConnection {
+
+    /**
+     * Creates a new connection to the specified
+     * {@link org.apache.harmony.rmi.internal.transport.Endpoint}.
+     * @param sock 
+     *            the {@link Socket} to be used by this Connection 
+     * @param ep
+     *            the {@link org.apache.harmony.rmi.internal.transport.Endpoint} to connect
+     * @throws ConnectIOException
+     *             if an IOException occurs while making a connection to the
+     *             remote host
+     */
+    public SingleOpClientConnection(Socket sock, Endpoint ep) throws ConnectIOException {
+        super(sock, ep);
+    }
+
+    /**
+     * Establishes a connection.
+     * <li>If {@link #lastUsageTime} is <code>null</code> then starts a
+     * connection.
+     * <li>If the difference between current time and {@link #lastUsageTime} is
+     * bigger or equal than double of the value stored in the table then renew
+     * the connection. The multiplied constant 2 is suggested in this
+     * {@link <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3">link</a>}
+     * 
+     * @throws MarshalException
+     *             if a {@link java.io.IOException} occurs while marshalling the 
+     *             remote call header, arguments or return value for a remote 
+     *             method call
+     * @throws ProtocolException
+     *             if there is an error in the underlying protocol
+     */
+    @Override
+	public final void establishConnection() throws MarshalException, IOException {
+        protocolHandler.writeHandshake(ProtocolType.SINGLE_OP);
+    }
+
+    /**
+     * Writes the call request data into the connection, and reads the 
+     * results of the execution in the server.
+     * 
+     * @param args
+     *            the arguments of the invocation
+     * @param waitReturn
+     *            this parameter indicates whether or not to wait for a return
+     *            value
+     * @return the return value of the remote method call
+     * @throws Exception
+     *             if any exception is thrown on the server side
+     */
+    @Override
+	protected final Object methodCall(ObjID objId, long hash, Object[] args,
+            boolean waitReturn) throws Exception {
+        @SuppressWarnings("unused") 
+        UID uid = null;
+        ReturnMessage result = null;
+        TransportManager tm = TransportManager.getTransportManager();
+        
+        protocolHandler.writeCall(objId, hash, args);
+        out.flush();
+        protocolHandler.readHandshakeResponse();
+        result = protocolHandler.readResult(waitReturn); 
+        uid = result.getUID();
+        if (result.sendsDGCAck()) {
+            tm.acknowledgeDGC(uid, this.ep);
+        }
+        if (result.isException()) {
+            throw result.getException();
+        } 
+        return result.getResult();
+    }
+    
+    /**
+     * Indicates is this {@link Socket} is reusable. 
+     */
+    @Override
+    public boolean isReusable() {
+    	return false;
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpServerConnection.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpServerConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/SingleOpServerConnection.java Thu May 18 23:00:52 2006
@@ -1,100 +1,100 @@
-/* 
-*  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 ar.org.fitc.rmi.transport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.rmi.RemoteException;
-
-import ar.org.fitc.rmi.transport.jrmp.Message;
-import ar.org.fitc.rmi.transport.jrmp.MessageType;
-import ar.org.fitc.rmi.transport.jrmp.ProtocolType;
-
-/*
- * NOTE: 
- * This class has been modified in order to support 
- * Java VM 1.4.2 using the javac's target jsr14 
- */
-
-/**
- * Encapsulates the Server events occurring in the JRMP protocol.
- * 
- * @author Gustavo Petri
- */
-final class SingleOpServerConnection extends AbstractServerConnection {
-
-    /**
-     * Creates a new connection to the specified
-     * {@link ar.org.fitc.rmi.transport.EndpointID}
-     * 
-     * @param in
-     *            the specified {@link InputStream}
-     * @param out
-     *            the specified {@link OutputStream}
-     * @param clientEP
-     *            the specified {@link ar.org.fitc.rmi.transport.EndpointID}
-     * @param sock
-     *            the socket of connection
-     */
-    public SingleOpServerConnection(InputStream in, OutputStream out,
-            EndpointID clientEP, Socket sock) {
-        super(in, out, clientEP, sock);
-    }
-
-    /**
-     * Establishes a connection.
-     * 
-     * @throws ProtocolException
-     *             if there is an error in the underlying protocol
-     */
-    @Override
-	public final void establishConnection() throws ProtocolException {
-        protocolHandler.readHandShake(ProtocolType.SINGLE_OP);
-        protocolHandler.answerHandshake();
-    }
-
-	/**
-	 * Handles the incoming message.
-	 * 
-	 * @throws RemoteException If an exception occurs during message handling.
-	 */
-    @Override
-	public final void serve() throws Exception {
-        Message msg = null;
-        try {
-            msg = protocolHandler.readMessage();
-        } catch (Exception e) {
-            handleException(e);
-            throw e;
-        }
-        MessageType type = msg.getType();
-
-        if (type == MessageType.CALL) {
-            handleCall(msg);
-        } else if (type == MessageType.DGCACK) {
-            handleDGCAck(msg);
-            // Writes the HTTP Response message
-            try {
-                out.flush();
-            } catch (IOException e) {
-                throw new ProtocolException("Exception writing the HTTP DGCAck response");
-            }
-        }
-    }
-
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.rmi.RemoteException;
+
+import org.apache.harmony.rmi.internal.transport.jrmp.Message;
+import org.apache.harmony.rmi.internal.transport.jrmp.MessageType;
+import org.apache.harmony.rmi.internal.transport.jrmp.ProtocolType;
+
+/*
+ * NOTE: 
+ * This class has been modified in order to support 
+ * Java VM 1.4.2 using the javac's target jsr14 
+ */
+
+/**
+ * Encapsulates the Server events occurring in the JRMP protocol.
+ * 
+ * @author Gustavo Petri
+ */
+final class SingleOpServerConnection extends AbstractServerConnection {
+
+    /**
+     * Creates a new connection to the specified
+     * {@link org.apache.harmony.rmi.internal.transport.EndpointID}
+     * 
+     * @param in
+     *            the specified {@link InputStream}
+     * @param out
+     *            the specified {@link OutputStream}
+     * @param clientEP
+     *            the specified {@link org.apache.harmony.rmi.internal.transport.EndpointID}
+     * @param sock
+     *            the socket of connection
+     */
+    public SingleOpServerConnection(InputStream in, OutputStream out,
+            EndpointID clientEP, Socket sock) {
+        super(in, out, clientEP, sock);
+    }
+
+    /**
+     * Establishes a connection.
+     * 
+     * @throws ProtocolException
+     *             if there is an error in the underlying protocol
+     */
+    @Override
+	public final void establishConnection() throws ProtocolException {
+        protocolHandler.readHandShake(ProtocolType.SINGLE_OP);
+        protocolHandler.answerHandshake();
+    }
+
+	/**
+	 * Handles the incoming message.
+	 * 
+	 * @throws RemoteException If an exception occurs during message handling.
+	 */
+    @Override
+	public final void serve() throws Exception {
+        Message msg = null;
+        try {
+            msg = protocolHandler.readMessage();
+        } catch (Exception e) {
+            handleException(e);
+            throw e;
+        }
+        MessageType type = msg.getType();
+
+        if (type == MessageType.CALL) {
+            handleCall(msg);
+        } else if (type == MessageType.DGCACK) {
+            handleDGCAck(msg);
+            // Writes the HTTP Response message
+            try {
+                out.flush();
+            } catch (IOException e) {
+                throw new ProtocolException("Exception writing the HTTP DGCAck response");
+            }
+        }
+    }
+
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamClientConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamClientConnection.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamClientConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamClientConnection.java Thu May 18 23:00:52 2006
@@ -1,168 +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 ar.org.fitc.rmi.transport;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.rmi.ConnectIOException;
-import java.rmi.MarshalException;
-import java.rmi.server.ObjID;
-import java.rmi.server.UID;
-
-import ar.org.fitc.rmi.transport.jrmp.ProtocolType;
-import ar.org.fitc.rmi.transport.jrmp.ReturnMessage;
-
-/**
- * Encapsulates the Client events occurring in the JRMP protocol. It creates a
- * socket for the specified {@link ar.org.fitc.rmi.transport.Endpoint}, it
- * sends all the parameters in the apropriate order and it waits for the
- * results.
- * 
- * @author Gustavo Petri
- */
-final class StreamClientConnection extends AbstractClientConnection {
-
-	/**
-	 * Creates a new connection to the specified
-	 * {@link ar.org.fitc.rmi.transport.Endpoint}.
-	 * 
-	 * @param ep
-	 *            the {@link ar.org.fitc.rmi.transport.Endpoint} to connect
-	 * @param sock
-	 *            the {@link java.net.Socket} to connect
-	 * @throws ConnectIOException
-	 *             if an IOException occurs while making a connection to the
-	 *             remote host
-	 */
-	public StreamClientConnection(Socket sock, Endpoint ep)
-			throws ConnectIOException {
-		super(sock, ep);
-	}
-
-	/**
-	 * Establishes a connection.
-	 * <li>If {@link #lastUsageTime} is <code>null</code> then starts a
-	 * connection.
-	 * <li>If the difference between current time and {@link #lastUsageTime} is
-	 * bigger or equal than double of the value stored in the table then renew
-	 * the connection. The multiplied constant 2 is suggested in this
-	 * {@link <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3">link</a>}
-	 * 
-	 * @throws MarshalException
-	 *             if a {@link java.io.IOException} occurs while
-	 *             marshalling the remote call header, arguments or return value
-	 *             for a remote method call
-	 * @throws IOException
-	 *             if the socket is closed
-	 * @throws ProtocolException
-	 *             if there is an error in the underlying protocol
-	 */
-	@Override
-	public final void establishConnection() throws MarshalException,
-			IOException, ProtocolException {
-
-		if (lastUsageTime == null) {
-			// Initially, by default 1 millisecond.
-			handshake();
-			rttTable.put(this.ep, new Long(1));
-			lastUsageTime = System.currentTimeMillis();
-		} else if (System.currentTimeMillis() - this.lastUsageTime >= (rttTable
-				.get(this.ep) * 2)) {
-			// The multiplied constant 2 is suggested in
-			// http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3.
-			Long sentTime = System.currentTimeMillis();
-			protocolHandler.writePing(); // renewConnection();
-			out.flush();
-			protocolHandler.readPingAck();
-			rttTable.put(ep, System.currentTimeMillis() - sentTime);
-		}
-	}
-
-	/**
-	 * Writes the initial handshake data, indicating that the Stream protocol
-	 * will be used, reads the handshake response from the server, and writes
-	 * the client's default Endpoint.
-	 * 
-	 * @throws MarshalException
-	 *             if an exception occurs while writing the handshake
-	 *             information.
-	 */
-	private final void handshake() throws MarshalException {
-		try {
-			protocolHandler.writeHandshake(ProtocolType.STREAM);
-			out.flush();
-			protocolHandler.readHandshakeResponse();
-			EndpointID.read(in);
-			protocolHandler.writeHandshakeResponse();
-			out.flush();
-		} catch (MarshalException e) {
-			throw new MarshalException("I/O Error Marshaling Transport Header",
-					e);
-		} catch (ProtocolException e) {
-			throw new MarshalException("I/O Error Marshaling Transport Header",
-					e);
-		} catch (IOException e) {
-			throw new MarshalException("Exception marshaling JRMP Header", e);
-		}
-	}
-
-	/**
-	 * Writes the call request data into the connection, and reads the results
-	 * of the execution in the server.
-	 * 
-	 * @param objId
-	 *            the specified {@link java.rmi.server.ObjID}
-	 * @param args
-	 *            the arguments of the invocation
-	 * @param hash
-	 *            the specified hash for the invoke method
-	 * @param waitReturn
-	 *            this parameter indicates whether or not to wait for a return
-	 *            value
-	 * @return the return value of the remote method call
-	 * @throws Exception
-	 *             if any exception is thrown on the server side
-	 */
-
-	@Override
-	protected final Object methodCall(ObjID objId, long hash, Object[] args,
-			boolean waitReturn) throws Exception {
-		UID uid = null;
-		ReturnMessage result = null;
-
-		protocolHandler.writeCall(objId, hash, args);
-		out.flush();
-		result = protocolHandler.readResult(waitReturn);
-		uid = result.getUID();
-		// FIXME : What do we do with the UID?
-		if (result.sendsDGCAck()) {
-			try {
-				acknowledgeDGC(uid);
-			} catch (ProtocolException e) {
-				// FIXME REVIEW: Not sure this exception must be swallowed.
-			}
-		}
-		if (result.isException()) {
-			throw result.getException();
-		}
-		return result.getResult();
-	}
-
-	@Override
-	public boolean isReusable() {
-		return true;
-	}
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.IOException;
+import java.net.Socket;
+import java.rmi.ConnectIOException;
+import java.rmi.MarshalException;
+import java.rmi.server.ObjID;
+import java.rmi.server.UID;
+
+import org.apache.harmony.rmi.internal.transport.jrmp.ProtocolType;
+import org.apache.harmony.rmi.internal.transport.jrmp.ReturnMessage;
+
+/**
+ * Encapsulates the Client events occurring in the JRMP protocol. It creates a
+ * socket for the specified {@link org.apache.harmony.rmi.internal.transport.Endpoint}, it
+ * sends all the parameters in the apropriate order and it waits for the
+ * results.
+ * 
+ * @author Gustavo Petri
+ */
+final class StreamClientConnection extends AbstractClientConnection {
+
+	/**
+	 * Creates a new connection to the specified
+	 * {@link org.apache.harmony.rmi.internal.transport.Endpoint}.
+	 * 
+	 * @param ep
+	 *            the {@link org.apache.harmony.rmi.internal.transport.Endpoint} to connect
+	 * @param sock
+	 *            the {@link java.net.Socket} to connect
+	 * @throws ConnectIOException
+	 *             if an IOException occurs while making a connection to the
+	 *             remote host
+	 */
+	public StreamClientConnection(Socket sock, Endpoint ep)
+			throws ConnectIOException {
+		super(sock, ep);
+	}
+
+	/**
+	 * Establishes a connection.
+	 * <li>If {@link #lastUsageTime} is <code>null</code> then starts a
+	 * connection.
+	 * <li>If the difference between current time and {@link #lastUsageTime} is
+	 * bigger or equal than double of the value stored in the table then renew
+	 * the connection. The multiplied constant 2 is suggested in this
+	 * {@link <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3">link</a>}
+	 * 
+	 * @throws MarshalException
+	 *             if a {@link java.io.IOException} occurs while
+	 *             marshalling the remote call header, arguments or return value
+	 *             for a remote method call
+	 * @throws IOException
+	 *             if the socket is closed
+	 * @throws ProtocolException
+	 *             if there is an error in the underlying protocol
+	 */
+	@Override
+	public final void establishConnection() throws MarshalException,
+			IOException, ProtocolException {
+
+		if (lastUsageTime == null) {
+			// Initially, by default 1 millisecond.
+			handshake();
+			rttTable.put(this.ep, new Long(1));
+			lastUsageTime = System.currentTimeMillis();
+		} else if (System.currentTimeMillis() - this.lastUsageTime >= (rttTable
+				.get(this.ep) * 2)) {
+			// The multiplied constant 2 is suggested in
+			// http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=rmi-users&P=R23746&D=0&I=-3.
+			Long sentTime = System.currentTimeMillis();
+			protocolHandler.writePing(); // renewConnection();
+			out.flush();
+			protocolHandler.readPingAck();
+			rttTable.put(ep, System.currentTimeMillis() - sentTime);
+		}
+	}
+
+	/**
+	 * Writes the initial handshake data, indicating that the Stream protocol
+	 * will be used, reads the handshake response from the server, and writes
+	 * the client's default Endpoint.
+	 * 
+	 * @throws MarshalException
+	 *             if an exception occurs while writing the handshake
+	 *             information.
+	 */
+	private final void handshake() throws MarshalException {
+		try {
+			protocolHandler.writeHandshake(ProtocolType.STREAM);
+			out.flush();
+			protocolHandler.readHandshakeResponse();
+			EndpointID.read(in);
+			protocolHandler.writeHandshakeResponse();
+			out.flush();
+		} catch (MarshalException e) {
+			throw new MarshalException("I/O Error Marshaling Transport Header",
+					e);
+		} catch (ProtocolException e) {
+			throw new MarshalException("I/O Error Marshaling Transport Header",
+					e);
+		} catch (IOException e) {
+			throw new MarshalException("Exception marshaling JRMP Header", e);
+		}
+	}
+
+	/**
+	 * Writes the call request data into the connection, and reads the results
+	 * of the execution in the server.
+	 * 
+	 * @param objId
+	 *            the specified {@link java.rmi.server.ObjID}
+	 * @param args
+	 *            the arguments of the invocation
+	 * @param hash
+	 *            the specified hash for the invoke method
+	 * @param waitReturn
+	 *            this parameter indicates whether or not to wait for a return
+	 *            value
+	 * @return the return value of the remote method call
+	 * @throws Exception
+	 *             if any exception is thrown on the server side
+	 */
+
+	@Override
+	protected final Object methodCall(ObjID objId, long hash, Object[] args,
+			boolean waitReturn) throws Exception {
+		UID uid = null;
+		ReturnMessage result = null;
+
+		protocolHandler.writeCall(objId, hash, args);
+		out.flush();
+		result = protocolHandler.readResult(waitReturn);
+		uid = result.getUID();
+		// FIXME : What do we do with the UID?
+		if (result.sendsDGCAck()) {
+			try {
+				acknowledgeDGC(uid);
+			} catch (ProtocolException e) {
+				// FIXME REVIEW: Not sure this exception must be swallowed.
+			}
+		}
+		if (result.isException()) {
+			throw result.getException();
+		}
+		return result.getResult();
+	}
+
+	@Override
+	public boolean isReusable() {
+		return true;
+	}
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamServerConnection.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamServerConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/StreamServerConnection.java Thu May 18 23:00:52 2006
@@ -1,108 +1,108 @@
-/* 
-*  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 ar.org.fitc.rmi.transport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.rmi.RemoteException;
-
-import ar.org.fitc.rmi.transport.jrmp.Message;
-import ar.org.fitc.rmi.transport.jrmp.MessageType;
-import ar.org.fitc.rmi.transport.jrmp.ProtocolType;
-
-/**
- * Encapsulates the Server events occurring in the JRMP protocol.
- * 
- * @author Gustavo Petri
- */
-final class StreamServerConnection extends AbstractServerConnection {
-
-	/**
-	 * Creates a new connection to the specified
-	 * {@link ar.org.fitc.rmi.transport.EndpointID}
-	 * 
-	 * @param in
-	 *            the specified
-	 *            {@link InputStream}
-	 * @param out
-	 *            the specified
-	 *            {@link OutputStream}
-	 * @param clientEP
-	 *            the specified {@link ar.org.fitc.rmi.transport.EndpointID}
-	 * @param sock
-	 *            the socket of connection
-	 */
-	public StreamServerConnection(InputStream in, OutputStream out,
-			EndpointID clientEP, Socket sock) {
-		super(in, out, clientEP, sock);
-	}
-
-	/**
-	 * Establishes a connection.
-	 * 
-	 * @throws ProtocolException
-	 *             if there is an error in the underlying protocol
-	 */
-	@Override
-	public final void establishConnection() throws ProtocolException {
-		/*
-		 * REVIEW: Check what to do with the client's default serving endpoint.
-		 */
-		protocolHandler.readHandShake(ProtocolType.STREAM);
-		protocolHandler.answerHandshake();
-		try {
-			out.flush();
-		} catch (IOException e) {
-			throw new ProtocolException(
-					"IOException flushing the socket contents", e);
-		}
-		// ignores the returned ServerProtocolHandler
-		protocolHandler.readEndpointNegotiation();
-	}
-
-	/**
-	 * Handles the incoming message.
-	 * 
-	 * @throws RemoteException
-	 *             If an exception occurs during message handling.
-	 */
-	@Override
-	public final void serve() throws Exception {
-		Message msg = null;
-        try {
-            msg = protocolHandler.readMessage();
-        } catch (Exception e) {
-            handleException(e);
-            throw e;
-        }
-		MessageType type = msg.getType();
-
-		if (type == MessageType.CALL) {
-			handleCall(msg);
-		} else if (type == MessageType.DGCACK) {
-			handleDGCAck(msg);
-		} else if (type == MessageType.PING) {
-			protocolHandler.writePingAck();
-			try {
-				out.flush();
-			} catch (IOException e) {
-				throw new ProtocolException("I/O Error Writing the PingAck");
-			}
-		}
-	}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.rmi.RemoteException;
+
+import org.apache.harmony.rmi.internal.transport.jrmp.Message;
+import org.apache.harmony.rmi.internal.transport.jrmp.MessageType;
+import org.apache.harmony.rmi.internal.transport.jrmp.ProtocolType;
+
+/**
+ * Encapsulates the Server events occurring in the JRMP protocol.
+ * 
+ * @author Gustavo Petri
+ */
+final class StreamServerConnection extends AbstractServerConnection {
+
+	/**
+	 * Creates a new connection to the specified
+	 * {@link org.apache.harmony.rmi.internal.transport.EndpointID}
+	 * 
+	 * @param in
+	 *            the specified
+	 *            {@link InputStream}
+	 * @param out
+	 *            the specified
+	 *            {@link OutputStream}
+	 * @param clientEP
+	 *            the specified {@link org.apache.harmony.rmi.internal.transport.EndpointID}
+	 * @param sock
+	 *            the socket of connection
+	 */
+	public StreamServerConnection(InputStream in, OutputStream out,
+			EndpointID clientEP, Socket sock) {
+		super(in, out, clientEP, sock);
+	}
+
+	/**
+	 * Establishes a connection.
+	 * 
+	 * @throws ProtocolException
+	 *             if there is an error in the underlying protocol
+	 */
+	@Override
+	public final void establishConnection() throws ProtocolException {
+		/*
+		 * REVIEW: Check what to do with the client's default serving endpoint.
+		 */
+		protocolHandler.readHandShake(ProtocolType.STREAM);
+		protocolHandler.answerHandshake();
+		try {
+			out.flush();
+		} catch (IOException e) {
+			throw new ProtocolException(
+					"IOException flushing the socket contents", e);
+		}
+		// ignores the returned ServerProtocolHandler
+		protocolHandler.readEndpointNegotiation();
+	}
+
+	/**
+	 * Handles the incoming message.
+	 * 
+	 * @throws RemoteException
+	 *             If an exception occurs during message handling.
+	 */
+	@Override
+	public final void serve() throws Exception {
+		Message msg = null;
+        try {
+            msg = protocolHandler.readMessage();
+        } catch (Exception e) {
+            handleException(e);
+            throw e;
+        }
+		MessageType type = msg.getType();
+
+		if (type == MessageType.CALL) {
+			handleCall(msg);
+		} else if (type == MessageType.DGCACK) {
+			handleDGCAck(msg);
+		} else if (type == MessageType.PING) {
+			protocolHandler.writePingAck();
+			try {
+				out.flush();
+			} catch (IOException e) {
+				throw new ProtocolException("I/O Error Writing the PingAck");
+			}
+		}
+	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/TransportManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/TransportManager.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/TransportManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/TransportManager.java Thu May 18 23:00:52 2006
@@ -1,312 +1,312 @@
-/* 
-*  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 ar.org.fitc.rmi.transport;
-
-import java.io.IOException;
-import java.rmi.server.ExportException;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.ServerNotActiveException;
-import java.rmi.server.UID;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-
-import ar.org.fitc.rmi.utils.Pair;
-import ar.org.fitc.rmi.utils.ReversibleHashSet;
-
-/*
- * NOTE: 
- * This class has been modified in order to support 
- * Java VM 1.4.2 using the javac's target jsr14 
- */
-
-/**
- * Serves as a Transport Service Provider for the RMI subsystem. It is
- * implemented as a singleton, and it provides the methods necesary to handle
- * exportation (and unexportation) of objects, and also invocation of methods of
- * remote objects.
- * <p>
- * This class contains a mapping of ObjIDs to ports, which will be used to
- * validate the invocation of a method for a certain object in a certain port.
- * 
- * @author Gustavo Petri
- * 
- */
-public final class TransportManager {
-
-    /**
-     * This is a Singleton.
-     */
-    private static TransportManager transportManager;
-
-    /**
-     * A {@link ar.org.fitc.rmi.utils.ReversibleHashSet} for storing the port
-     * and the corresponding {@link java.rmi.server.ObjID}.
-     */
-    private ReversibleHashSet<Integer, ObjID> portObjIDMap;
-
-    /**
-     * Serves as a cache for
-     * {@link ar.org.fitc.rmi.transport.MultiThreadedServer} and its
-     * {@link ar.org.fitc.rmi.transport.Endpoint}, indexed by port.
-     */
-    private HashMap<Integer, Pair<MultiThreadedServer, Endpoint>> serverMap;
-
-    /**
-     * Indexes the ClientHost and
-     * {@link ar.org.fitc.rmi.transport.StreamClientConnection} by Thread (hashcode).
-     */
-    private Map<Integer, Pair<String, Integer>> clientConnectionMap;
-
-    /**
-     * Mapping from {@link java.rmi.server.ObjID} to the Thread (hashcode) of the threads
-     * executing methods for that {@link java.rmi.server.ObjID}.
-     */
-    private Map<ObjID, Set<Integer>> executingThreads;
-
-    /**
-     * A pool of connections.
-     */
-    private ConnectionPool connPool;
-
-    private Map<Integer, RMIServerSocketFactory> portsInUse;
-
-    /**
-     * The getter for the Singleton.
-     * 
-     * @return the singleton
-     */
-    public final static synchronized TransportManager getTransportManager() {
-        if (transportManager == null) {
-            transportManager = new TransportManager();
-        }
-        return transportManager;
-    }
-
-    /**
-     * The constructor for the TransportManager.
-     */
-    private TransportManager() {
-        this.portObjIDMap = new ReversibleHashSet<Integer, ObjID>();
-        this.serverMap = new HashMap<Integer, Pair<MultiThreadedServer, Endpoint>>();
-        // This Map needs to be synchronized.
-        this.clientConnectionMap = new Hashtable<Integer, Pair<String, Integer>>();
-        this.portsInUse = new HashMap<Integer, RMIServerSocketFactory>();
-        this.executingThreads = new Hashtable<ObjID, Set<Integer>>();
-        this.connPool = new ConnectionPool();
-        transportManager = this;
-    }
-
-    /**
-     * Obtains a ClientConnection and sends a DGCack message
-     * 
-     * @param uid
-     *            the specified {@link UID}
-     * @param ep
-     *            The {@link Endpoint} to acknowledge
-     */
-    protected void acknowledgeDGC(UID uid, Endpoint ep) {
-        AbstractClientConnection cc;
-
-        try {
-            cc = connPool.getClientConnection(ep);
-            cc.acknowledgeDGC(uid);
-        } catch (IOException e) {
-            // FIXME REVIEW: What to do when an exception is thrown here. May be
-            // a logger could be useful.
-        }
-
-    }
-    
-    /**
-     * Obtains the {@link #clientConnectionMap}
-     * 
-     * @return the {@link #clientConnectionMap}
-     */
-    protected Map<Integer, Pair<String, Integer>> getClientConnectionMap() {
-        return clientConnectionMap;
-    }
-
-    /**
-     * Obtains the the {@link #executingThreads}
-     * 
-     * @return the the {@link #executingThreads}
-     */
-    protected Map<ObjID, Set<Integer>> getExecutingThreads() {
-        return executingThreads;
-    }
-
-    
-    /**
-     * Creates a
-     * {@link java.net.ServerSocket} and listens in the port argument Port for 
-     * new connectios corresponding to the objects with objID ID. When a new 
-     * connection is received it constructs a new {@link MultiThreadedServer} to
-     * handle the requests.
-     * 
-     * @param objID
-     *            the specified {@link java.rmi.server.ObjID}
-     * @param port
-     *            the port of the connection
-     * @param ssf
-     *            the specified {@link java.rmi.server.RMIServerSocketFactory}
-     * @param csf
-     *            the specified {@link java.rmi.server.RMIClientSocketFactory}
-     * @return the {@link ar.org.fitc.rmi.transport.Endpoint} of the connection
-     * @throws ExportException
-     *             if the exportation fails
-     */
-    public final Endpoint export(ObjID objID, int port,
-            RMIServerSocketFactory ssf, RMIClientSocketFactory csf)
-            throws ExportException {
-        Endpoint ep;
-
-        if (serverMap.containsKey(port)) {
-            if (portsInUse.get(port) != ssf) {
-                throw new ExportException("Port Already in use");
-            }
-            portObjIDMap.insert(port, objID);
-            return serverMap.get(port).getSecond();
-        } else if (port > 0) {
-            portsInUse.put(port, ssf);
-        } else if (!serverMap.isEmpty() && port == 0) {
-            int newPort = serverMap.keySet().iterator().next();
-            portObjIDMap.insert(newPort, objID);
-            portsInUse.put(newPort, ssf);
-            return serverMap.get(newPort).getSecond();
-        }
-        MultiThreadedServer multiThreadedServer = new MultiThreadedServer(ssf,
-                port);
-        portObjIDMap.insert(multiThreadedServer.getLocalPort(), objID);
-        ep = new Endpoint(multiThreadedServer.getLocalPort(), csf);
-        serverMap
-                .put(multiThreadedServer.getLocalPort(),
-                        new Pair<MultiThreadedServer, Endpoint>(
-                                multiThreadedServer, ep));
-        multiThreadedServer.start();
-        return ep;
-    }
-
-    /**
-     * Unexports an object.
-     * 
-     * @param objID
-     *            the specified {@link java.rmi.server.ObjID}
-     * @param force
-     *            <code>true</code> if the object must to be unexported
-     * @return <code>true</code> if the object has been exported, <code>false
-     * </code>
-     *         if not.
-     */
-    public final boolean unexport(ObjID objID, boolean force) {
-        boolean ret = true;
-        int port;
-
-        if (executingThreads.containsKey(objID) && !force) {
-            ret = false;
-        } else {
-            port = portObjIDMap.getKeyFromValue(objID);
-            if (portObjIDMap.getValues(port).size() > 1) {
-                portsInUse.remove(portObjIDMap.getKeyFromValue(objID));
-                portObjIDMap.removeValue(objID);
-            } else {
-                portObjIDMap.removeValue(objID);
-                try {
-                    serverMap.get(port).getFirst().stopServing();
-                    serverMap.remove(port);
-                } catch (IOException e) {
-                    // FIXME REVIEW: What to do with this exception?
-                    // May be some logging would be useful here.
-                }
-            }
-        }
-        return ret;
-    }
-
-    /**
-     * Obtains a ClientConnection and forwards the request to it. If the 
-     * used connection is reusable, it is returned to the pool, otherwise is
-     * closed. 
-     * 
-     * @param objID
-     *            the specified {@link java.rmi.server.ObjID}
-     * @param ep
-     *            the {@link ar.org.fitc.rmi.transport.Endpoint} of the
-     *            connection
-     * @param args
-     *            the arguments of the invocation
-     * @param methodHash
-     *            the specified hash
-     * @param waitReturn
-     *            this parameter indicates whether or not to wait for a return
-     *            value
-     * @return the return value of the remote method call
-     * @throws Exception
-     *             if any exception is thrown on the server side
-     */
-    public final Object invoke(ObjID objID, Endpoint ep, Object[] args,
-            long methodHash, boolean waitReturn) throws Exception {
-        Object obj;
-        AbstractClientConnection cc = connPool.getClientConnection(ep);
-        obj = cc.invoke(objID, methodHash, args, waitReturn);
-        if (cc.isReusable()) {
-            // only applicable if the connection is reusable
-            connPool.releaseClientConnection(ep, (StreamClientConnection) cc);
-        } else {
-        	cc.releaseConnection();
-        }
-        return obj;
-    }
-
-    /**
-     * Obtains the <code>ClientHost</code>
-     * 
-     * @return the <code>ClientHost</code>
-     * @throws ServerNotActiveException
-     *             if there is no Client executing methods
-     */
-    public final String getClientHost() throws ServerNotActiveException {
-        Pair<String, Integer> ret = clientConnectionMap.get(
-                Thread.currentThread().hashCode());
-
-        if (ret == null) {
-            throw new ServerNotActiveException(
-                    "There is no Client executing methods");
-        }
-        return ret.getFirst();
-    }
-
-    /**
-     * Obtains the <code>ClientConnection</code>
-     * 
-     * @return the <code>ClientConnection</code>
-     * @throws ServerNotActiveException
-     *             if there is no Client executing methods
-     */
-    public final String getClientConnection() throws ServerNotActiveException {
-        Pair<String, Integer> ret = clientConnectionMap.get(
-                Thread.currentThread().hashCode());
-
-        if (ret == null) {
-            throw new ServerNotActiveException(
-                    "There is no Client executing methods");
-        }
-        return "TCP Connection (" + ret.getSecond() + ")";
-    }
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport;
+
+import java.io.IOException;
+import java.rmi.server.ExportException;
+import java.rmi.server.ObjID;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UID;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.harmony.rmi.internal.utils.Pair;
+import org.apache.harmony.rmi.internal.utils.ReversibleHashSet;
+
+/*
+ * NOTE: 
+ * This class has been modified in order to support 
+ * Java VM 1.4.2 using the javac's target jsr14 
+ */
+
+/**
+ * Serves as a Transport Service Provider for the RMI subsystem. It is
+ * implemented as a singleton, and it provides the methods necesary to handle
+ * exportation (and unexportation) of objects, and also invocation of methods of
+ * remote objects.
+ * <p>
+ * This class contains a mapping of ObjIDs to ports, which will be used to
+ * validate the invocation of a method for a certain object in a certain port.
+ * 
+ * @author Gustavo Petri
+ * 
+ */
+public final class TransportManager {
+
+    /**
+     * This is a Singleton.
+     */
+    private static TransportManager transportManager;
+
+    /**
+     * A {@link org.apache.harmony.rmi.internal.utils.ReversibleHashSet} for storing the port
+     * and the corresponding {@link java.rmi.server.ObjID}.
+     */
+    private ReversibleHashSet<Integer, ObjID> portObjIDMap;
+
+    /**
+     * Serves as a cache for
+     * {@link org.apache.harmony.rmi.internal.transport.MultiThreadedServer} and its
+     * {@link org.apache.harmony.rmi.internal.transport.Endpoint}, indexed by port.
+     */
+    private HashMap<Integer, Pair<MultiThreadedServer, Endpoint>> serverMap;
+
+    /**
+     * Indexes the ClientHost and
+     * {@link org.apache.harmony.rmi.internal.transport.StreamClientConnection} by Thread (hashcode).
+     */
+    private Map<Integer, Pair<String, Integer>> clientConnectionMap;
+
+    /**
+     * Mapping from {@link java.rmi.server.ObjID} to the Thread (hashcode) of the threads
+     * executing methods for that {@link java.rmi.server.ObjID}.
+     */
+    private Map<ObjID, Set<Integer>> executingThreads;
+
+    /**
+     * A pool of connections.
+     */
+    private ConnectionPool connPool;
+
+    private Map<Integer, RMIServerSocketFactory> portsInUse;
+
+    /**
+     * The getter for the Singleton.
+     * 
+     * @return the singleton
+     */
+    public final static synchronized TransportManager getTransportManager() {
+        if (transportManager == null) {
+            transportManager = new TransportManager();
+        }
+        return transportManager;
+    }
+
+    /**
+     * The constructor for the TransportManager.
+     */
+    private TransportManager() {
+        this.portObjIDMap = new ReversibleHashSet<Integer, ObjID>();
+        this.serverMap = new HashMap<Integer, Pair<MultiThreadedServer, Endpoint>>();
+        // This Map needs to be synchronized.
+        this.clientConnectionMap = new Hashtable<Integer, Pair<String, Integer>>();
+        this.portsInUse = new HashMap<Integer, RMIServerSocketFactory>();
+        this.executingThreads = new Hashtable<ObjID, Set<Integer>>();
+        this.connPool = new ConnectionPool();
+        transportManager = this;
+    }
+
+    /**
+     * Obtains a ClientConnection and sends a DGCack message
+     * 
+     * @param uid
+     *            the specified {@link UID}
+     * @param ep
+     *            The {@link Endpoint} to acknowledge
+     */
+    protected void acknowledgeDGC(UID uid, Endpoint ep) {
+        AbstractClientConnection cc;
+
+        try {
+            cc = connPool.getClientConnection(ep);
+            cc.acknowledgeDGC(uid);
+        } catch (IOException e) {
+            // FIXME REVIEW: What to do when an exception is thrown here. May be
+            // a logger could be useful.
+        }
+
+    }
+    
+    /**
+     * Obtains the {@link #clientConnectionMap}
+     * 
+     * @return the {@link #clientConnectionMap}
+     */
+    protected Map<Integer, Pair<String, Integer>> getClientConnectionMap() {
+        return clientConnectionMap;
+    }
+
+    /**
+     * Obtains the the {@link #executingThreads}
+     * 
+     * @return the the {@link #executingThreads}
+     */
+    protected Map<ObjID, Set<Integer>> getExecutingThreads() {
+        return executingThreads;
+    }
+
+    
+    /**
+     * Creates a
+     * {@link java.net.ServerSocket} and listens in the port argument Port for 
+     * new connectios corresponding to the objects with objID ID. When a new 
+     * connection is received it constructs a new {@link MultiThreadedServer} to
+     * handle the requests.
+     * 
+     * @param objID
+     *            the specified {@link java.rmi.server.ObjID}
+     * @param port
+     *            the port of the connection
+     * @param ssf
+     *            the specified {@link java.rmi.server.RMIServerSocketFactory}
+     * @param csf
+     *            the specified {@link java.rmi.server.RMIClientSocketFactory}
+     * @return the {@link org.apache.harmony.rmi.internal.transport.Endpoint} of the connection
+     * @throws ExportException
+     *             if the exportation fails
+     */
+    public final Endpoint export(ObjID objID, int port,
+            RMIServerSocketFactory ssf, RMIClientSocketFactory csf)
+            throws ExportException {
+        Endpoint ep;
+
+        if (serverMap.containsKey(port)) {
+            if (portsInUse.get(port) != ssf) {
+                throw new ExportException("Port Already in use");
+            }
+            portObjIDMap.insert(port, objID);
+            return serverMap.get(port).getSecond();
+        } else if (port > 0) {
+            portsInUse.put(port, ssf);
+        } else if (!serverMap.isEmpty() && port == 0) {
+            int newPort = serverMap.keySet().iterator().next();
+            portObjIDMap.insert(newPort, objID);
+            portsInUse.put(newPort, ssf);
+            return serverMap.get(newPort).getSecond();
+        }
+        MultiThreadedServer multiThreadedServer = new MultiThreadedServer(ssf,
+                port);
+        portObjIDMap.insert(multiThreadedServer.getLocalPort(), objID);
+        ep = new Endpoint(multiThreadedServer.getLocalPort(), csf);
+        serverMap
+                .put(multiThreadedServer.getLocalPort(),
+                        new Pair<MultiThreadedServer, Endpoint>(
+                                multiThreadedServer, ep));
+        multiThreadedServer.start();
+        return ep;
+    }
+
+    /**
+     * Unexports an object.
+     * 
+     * @param objID
+     *            the specified {@link java.rmi.server.ObjID}
+     * @param force
+     *            <code>true</code> if the object must to be unexported
+     * @return <code>true</code> if the object has been exported, <code>false
+     * </code>
+     *         if not.
+     */
+    public final boolean unexport(ObjID objID, boolean force) {
+        boolean ret = true;
+        int port;
+
+        if (executingThreads.containsKey(objID) && !force) {
+            ret = false;
+        } else {
+            port = portObjIDMap.getKeyFromValue(objID);
+            if (portObjIDMap.getValues(port).size() > 1) {
+                portsInUse.remove(portObjIDMap.getKeyFromValue(objID));
+                portObjIDMap.removeValue(objID);
+            } else {
+                portObjIDMap.removeValue(objID);
+                try {
+                    serverMap.get(port).getFirst().stopServing();
+                    serverMap.remove(port);
+                } catch (IOException e) {
+                    // FIXME REVIEW: What to do with this exception?
+                    // May be some logging would be useful here.
+                }
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * Obtains a ClientConnection and forwards the request to it. If the 
+     * used connection is reusable, it is returned to the pool, otherwise is
+     * closed. 
+     * 
+     * @param objID
+     *            the specified {@link java.rmi.server.ObjID}
+     * @param ep
+     *            the {@link org.apache.harmony.rmi.internal.transport.Endpoint} of the
+     *            connection
+     * @param args
+     *            the arguments of the invocation
+     * @param methodHash
+     *            the specified hash
+     * @param waitReturn
+     *            this parameter indicates whether or not to wait for a return
+     *            value
+     * @return the return value of the remote method call
+     * @throws Exception
+     *             if any exception is thrown on the server side
+     */
+    public final Object invoke(ObjID objID, Endpoint ep, Object[] args,
+            long methodHash, boolean waitReturn) throws Exception {
+        Object obj;
+        AbstractClientConnection cc = connPool.getClientConnection(ep);
+        obj = cc.invoke(objID, methodHash, args, waitReturn);
+        if (cc.isReusable()) {
+            // only applicable if the connection is reusable
+            connPool.releaseClientConnection(ep, (StreamClientConnection) cc);
+        } else {
+        	cc.releaseConnection();
+        }
+        return obj;
+    }
+
+    /**
+     * Obtains the <code>ClientHost</code>
+     * 
+     * @return the <code>ClientHost</code>
+     * @throws ServerNotActiveException
+     *             if there is no Client executing methods
+     */
+    public final String getClientHost() throws ServerNotActiveException {
+        Pair<String, Integer> ret = clientConnectionMap.get(
+                Thread.currentThread().hashCode());
+
+        if (ret == null) {
+            throw new ServerNotActiveException(
+                    "There is no Client executing methods");
+        }
+        return ret.getFirst();
+    }
+
+    /**
+     * Obtains the <code>ClientConnection</code>
+     * 
+     * @return the <code>ClientConnection</code>
+     * @throws ServerNotActiveException
+     *             if there is no Client executing methods
+     */
+    public final String getClientConnection() throws ServerNotActiveException {
+        Pair<String, Integer> ret = clientConnectionMap.get(
+                Thread.currentThread().hashCode());
+
+        if (ret == null) {
+            throw new ServerNotActiveException(
+                    "There is no Client executing methods");
+        }
+        return "TCP Connection (" + ret.getSecond() + ")";
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientInputStream.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientInputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientInputStream.java Thu May 18 23:00:52 2006
@@ -1,62 +1,62 @@
-/* 
- *  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 ar.org.fitc.rmi.transport.http;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Specializes <code>HttpInputStream</code> for the client socket side
- * 
- * @author Diego Raúl Mercado
- */
-class HttpClientInputStream extends HttpInputStream {
-
-    /**
-     * Constructor. Calls <code>HttpInputStream(InputStream)</code>
-     * constructor.
-     * 
-     * @param is
-     *            the socket's input stream
-     */
-    public HttpClientInputStream(InputStream is) {
-        super(is);
-    }
-
-    /**
-     * Parse the first line (status line) of the http's header.
-     * 
-     * @param line
-     *            the line that has been read from the socket's input stream
-     */
-    @Override
-    protected void readFirstLine(String line) throws IOException {
-        // LINE: HTTP_VERSION + " " + STATUS_CODE
-        String[] splitLine = line.split(" ");
-        if (splitLine.length < 2) {
-            throw HEADERS_EXCEPTION;
-        }
-        int statusCode = 0;
-        try {
-            statusCode = Integer.valueOf(splitLine[1].trim());
-        } catch (NumberFormatException e) {
-            throw HEADERS_EXCEPTION;
-        }
-        if (statusCode != 200) {
-            throw new IOException("Unexpected HTTP status code: " + statusCode);
-        }
-    }
-}
+/* 
+ *  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 org.apache.harmony.rmi.internal.transport.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Specializes <code>HttpInputStream</code> for the client socket side
+ * 
+ * @author Diego Raúl Mercado
+ */
+class HttpClientInputStream extends HttpInputStream {
+
+    /**
+     * Constructor. Calls <code>HttpInputStream(InputStream)</code>
+     * constructor.
+     * 
+     * @param is
+     *            the socket's input stream
+     */
+    public HttpClientInputStream(InputStream is) {
+        super(is);
+    }
+
+    /**
+     * Parse the first line (status line) of the http's header.
+     * 
+     * @param line
+     *            the line that has been read from the socket's input stream
+     */
+    @Override
+    protected void readFirstLine(String line) throws IOException {
+        // LINE: HTTP_VERSION + " " + STATUS_CODE
+        String[] splitLine = line.split(" ");
+        if (splitLine.length < 2) {
+            throw HEADERS_EXCEPTION;
+        }
+        int statusCode = 0;
+        try {
+            statusCode = Integer.valueOf(splitLine[1].trim());
+        } catch (NumberFormatException e) {
+            throw HEADERS_EXCEPTION;
+        }
+        if (statusCode != 200) {
+            throw new IOException("Unexpected HTTP status code: " + statusCode);
+        }
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientOutputStream.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientOutputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpClientOutputStream.java Thu May 18 23:00:52 2006
@@ -1,46 +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 ar.org.fitc.rmi.transport.http;
-
-import java.io.OutputStream;
-
-/**
- * Concrete class that additionally sets the <code>header</code> required for
- * the http's request line (POST)
- * 
- * @author Diego Raúl Mercado
- */
-final class HttpClientOutputStream extends HttpOutputStream {
-
-    /**
-     * Calls the inherit constructor with the parameters
-     * <code>socketOutput</code> and <code>localHostAddress</code>. <br>
-     * Then, sets <code>header</code> required for the http's request line
-     * (POST)
-     * 
-     * @param socketOutput
-     *            the socket's output stream
-     * @param serverPath
-     *            the path location of the server
-     * @param localHostAddress
-     *            the localHostAddress attached in the http's host header
-     */
-    protected HttpClientOutputStream(OutputStream socketOutput,
-            String serverPath, String localHostAddress) {
-        super(socketOutput, localHostAddress);
-        header = "POST " + serverPath + " HTTP/1.0";
-    }
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport.http;
+
+import java.io.OutputStream;
+
+/**
+ * Concrete class that additionally sets the <code>header</code> required for
+ * the http's request line (POST)
+ * 
+ * @author Diego Raúl Mercado
+ */
+final class HttpClientOutputStream extends HttpOutputStream {
+
+    /**
+     * Calls the inherit constructor with the parameters
+     * <code>socketOutput</code> and <code>localHostAddress</code>. <br>
+     * Then, sets <code>header</code> required for the http's request line
+     * (POST)
+     * 
+     * @param socketOutput
+     *            the socket's output stream
+     * @param serverPath
+     *            the path location of the server
+     * @param localHostAddress
+     *            the localHostAddress attached in the http's host header
+     */
+    protected HttpClientOutputStream(OutputStream socketOutput,
+            String serverPath, String localHostAddress) {
+        super(socketOutput, localHostAddress);
+        header = "POST " + serverPath + " HTTP/1.0";
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpHeaders.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpHeaders.java?rev=407724&r1=407183&r2=407724&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpHeaders.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/internal/transport/http/HttpHeaders.java Thu May 18 23:00:52 2006
@@ -1,122 +1,122 @@
-/* 
-*  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 ar.org.fitc.rmi.transport.http;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/*
- * NOTE: 
- * This class has been modified in order to support 
- * Java VM 1.4.2 using the javac's target jsr14 
- */
-
-/**
- * This enum is used for http tunneling  
- * 
- * @author Diego Raúl Mercado
- */
-public class HttpHeaders {
-    private static Set<HttpHeaders> set;
-    
-    static {
-        set = new HashSet<HttpHeaders>();
-    }
-    
-    /**
-     * the Content-Length key 
-     */
-    public final static HttpHeaders CONTENT_LENGTH_HEADER = 
-        new HttpHeaders("Content-Length");
-    /**
-     * the Content-Type key 
-     */
-    public final static HttpHeaders CONTENT_TYPE_HEADER = 
-        new HttpHeaders("Content-Type");
-
-    /**
-     * the Connection key 
-     */
-    public final static HttpHeaders CONNECTION_HEADER = 
-        new HttpHeaders("Connection");
-    
-    /**
-     * the Cache-Control key 
-     */
-    public final static HttpHeaders CACHE_CONTROL_HEADER = 
-        new HttpHeaders("Cache-Control");
-
-    /**
-     * the Pragma key 
-     */
-    public final static HttpHeaders PRAGMA_HEADER = 
-        new HttpHeaders("Pragma");
-
-    /**
-     * the Host key 
-     */
-    public final static HttpHeaders HOST_HEADER = 
-        new HttpHeaders("Host");
-
-    /**
-     * the User-Agent key 
-     */
-    public final static HttpHeaders USER_AGENT_HEADER = 
-        new HttpHeaders("User-Agent");
-
-    /**
-     * the Accept key 
-     */
-    public final static HttpHeaders ACCEPT_HEADER = 
-        new HttpHeaders("Accept");
-    
-    /** Indicates de value of this enum */
-    private String value;
-
-    /** 
-     * Constructor
-     * 
-     * @param value the value of this enum 
-     */
-    private HttpHeaders(String value) {
-        this.value = value;
-        set.add(this);
-    }
-    
-    /** 
-     * @return the value of this enum 
-     */
-    @Override
-    public final String toString() {
-        return value;
-    }
-
-    /**
-     * Given a String value, returns the current type  
-     * 
-     * @param value the value at constructor time 
-     * @return the current type or null if is not available 
-     */
-    public final static HttpHeaders getEnum(String value) {
-        for (HttpHeaders hh : set) {
-            if (hh.toString() == value) {
-                return hh;
-            }
-        }
-        return null;
-    }
-}
+/* 
+*  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 org.apache.harmony.rmi.internal.transport.http;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/*
+ * NOTE: 
+ * This class has been modified in order to support 
+ * Java VM 1.4.2 using the javac's target jsr14 
+ */
+
+/**
+ * This enum is used for http tunneling  
+ * 
+ * @author Diego Raúl Mercado
+ */
+public class HttpHeaders {
+    private static Set<HttpHeaders> set;
+    
+    static {
+        set = new HashSet<HttpHeaders>();
+    }
+    
+    /**
+     * the Content-Length key 
+     */
+    public final static HttpHeaders CONTENT_LENGTH_HEADER = 
+        new HttpHeaders("Content-Length");
+    /**
+     * the Content-Type key 
+     */
+    public final static HttpHeaders CONTENT_TYPE_HEADER = 
+        new HttpHeaders("Content-Type");
+
+    /**
+     * the Connection key 
+     */
+    public final static HttpHeaders CONNECTION_HEADER = 
+        new HttpHeaders("Connection");
+    
+    /**
+     * the Cache-Control key 
+     */
+    public final static HttpHeaders CACHE_CONTROL_HEADER = 
+        new HttpHeaders("Cache-Control");
+
+    /**
+     * the Pragma key 
+     */
+    public final static HttpHeaders PRAGMA_HEADER = 
+        new HttpHeaders("Pragma");
+
+    /**
+     * the Host key 
+     */
+    public final static HttpHeaders HOST_HEADER = 
+        new HttpHeaders("Host");
+
+    /**
+     * the User-Agent key 
+     */
+    public final static HttpHeaders USER_AGENT_HEADER = 
+        new HttpHeaders("User-Agent");
+
+    /**
+     * the Accept key 
+     */
+    public final static HttpHeaders ACCEPT_HEADER = 
+        new HttpHeaders("Accept");
+    
+    /** Indicates de value of this enum */
+    private String value;
+
+    /** 
+     * Constructor
+     * 
+     * @param value the value of this enum 
+     */
+    private HttpHeaders(String value) {
+        this.value = value;
+        set.add(this);
+    }
+    
+    /** 
+     * @return the value of this enum 
+     */
+    @Override
+    public final String toString() {
+        return value;
+    }
+
+    /**
+     * Given a String value, returns the current type  
+     * 
+     * @param value the value at constructor time 
+     * @return the current type or null if is not available 
+     */
+    public final static HttpHeaders getEnum(String value) {
+        for (HttpHeaders hh : set) {
+            if (hh.toString() == value) {
+                return hh;
+            }
+        }
+        return null;
+    }
+}