harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r406944 [23/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...
Date Tue, 16 May 2006 13:52:07 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ClientExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ClientExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ClientExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ClientExecutor.java Tue May 16 06:51:00 2006
@@ -0,0 +1,144 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.net.MalformedURLException;
+import java.net.UnknownHostException;
+import java.rmi.Naming;
+import java.rmi.NotBoundException;
+import java.rmi.RMISecurityManager;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.ExportException;
+import java.security.Permission;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.Net;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Execution in the client side.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class ClientExecutor extends PropagableExecutorImpl implements
+		PropagableExecutor, RemoteExecutor, ITCRemote {
+
+	/**
+	 * Version number unique identificator.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * The sleep time.
+	 */
+	private final static int SLEEP_MINUTES = 2;
+
+	/**
+	 * The remote interface to a simple remote object.
+	 */
+	private static Registry registry;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException if failed to export object
+	 */
+	protected ClientExecutor() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Obtains a <code>PropagableExecutor</code> for a particular host 
+	 * name.
+	 * 
+	 * @param host a specified host name
+	 * @return a <code>PropagableExecutor</code>
+	 * @throws RemoteException if registry could not be contacted 
+	 * @throws NotBoundException if name is not currently bound
+	 */
+	public static PropagableExecutor getExecutor(String host)
+			throws RemoteException, NotBoundException {
+		Registry reg = LocateRegistry.getRegistry(host, Net.getRegistryPort());
+		PropagableExecutor client;
+		client = (PropagableExecutor) reg.lookup(CLIENT_SERVICE_NAME);
+		return client;
+	}
+
+	/**
+	 * Exports a <code>ClientExecutor</code>.
+	 * 
+	 * @throws RemoteException if registry could not be contacted 
+	 * @throws MalformedURLException if the name is not an 
+	 * appropriately formatted URL
+	 */
+	public static void exportExecutor() throws RemoteException,
+			MalformedURLException {
+		ClientExecutor client = new ClientExecutor();
+		Naming.rebind(CLIENT_SERVICE_NAME, client);
+	}
+
+	/**
+	 * Initializes the <code>Registry</code>. If registry is null, 
+	 * creates it.
+	 * 
+	 */
+	public synchronized static void initRegistry() {
+		if (registry == null) {
+			try {
+				try {
+					registry = LocateRegistry.createRegistry(Net
+							.getRegistryPort());
+				} catch (ExportException e) {
+					registry = LocateRegistry
+							.getRegistry(Net.getRegistryPort());
+				}
+			} catch (RemoteException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public static void main(String[] args) throws RemoteException,
+			MalformedURLException {
+		System.setSecurityManager(new RMISecurityManager() {
+			public void checkPermission(Permission perm) {
+			};
+		});
+		try {
+			ReportIPServer.setServerHost(System
+					.getProperty("java.rmi.server.hostname"));
+		} catch (UnknownHostException e2) {
+			e2.printStackTrace();
+			System.exit(1);
+		}
+		initRegistry();
+		exportExecutor();
+		/*
+		 * This is just to avoid the Registry from being Garbage Collected.
+		 */
+		while (true) {
+			try {
+				ReportIPServer.doit();
+				Thread.sleep(SLEEP_MINUTES * 6000);
+			} catch (InterruptedException e) {
+			}
+		}
+	}
+}
\ No newline at end of file

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ClientExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutor.java Tue May 16 06:51:00 2006
@@ -0,0 +1,81 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Provides a mechanisms for propagate an executor. 
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public interface PropagableExecutor extends Remote, RemoteExecutor {
+
+	/**
+	 * A constant string that represents the name of an object to bind.
+	 */
+	public final String CLIENT_SERVICE_NAME = "ClientExcecutor";
+
+	/**
+	 * A generic method that receives a host name, a <code>
+	 * ServerExecutor</code>, number of executions and an arbitrary 
+	 * number of arguments and return a generic object.
+	 * 
+	 * @param host a string that contains the host 
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of arguments 
+	 * @return a generic object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(String host, ServerExecutor obj, int times,
+			Object... arguments) throws RemoteException;
+
+	/**
+	 * A generic method that receives an array of host names, a <code>
+	 * ServerExecutor</code>, number of executions and an arbitrary 
+	 * number of arguments and return boolean value.
+	 * 
+	 * @param host a string array that contains the hosts 
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of arguments 
+	 * @return <code>true</code> if the execution was successful
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean execute(String[] host, ServerExecutor obj, int times,
+			Object... arguments) throws RemoteException;
+
+	/**
+ 	 * A generic method that receives an array of host names, an index 
+ 	 * of execution a <code>ServerExecutor</code>, number of executions 
+ 	 * and an arbitrary number of arguments and return boolean value.
+ 	 * 
+ 	 * @param host a string array that contains the hosts 
+	 * @param index of execution
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of arguments
+	 * @return <code>true</code> if the execution was successful
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean execute(String[] host, int index, ServerExecutor obj,
+			int times, Object... arguments) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutorImpl.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutorImpl.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutorImpl.java Tue May 16 06:51:00 2006
@@ -0,0 +1,182 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.AccessException;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.util.logging.Logger;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.Net;
+
+/**
+ * Implementation of <code>PropagableExecutor</code>.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class PropagableExecutorImpl extends RemoteExecutorImpl implements
+		PropagableExecutor {
+
+	/**
+	 * For log purpose.
+	 */
+	transient private final static Logger log = Logger.getAnonymousLogger();
+
+	/**
+	 * Version number unique identificator.
+	 */
+	private static final long serialVersionUID = 7253124857830298656L;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException
+	 *             if the remote operation fails
+	 */
+	public PropagableExecutorImpl() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Constructs a <code>PropagableExecutorImpl</code> using 
+	 * a particular supplied port.
+	 *  
+	 * @param port the port number on which the remote object receives 
+	 * calls  
+	 * @throws RemoteException if failed to export object
+	 */
+	public PropagableExecutorImpl(int port) throws RemoteException {
+		super(port);
+	}
+
+	/**
+	 * Constructs a <code>PropagableExecutorImpl</code> using 
+	 * a particular supplied port and socket factories.
+	 * 
+	 * @param port the port number on which the remote object receives 
+	 * calls 
+	 * @param csf the client-side socket factory for making calls to 
+	 * the remote object
+	 * @param ssf the server-side socket factory for receiving remote 
+	 * calls
+	 * @throws RemoteException if failed to export object
+	 */
+	public PropagableExecutorImpl(int port, RMIClientSocketFactory csf,
+			RMIServerSocketFactory ssf) throws RemoteException {
+		super(port, csf, ssf);
+	}
+
+	/**
+	 * Executes an object.
+	 * 
+	 * @param host a string that contains the host 
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of hosts 
+	 * @return a <code>RemoteExecutor</code>
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(String host, ServerExecutor obj, int times,
+			Object... arguments) throws RemoteException {
+		RemoteExecutor client;
+		try {
+			client = (RemoteExecutor) LocateRegistry.getRegistry(host,
+					Net.getRegistryPort()).lookup(CLIENT_SERVICE_NAME);
+			return client.execute(obj, times, arguments);
+		} catch (AccessException e) {
+			throw new RemoteException(e.getMessage());
+		} catch (NotBoundException e) {
+			throw new RemoteException(e.getMessage());
+		}
+	}
+
+	/**
+	 * Executes an object.
+	 * 
+	 * @param host a string array that contains the hosts 
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of hosts
+	 * @return <code>true</code> if the execution was successful
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean execute(String[] host, ServerExecutor obj, int times,
+			Object... arguments) throws RemoteException {
+		if (host != null && host.length > 0) {
+			PropagableExecutor client;
+			try {
+				client = (PropagableExecutor) LocateRegistry.getRegistry(
+						host[0], Net.getRegistryPort()).lookup(
+						CLIENT_SERVICE_NAME);
+				return client.execute(host, 1, obj, times, arguments);
+			} catch (AccessException e) {
+				throw new RemoteException(e.getMessage());
+			} catch (NotBoundException e) {
+				throw new RemoteException(e.getMessage());
+			}
+		} else {
+			return true;
+		}
+
+	}
+
+	/**
+	 * Executes an object.
+	 * 
+	 * @param host a string array that contains the hosts 
+	 * @param index of execution
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of hosts
+	 * @return <code>true</code> if the execution was successful
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean execute(String[] host, int index, ServerExecutor obj,
+			int times, Object... arguments) throws RemoteException {
+
+		if (index < host.length) {
+			Thread t = threadedExecute(obj, times, arguments);
+			PropagableExecutor client;
+			try {
+				client = (PropagableExecutor) LocateRegistry.getRegistry(
+						host[index], Net.getRegistryPort()).lookup(
+						CLIENT_SERVICE_NAME);
+				client.execute(host, index + 1, obj, times, arguments);
+			} catch (AccessException e) {
+				throw new RemoteException(e.getMessage());
+			} catch (NotBoundException e) {
+				throw new RemoteException(e.getMessage());
+			}
+			if (t.isAlive()) {
+				try {
+					t.join();
+				} catch (InterruptedException e) {
+					log
+							.info("Execute finish with a InterruptedException, when wait the excute finish");
+				}
+			}
+		} else {
+			execute(obj, times, arguments);
+		}
+		return true;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/PropagableExecutorImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutor.java Tue May 16 06:51:00 2006
@@ -0,0 +1,59 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Provides the methods for implements remote execution. 
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public interface RemoteExecutor extends ITCRemote {
+
+	/**
+	 * A generic method that receives a <code>ServerExecutor</code> 
+	 * a number of executions and an arbitrary number of arguments 
+	 * and return a generic object.
+	 *  
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of arguments
+	 * @return a generic object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(ServerExecutor obj, int times, Object... arguments)
+			throws RemoteException;
+
+	/**
+	 * A generic method that receives a <code>ServerExecutor</code> 
+	 * a number of executions and an arbitrary number of arguments 
+	 * and return a thread.
+	 *  
+	 * @param ser a <code>ServerExecutor</code>
+	 * @param times of the executions 
+	 * @param arguments an arbitrary number of arguments
+	 * @return a thread
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Thread threadedExecute(final ServerExecutor ser, final int times,
+			final Object... arguments) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutorImpl.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutorImpl.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutorImpl.java Tue May 16 06:51:00 2006
@@ -0,0 +1,121 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.RemoteException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.ITCRemoteUnicast;
+
+/**
+ * Implementation of the <code>RemoteExecutor<code>.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class RemoteExecutorImpl extends ITCRemoteUnicast implements
+		RemoteExecutor {
+
+	/**
+	 * Version number unique identificator.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public RemoteExecutorImpl() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Constructs a <code>RemoteExecutorImpl</code> using 
+	 * a particular supplied port.
+	 * 
+	 * @param port the port number on which the remote object receives 
+	 * calls  
+	 * @throws RemoteException if failed to export object
+	 */
+	public RemoteExecutorImpl(int port) throws RemoteException {
+		super(port);
+	}
+
+	/**
+	 * Constructs a <code>RemoteExecutorImpl</code> using 
+	 * a particular supplied port and socket factories.
+	 * 
+	 * @param port the port number on which the remote object receives 
+	 * calls 
+	 * @param csf the client-side socket factory for making calls to 
+	 * the remote object
+	 * @param ssf the server-side socket factory for receiving remote 
+	 * calls
+	 * @throws RemoteException if failed to export object
+	 */
+	public RemoteExecutorImpl(int port, RMIClientSocketFactory csf,
+			RMIServerSocketFactory ssf) throws RemoteException {
+		super(port, csf, ssf);
+	}
+
+	/**
+	 * Executes an object a specified number of times.
+	 *  
+	 * @param obj a <code>ServerExecutor</code>
+	 * @param times of the executions
+	 * @param arguments an arbitrary number of hosts
+	 * @return a result of the execution
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(ServerExecutor obj, int times, Object... arguments)
+			throws RemoteException {
+		if (!imInServer()) {
+			System.out.println("Excecuting execute");
+		}
+		for (int i = 0; i < times - 1; i++) {
+			obj.execute(arguments);
+		}
+		return obj.execute(arguments);
+	}
+
+	/**
+	 * Executes an object in a thread.
+	 * 
+	 * @param ser a <code>ServerExecutor</code>
+	 * @param times of the executions 
+	 * @param arguments an arbitrary number of hosts
+	 * @return a thread
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Thread threadedExecute(final ServerExecutor ser, final int times,
+			final Object... arguments) throws RemoteException {
+		Thread t = new Thread() {
+			public void run() {
+				try {
+					execute(ser, times, arguments);
+				} catch (RemoteException e) {
+					e.printStackTrace();
+				}
+			}
+		};
+		t.start();
+		return t;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/RemoteExecutorImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIP.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIP.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIP.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIP.java Tue May 16 06:51:00 2006
@@ -0,0 +1,58 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Provides several methods for managing a client-host collection.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public interface ReportIP extends Remote {
+
+	/**
+	 * A constant string that represents the name of an object to bind.
+	 */
+	public String BIND_NAME = "REPORT_IP_SERVER";
+
+	/**
+	 * Constructs a collection with client-hosts IP´s.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public void report() throws RemoteException;
+
+	/**
+	 * Returns a client-host IP of the collection.
+	 * 
+	 * @return a client-host IP
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String[] getIP() throws RemoteException;
+
+	/**
+	 * Returns the host name if the service is activated.
+	 * 
+	 * @return the host name
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String myHostName() throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIP.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPException.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPException.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPException.java Tue May 16 06:51:00 2006
@@ -0,0 +1,60 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.RemoteException;
+
+/**
+ * Defines the constructors for the <code>ReportIPException</code>
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class ReportIPException extends RemoteException {
+
+	/**
+	 * Version number unique identificator.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	public ReportIPException() {
+		super();
+	}
+
+	/**
+	 * Sets the message of the exception.
+	 * 
+	 * @param s the exception message
+	 */
+	public ReportIPException(String s) {
+		super(s);
+	}
+
+	/**
+	 * Sets the message and the cause of the exception.
+	 * 
+	 * @param s the exception message
+	 * @param cause the exception cause
+	 */
+	public ReportIPException(String s, Throwable cause) {
+		super(s, cause);
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPException.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPServer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPServer.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPServer.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPServer.java Tue May 16 06:51:00 2006
@@ -0,0 +1,275 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.rmi.Naming;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.AbstractCollection;
+import java.util.Arrays;
+import java.util.TreeSet;
+import java.util.logging.Logger;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Manage the reporting of IP´s and host name of the servers.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class ReportIPServer extends UnicastRemoteObject implements ReportIP {
+
+	/**
+	 * For log purpose. 
+	 */
+	transient private final static Logger log = Logger
+			.getLogger("ar.org.fitc.test.rmi.integration.fase2.executor");
+
+	/**
+	 * Version number unique identificator.
+	 */
+	private static final long serialVersionUID = 8197377575540620278L;
+
+	/**
+	 * The server-host IP. 
+	 */
+	protected static String SERVER_HOST = "10.100.2.230";
+
+	/**
+	 * A <code>TreeSet</code> of client-host IP´s. 
+	 */
+	protected AbstractCollection<String> listIP = new TreeSet<String>();
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException if the exportation fails
+	 */
+	public ReportIPServer() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Constructs a <code>ReportIPServer</code> using a particular 
+	 * supplied port.
+	 * 
+	 * @param port the port number on which the remote object receives 
+	 * calls  
+	 * @throws RemoteException if failed to export object
+	 */
+	public ReportIPServer(int port) throws RemoteException {
+		super(port);
+	}
+
+	/**
+	 * Constructs a <code>ReportIPServer</code> using a particular 
+	 * supplied port and socket factories.
+	 * 
+	 * @param port the port number on which the remote object receives 
+	 * calls 
+	 * @param csf the client-side socket factory for making calls to 
+	 * the remote object
+	 * @param ssf the server-side socket factory for receiving remote 
+	 * calls
+	 * @throws RemoteException if failed to export object
+	 */
+	public ReportIPServer(int port, RMIClientSocketFactory csf,
+			RMIServerSocketFactory ssf) throws RemoteException {
+		super(port, csf, ssf);
+	}
+
+	/**
+	 * Constructs a collection with client-hosts IP´s.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public void report() throws RemoteException {
+		try {
+			synchronized (listIP) {
+				if (listIP.add(getClientHost())) {
+					listIP.notify();
+				}
+			}
+		} catch (ServerNotActiveException e) {
+			log.info("Report IP isn't working");
+		}
+	}
+
+	/**
+	 * Returns the host name if the service is activated.
+	 * 
+	 * @return the host name
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String myHostName() throws RemoteException {
+		try {
+			return getClientHost();
+		} catch (ServerNotActiveException e) {
+			return SERVER_HOST;
+		}
+	}
+
+	/**
+	 * Returns a client-host IP of the collection.
+	 * 
+	 * @return a client-host IP
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String[] getIP() throws RemoteException {
+		String[] result;
+
+		synchronized (listIP) {
+			listIP.notify();
+			try {
+				listIP.wait(1000);
+			} catch (InterruptedException e) {
+			}
+			result = listIP.toArray(new String[0]);
+		}
+		log.info("list of hosts: " + Arrays.toString(result));
+		return result;
+	}
+
+	/**
+	 * Sets the server-host with the specified name.
+	 * 
+	 * @param host the specified name
+	 * @throws UnknownHostException if the host cannot to be determined
+	 */
+	public static void setServerHost(String host) throws UnknownHostException {
+		InetAddress.getByName(host);
+		SERVER_HOST = host;
+	}
+
+	/**
+	 * For each client-host in the collection obtains a remote 
+	 * reference if fails removes the IP from the collection.   
+	 *
+	 * @throws InterruptedException if another thread interrupts the 
+	 * wait
+	 */
+	public void checkIP() throws InterruptedException {
+		synchronized (listIP) {
+			AbstractCollection<String> removeIP = new TreeSet<String>();
+
+			listIP.wait();
+			for (String ip : listIP) {
+				try {
+					((ITCRemote) ClientExecutor.getExecutor(ip)).getString();
+				} catch (Exception e) {
+					removeIP.add(ip);
+				}
+			}
+			for (String ip : removeIP) {
+				listIP.remove(ip);
+			}
+			listIP.notify();
+		}
+	}
+
+	/**
+	 * Obtains the <code>Registry</code> and a stub of the remote 
+	 * object bounded in the <code>Registry</code>. Puts the host name 
+	 * of the remote object in the collection.
+	 * 
+	 */
+	public static void doit() {
+		try {
+			Registry r = LocateRegistry.getRegistry(SERVER_HOST);
+
+			((ReportIP) r.lookup(BIND_NAME)).report();
+		} catch (RemoteException e) {
+			log.info("report has same problem: " + e.getMessage());
+		} catch (NotBoundException e) {
+			log.warning("report is not bound.");
+		}
+	}
+
+	/**
+	 * Obtains the <code>Registry</code> and a stub of the remote 
+	 * object bounded in the <code>Registry</code>. Returns the IP 
+	 * address.
+	 * 
+	 * @return the IP address
+	 * @throws ReportIPException if a non-catched exception occurs
+	 */
+	public static String[] getit() throws ReportIPException {
+		try {
+			Registry r = LocateRegistry.getRegistry(SERVER_HOST);
+			return ((ReportIP) r.lookup(BIND_NAME)).getIP();
+		} catch (RemoteException e) {
+			log.info("report has same problem: " + e.getMessage());
+		} catch (NotBoundException e) {
+			log.warning("report is not bound.");
+		}
+		throw new ReportIPException("Can't found report server");
+	}
+
+	/**
+	 * Obtains the <code>Registry</code> and a stub of the remote 
+	 * object bounded in the <code>Registry</code>. Returns the host 
+	 * name.
+	 * 
+	 * @return the host name
+	 * @throws ReportIPException if a non-catched exception occurs
+	 */
+	public static String localHost() throws ReportIPException {
+		try {
+			Registry r = LocateRegistry.getRegistry(SERVER_HOST);
+			return ((ReportIP) r.lookup(BIND_NAME)).myHostName();
+		} catch (RemoteException e) {
+			log.info("report has same problem: " + e.getMessage());
+		} catch (NotBoundException e) {
+			log.warning("report is not bound.");
+		}
+		throw new ReportIPException("Can't found report server");
+	}
+
+	public static void main(String[] argv) {
+
+		final ReportIPServer rep;
+		try {
+			rep = new ReportIPServer();
+			Naming.bind(BIND_NAME, rep);
+			System.out.print("ReportIPServer Start...");
+			new Thread() {
+				public void run() {
+					while (true) {
+						try {
+							rep.checkIP();
+						} catch (InterruptedException e) {
+							log.info("cheaking ip fail");
+						}
+					}
+				}
+			}.start();
+
+		} catch (Exception e) {
+			System.out.print("ReportIPServer no work: " + e.getMessage());
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ReportIPServer.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ServerExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ServerExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ServerExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ServerExecutor.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 ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Provides a generic method to execute an object
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public interface ServerExecutor extends ITCRemote {
+
+	/**
+	 * Receives an arbitrary number of arguments and return a generic 
+	 * object.
+	 * 
+	 * @param arguments an arbitrary number of arguments
+	 * @return a generic object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(Object... arguments) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/executor/ServerExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/interfaces/ITCRemote.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/interfaces/ITCRemote.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/interfaces/ITCRemote.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/interfaces/ITCRemote.java Tue May 16 06:51:00 2006
@@ -0,0 +1,66 @@
+/*
+ *  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.test.rmi.integration.fase2.clientExecutor.interfaces;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * Provides several methods for the implementation of objects used 
+ * in the series of tests.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public interface ITCRemote extends Remote {
+
+	/**
+	 * Removes the remote object from the RMI runtime.
+	 * 
+	 * @param force if <code>true</code>, unexports the object even 
+	 * if there are pending or in-progress calls
+	 * @return <code>truez/code> if operation is successful
+	 * @throws RemoteException if failed to unexport object
+	 */
+	public boolean clean(boolean force) throws RemoteException;
+
+	/**
+	 * Returns a clone of the remote object that is distinct 
+	 * from the original.
+	 * 
+	 * @return the new remote object 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public ITCRemote myClone() throws RemoteException;
+
+	/**
+	 * Inidicates if is working in the Server.
+	 * 
+	 * @return <code>true</code> if is working in the Server 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean imInServer() throws RemoteException;
+
+	/**
+	 * Returns a string that represents the value of this remote object.
+	 * 
+	 * @return a string representation of the object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String getString() throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/clientExecutor/interfaces/ITCRemote.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AbstractITCRemote.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AbstractITCRemote.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AbstractITCRemote.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AbstractITCRemote.java Tue May 16 06:51:00 2006
@@ -0,0 +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.test.rmi.integration.fase2.serverExecutor;
+
+import java.io.Serializable;
+import java.rmi.RemoteException;
+import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UnicastRemoteObject;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ReportIPServer;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Implentation of an <code>ITCRemote</code> object.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class AbstractITCRemote implements ITCRemote, Cloneable, Serializable {
+	
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 1324L;
+	
+	/**
+	 * Default constructor.
+	 *
+	 */
+	public AbstractITCRemote() {
+		super();
+	}
+	
+	/**
+	 * Removes the remote object from the RMI runtime.
+	 * 
+	 * @param force if <code>true</code>, unexports the object even 
+	 * if there are pending or in-progress calls
+	 * @return true if operation is successful
+	 * @throws RemoteException if failed to unexport object
+	 */
+	public boolean clean(boolean force) throws RemoteException {
+		return UnicastRemoteObject.unexportObject(this, force);
+	}
+	
+	/**
+	 * Returns a clone of the remote object that is distinct 
+	 * from the original.
+	 * 
+	 * @return the new remote object 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public ITCRemote myClone() throws RemoteException {
+		try {
+			return (ITCRemote) clone();
+		} catch (CloneNotSupportedException e) {
+			throw new RemoteException(e.getMessage());
+		}
+	}
+	
+	/**
+	 * Inidicates if is working in the Server.
+	 * 
+	 * @return <code>true</code> if is working in the Server 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public boolean imInServer() throws RemoteException {
+		try {
+			return UnicastRemoteObject.getClientHost().equals(ReportIPServer.localHost());
+		} catch (ServerNotActiveException e) {
+			// server no work, so i'm in the server. 
+			return true;
+		}
+	}
+	
+	/**
+	 * Returns a string that represents the value of this remote object.
+	 * 
+	 * @return a string representation of the object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public String getString() throws RemoteException {
+		return toString();
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AbstractITCRemote.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AutoBindITCRemoteUnicast.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AutoBindITCRemoteUnicast.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AutoBindITCRemoteUnicast.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AutoBindITCRemoteUnicast.java Tue May 16 06:51:00 2006
@@ -0,0 +1,130 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.net.MalformedURLException;
+import java.rmi.Naming;
+import java.rmi.NoSuchObjectException;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.ITCRemoteUnicast;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.ServerExecutor;
+
+/**
+ * Construct a <code>AutoBindITCRemoteUnicast</code> and automatically 
+ * bind it.
+ *
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class AutoBindITCRemoteUnicast extends ITCRemoteUnicast implements ServerExecutor, Serializable {
+
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 2L;
+	
+	/**
+	 * A constant string that represents the name of an object to bind.
+	 */
+	public final static String BIND_NAME ="HIHIHIHI";  
+	
+	/**
+	 * The default constructor.
+	 * 
+	 * @throws RemoteException if registry could not be contacted 
+	 */
+	public AutoBindITCRemoteUnicast() throws RemoteException {
+		super();
+		try {
+			Naming.rebind(BIND_NAME, this);
+		} catch (MalformedURLException e) {
+		}
+	}
+	
+	/**
+	 * Removes the remote object from the RMI runtime.
+	 * 
+	 * @param force if <code>true</code>, unexports the object even 
+	 * if there are pending or in-progress calls
+	 * @return true if operation is successful
+	 * @throws RemoteException if failed to unexport object
+	 */
+	public boolean clean(boolean force) throws RemoteException {
+		return unexportObject(this, force);
+	}
+
+	/**
+	 * Returns a reference, a stub, for the remote object associated 
+	 * with the specified name. 
+	 * 
+	 * @param arguments not used here
+	 * @return a reference for a remote object 
+	 * @throws RemoteException if registry could not be contacted 
+	 */
+	public Object execute(Object... arguments) throws RemoteException {
+		try {
+			return Naming.lookup(BIND_NAME);
+		} catch (MalformedURLException e) {
+		} catch (RemoteException e) {
+		} catch (NotBoundException e) {
+		}
+		return null;
+	}
+	
+	/**
+	 * Writes the non-static and non-transient fields of the current 
+	 * class to the stream.
+	 * 
+	 * @param out the <code>ObjectOutputStream</code>
+	 * @throws IOException if an I/O error occurs while writing 
+	 * the stream  
+	 */
+	private void writeObject(ObjectOutputStream out) throws IOException {
+        out.defaultWriteObject();
+    }
+	
+	/**
+	 * Reads the non-static and non-transient fields of the current 
+	 * class from the stream.
+	 * 
+	 * @param in the <code>ObjectInputStream</code>
+	 * @throws IOException IOException if an I/O error occurs while 
+	 * reading the stream  
+	 * @throws ClassNotFoundException if the class of a serialized 
+	 * object could not be found
+	 */
+	private void readObject(ObjectInputStream in) throws IOException,
+    	ClassNotFoundException {
+		in.defaultReadObject();
+		try {
+			toStub(this);
+		} catch(NoSuchObjectException e) {
+			exportObject(this, 10203);
+		}
+		try {
+			Naming.rebind(BIND_NAME, this);
+		} catch (MalformedURLException e) {
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/AutoBindITCRemoteUnicast.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/GCRemote.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/GCRemote.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/GCRemote.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/GCRemote.java Tue May 16 06:51:00 2006
@@ -0,0 +1,138 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor;
+
+import java.lang.ref.WeakReference;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ClientExecutor;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ReportIPException;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ReportIPServer;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.AbstractServerExecutor;
+
+/**
+ * Forces the remote execution of garbage collector.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class GCRemote extends AbstractServerExecutor {
+
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 *	 
+	 * @throws RemoteException if the remote operation fail
+	 */
+	public GCRemote() throws RemoteException {
+		super();	
+	}
+
+	/**
+	 * Creates a <code>WeakReference</code> and forces garbage 
+	 * collection for this <code>WeakReference</code>.
+	 * 
+	 */
+	@SuppressWarnings("unchecked")
+	public static void forceGC() {
+		WeakReference ref = new WeakReference(new Integer(234523));
+		forceGC(ref);
+	}
+	
+	/**
+	 * Forces garbage collection while the <code>WeakReference</code> 
+	 * received will not to be null.
+	 *  
+	 * @param ref the specified <code>WeakReference</code>
+	 */
+	public static void forceGC(WeakReference ref) {
+		while (ref.get() != null) {
+			System.gc();
+		}
+	}
+	
+	/**
+	 * In each host reported executes a <code>GCRemote</code> 
+	 * object. It forces remotely the garbage collection.
+	 * 
+	 */
+	public static void forceRemoteGC() {
+		try {
+			String[] hosts = ReportIPServer.getit();
+			for (final String host: hosts) {	
+				ClientExecutor.getExecutor(host).execute(new GCRemote(), 1);
+			}
+		} catch (ReportIPException e) {
+			e.printStackTrace();
+		} catch (RemoteException e) {
+			e.printStackTrace();
+		} catch (NotBoundException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * In each host reported executes a <code>GCRemote</code> 
+	 * object. It forces remotely the garbage collection for a 
+	 * specified <code>WeakReference</code>.
+	 * 
+	 * @param ref the specified <code>WeakReference</code>.
+	 */
+	public static void forceRemoteGC(WeakReference ref) {
+		try {
+			String[] hosts = ReportIPServer.getit();
+			for (final String host: hosts) {
+					ClientExecutor.getExecutor(host).execute(new GCRemote(), 0, ref.get());
+			}
+		} catch (ReportIPException e) {
+			e.printStackTrace();
+		} catch (RemoteException e) {
+			e.printStackTrace();
+		} catch (NotBoundException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * Forces garbage collection. If an argument is an instance of 
+	 * <code>ITCRemote<code> creates a <code>WeakReference</code> 
+	 * to it. 
+	 * 
+	 * @param arguments it can be a <code>ITCRemote</code> object
+	 * @return a <code>null</code> value
+	 * @throws RemoteException if the remote operation fails 
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public Object execute(Object... arguments) throws RemoteException {
+		if (arguments.length > 0 && arguments[0] instanceof ITCRemote) {
+			WeakReference ref = new WeakReference(arguments[0]);
+			arguments = null;
+			forceGC(ref);
+		} else {
+			forceGC();
+		}
+		return null;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/GCRemote.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/LogRemoteImpl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/LogRemoteImpl.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/LogRemoteImpl.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/LogRemoteImpl.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 ar.org.fitc.test.rmi.integration.fase2.serverExecutor;
+
+import java.rmi.RemoteException;
+import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UnicastRemoteObject;
+
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.interfaces.LogRemote;
+
+/**
+ * Implementation of <code>LogRemote</code> interface.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0
+ */
+public class LogRemoteImpl extends AbstractITCRemote implements LogRemote {
+
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 1L;
+	
+	/**
+	 * Simple cyclic reference.
+	 */
+	public LogRemote out;
+	
+	/**
+	 * Simple int to number the funtion calls.
+	 */
+	int i = 0;
+
+	/**
+	 * Default constructor. 
+	 *
+	 */
+	public LogRemoteImpl() {
+		super();
+	}
+	
+	/**
+	 * Constructs a <code>LogRemoteImpl</code> with a cyclic reference. 
+	 * 
+	 * @param stub a reference for the remote object 
+	 */
+	public LogRemoteImpl(LogRemote stub) {
+		super();
+		out = stub;
+	}
+
+	/**
+	 * Prints a string representation of the client host. Indicates if 
+	 * is a local o remote execution.
+	 * 
+	 * @param arg a string that indicates if is a local or remote
+	 * execution
+	 * @throws RemoteException if the remote operation fails 
+	 */
+	public void println(String arg) throws RemoteException {
+		i++;
+		try {
+			System.out.println("\t\t" + i + " " + UnicastRemoteObject.getClientHost() + ": " + arg);
+			
+		} catch (ServerNotActiveException e) {
+			System.out.println("\t\t" + i + " Localhost: " + arg);
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/LogRemoteImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/MoveRemoteObject.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/MoveRemoteObject.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/MoveRemoteObject.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/MoveRemoteObject.java Tue May 16 06:51:00 2006
@@ -0,0 +1,74 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.AbstractServerExecutor;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.interfaces.LogRemote;
+
+/**
+ * Moves references of remote objects.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class MoveRemoteObject extends AbstractServerExecutor {
+
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 3L;
+
+	/**
+	 * Must initialize a <code>LogRemote</code>.
+	 */
+	public LogRemote obj;
+	
+	/**
+	 * Constructs a <code>MoveRemoteObject</code> with a <code>
+	 * LogRemote</code>.
+	 *  
+	 * @param containt a <code>LogRemote</code> object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public MoveRemoteObject(LogRemote containt) throws RemoteException {
+		super();
+		obj = containt;
+	}
+
+	/**
+	 * Indicates if is a local o remote execution.
+	 * 
+	 * @param arguments not uses here
+	 * @return a <code>null</code> value
+	 * @throws RemoteException if a remote operation fails
+	 */
+	@Override
+	public Object execute(Object... arguments) throws RemoteException {
+		try {
+			Thread.sleep(100);
+		} catch (InterruptedException e) {}
+		if (obj.imInServer()) {
+			obj.println("local run");
+		} else {
+			obj.println("remote run");
+		}
+		return null;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/MoveRemoteObject.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/PropagableTestRemote.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/PropagableTestRemote.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/PropagableTestRemote.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/PropagableTestRemote.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 ar.org.fitc.test.rmi.integration.fase2.serverExecutor;
+
+import java.io.PrintStream;
+import java.rmi.RemoteException;
+import java.rmi.server.ServerNotActiveException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.ITCRemoteUnicast;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.ServerExecutor;
+
+/**
+ * For tests and reports purpose.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0
+ */
+public class PropagableTestRemote extends ITCRemoteUnicast implements ServerExecutor {
+	
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 1L;
+	
+	/**
+	 * Adds functionality to the <code>System.out</code>.
+	 */	
+	transient PrintStream out = System.out;
+	
+	/**
+	 * Simple counter.
+	 */
+	int i = 0;
+	
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException if the remote operation fail
+	 */
+	public PropagableTestRemote() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Notices the status of the ClientHost. Used in the ok case.
+	 * 
+	 * @return a <code>true</code> value
+	 */
+	public Object ok() {
+		try {
+			out.println("\t\tHost " + getClientHost() + " work well");
+		} catch (ServerNotActiveException e) {
+		}
+		return true;
+	}
+	
+	/**
+	 * Notices the status of the ClientHost. Used in the failed case.
+	 * 
+	 * @param host the specified host name
+	 * @return a <code>false</code> value
+	 */
+	public Object fail(String host) {
+		try {
+			out.println("\t\tHost " + getClientHost() + " don't work, this host wasn't " + host);
+		} catch (ServerNotActiveException e) {
+		}
+		return false;
+	}
+		
+	/**
+	 * Tests the hosts status.
+	 * 
+	 * @param arguments an arbitrary number of hosts
+	 * @return a boolean value
+	 * @throws RemoteExcpetion if the remote operation fails
+	 */
+	public Object execute(Object... arguments) throws RemoteException {
+		String host;
+		String client;
+		
+		if ((Integer)arguments[0] > 1) {
+			host = (String) arguments[i++];
+		} else {
+			host = (String) arguments[1];
+		}
+		try {
+			client = getClientHost();
+		} catch (ServerNotActiveException e) {
+			client = System.getProperty("java.rmi.server.hostname");
+		}
+		if (host.equals(client)) {
+			out.println("\t\tHost " + client + " work well");
+			return true;
+		} else {
+			out.println("\t\tHost " + client + " don't work, this host wasn't " + host);
+			return false;
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/PropagableTestRemote.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/AbstractServerExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/AbstractServerExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/AbstractServerExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/AbstractServerExecutor.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 ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ServerExecutor;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.AbstractITCRemote;
+
+/**
+ * Abstract class that define the execute method.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public abstract class AbstractServerExecutor extends AbstractITCRemote implements ServerExecutor {
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public AbstractServerExecutor() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Receives an arbitrary number of arguments and returns a generic 
+	 * object. 
+	 * 
+	 * @param arguments an arbitrary number of arguments 
+	 * @return a generic object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	abstract public Object execute(Object... arguments) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/AbstractServerExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/ServerExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/ServerExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/ServerExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/ServerExecutor.java Tue May 16 06:51:00 2006
@@ -0,0 +1,42 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor.executor;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Provides the <code>execute</code> method that receives an arbitrary 
+ * number of arguments.  
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0
+ */
+public interface ServerExecutor extends ITCRemote {
+	
+	/**
+	 * Receives an arbitrary number of arguments and returns a generic 
+	 * object.
+	 * 
+	 * @param arguments an arbitrary number of arguments
+	 * @return a generic object
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public Object execute(Object... arguments) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/executor/ServerExecutor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/interfaces/LogRemote.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/interfaces/LogRemote.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/interfaces/LogRemote.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/interfaces/LogRemote.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 ar.org.fitc.test.rmi.integration.fase2.serverExecutor.interfaces;
+
+import java.rmi.RemoteException;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+
+/**
+ * Provides a method for the implementation of objects used 
+ * in the series of tests.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0
+ */
+public interface LogRemote extends ITCRemote {
+	
+	/**
+	 * Prints a string representation of the client host.
+	 *  
+	 * @param arg a string that indicate if is a local or remote 
+	 * execution
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public void println(String arg) throws RemoteException;
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/interfaces/LogRemote.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/main/StartUp.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/main/StartUp.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/main/StartUp.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/main/StartUp.java Tue May 16 06:51:00 2006
@@ -0,0 +1,110 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor.main;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.UnknownHostException;
+import java.rmi.RemoteException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ReportIPException;
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.executor.ReportIPServer;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.DGCTestCase;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.ITCTestCase;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.PortableTestCase;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.PropagableTestCase;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.RemoteRegistryTestCase;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.test.ReportIPTestCase;
+
+/**
+ * Sets the properties for the start up.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0
+ */
+public class StartUp extends ITCTestCase {
+
+	/**
+	 * Indicates the number of <code>ClientExecutor</code>'s.
+	 */
+	public static int numberOfClientExecutor = 1;
+
+	public static void main(String[] arg) throws RemoteException  {
+		System.setProperty("java.rmi.server.codebase",
+						"ftp://proftp:1@10.100.2.230/");
+		System.setProperty("java.rmi.server.hostname", "10.100.2.230");
+		
+		
+		Logger.getLogger("ar.org.fitc.test.rmi.integration.fase2.executor").setLevel(Level.OFF);
+
+		try {
+			{
+				String n = System.getProperty("ar.org.fitc.test.numbreofclientexecutor");
+				if (n != null) {
+					numberOfClientExecutor = Integer.parseInt(n);
+				}
+			}
+						
+			try {//litle test at begins
+				URLClassLoader cl = new URLClassLoader(new URL[] {new URL(System.getProperty("java.rmi.server.codebase"))});
+				cl.loadClass(StartUp.class.getName());
+			} catch (ClassNotFoundException e){
+				fail("The java.rmi.server.codebase property is bad set");
+			} catch (MalformedURLException e) {
+				fail("The java.rmi.server.codebase property is bad set");
+			}
+			
+			
+			initRegistry();
+			
+			try {
+				ReportIPServer.setServerHost(System.getProperty("java.rmi.server.hostname"));
+			} catch (UnknownHostException e) {
+				fail("The java.rmi.server.hostname property is bad set");
+			}
+			ReportIPServer.main(null);
+				
+			try {
+				do {
+					System.out.print(".");
+					try {
+						Thread.sleep(2000);
+					} catch (InterruptedException e) {
+					}
+				} while (ReportIPServer.getit().length < numberOfClientExecutor);
+			} catch (ReportIPException e) {
+				fail("The ReportIP fail with: " + e);
+			}
+			System.out.println();
+
+			
+			new ReportIPTestCase().run();
+			new RemoteRegistryTestCase().run();
+			new PropagableTestCase().run();
+			new PortableTestCase().run();
+			new DGCTestCase().run();
+					
+		} finally {
+			// Forsing finish
+			System.exit(0);
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/main/StartUp.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExecutorGetClientHost.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExecutorGetClientHost.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExecutorGetClientHost.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExecutorGetClientHost.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 ar.org.fitc.test.rmi.integration.fase2.serverExecutor.remoteexport;
+
+import java.rmi.RemoteException;
+import java.rmi.server.ServerNotActiveException;
+import java.rmi.server.UnicastRemoteObject;
+
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.AbstractServerExecutor;
+
+/**
+ * Particular implementation of <code>AbstractServerExecutor</code>.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ *
+ * @version 1.0 
+ */
+public class ExecutorGetClientHost extends AbstractServerExecutor {
+
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default cosntructor.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public ExecutorGetClientHost() throws RemoteException {
+		super();
+	}
+
+	/**
+	 * Returns a host address. 
+	 * 
+	 * @param arguments not used here
+	 * @return an host address 
+	 * @throws RemoteException if the remote operation fails 
+	 */
+	@Override
+	public Object execute(Object... arguments) throws RemoteException {
+		try {
+			return UnicastRemoteObject.getClientHost();
+		} catch (ServerNotActiveException e) {
+			return "127.0.0.1";
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExecutorGetClientHost.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExportServiceExecutor.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExportServiceExecutor.java?rev=406944&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExportServiceExecutor.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExportServiceExecutor.java Tue May 16 06:51:00 2006
@@ -0,0 +1,72 @@
+/*
+ *  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.test.rmi.integration.fase2.serverExecutor.remoteexport;
+
+import java.rmi.RemoteException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.UnicastRemoteObject;
+
+import ar.org.fitc.test.rmi.integration.fase2.clientExecutor.interfaces.ITCRemote;
+import ar.org.fitc.test.rmi.integration.fase2.serverExecutor.executor.AbstractServerExecutor;
+
+/**
+ * Particular implementation of <code>AbstractServerExecutor</code>.
+ * 
+ * @author Jorge Rafael
+ * @author Marcelo Arcidiacono
+ * 
+ * @version 1.0
+ */
+public class ExportServiceExecutor extends AbstractServerExecutor {
+	
+	/**
+	 * Version number unique identificator.
+	 */	
+	private static final long serialVersionUID = 2L;
+
+	/**
+	 * Default cosntructor.
+	 * 
+	 * @throws RemoteException if the remote operation fails
+	 */
+	public ExportServiceExecutor() throws RemoteException {
+		super();
+	}
+	
+	/**
+	 * Exports an <code>ITCRemote</code> object.
+	 * 
+	 * @param arguments can be a <code>ITCRemote</code> object, a port 
+	 * and socket factories as well in this order
+	 * @return return a remote object stub or <code>null</code> value
+	 * @throws RemoteException if the exporation fails
+	 */
+	@Override
+	public Object execute(Object... arguments) throws RemoteException {
+		int argumentCount = ((Integer) arguments[0]).intValue();
+		switch(argumentCount) {
+		case (1) :
+			return UnicastRemoteObject.exportObject((ITCRemote)arguments[1]);
+		case (2) :
+			return UnicastRemoteObject.exportObject((ITCRemote)arguments[1], ((Integer) arguments[2]).intValue());
+		case (4) :
+			return UnicastRemoteObject.exportObject((ITCRemote)arguments[1], ((Integer) arguments[2]).intValue(), (RMIClientSocketFactory)arguments[3], (RMIServerSocketFactory)arguments[4]);
+		default:
+			return null;
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/rmi2/src/ar/org/fitc/test/rmi/integration/fase2/serverExecutor/remoteexport/ExportServiceExecutor.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message