[or-cvs] r15617: do the move (in puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi: . impl)

sebastian at seul.org sebastian at seul.org
Thu Jul 3 06:13:12 UTC 2008


Author: sebastian
Date: 2008-07-03 02:13:12 -0400 (Thu, 03 Jul 2008)
New Revision: 15617

Added:
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractPuppeTorMasterFactory.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTorMaster.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImpl.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImplFactory.java
Removed:
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractRemotePuppeTorFactory.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTor.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImpl.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImplFactory.java
Log:
do the move

Copied: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractPuppeTorMasterFactory.java (from rev 15616, puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractRemotePuppeTorFactory.java)
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractPuppeTorMasterFactory.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractPuppeTorMasterFactory.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi;
+
+import java.rmi.RemoteException;
+
+/**
+ * Create a new representation of the server. Initialize this once with a
+ * concrete subclass of itself to create the actual <code>RemotePuppeTor</code>
+ * instance.
+ *
+ * @author Sebastian Hahn
+ */
+public abstract class AbstractPuppeTorMasterFactory {
+
+    /**
+     * Hold the concrete RemotePuppeTorFactory that will be used to create
+     * <code>RemotePuppeTor</code> instances. Uses
+     * <code>AbstractRemotePuppeTorFactory.class</code> for locking.
+     */
+    private static AbstractPuppeTorMasterFactory factory;
+
+    /**
+     * @return a new concrete
+     *         <code>AbstractRemotePuppeTorFactory<code>subclass as
+     *     specified by the initialization
+     */
+    final public synchronized static AbstractPuppeTorMasterFactory getInstance() {
+        return factory;
+    }
+
+    /**
+     * @param factory
+     *            save this as the factory if this hasn't been called before.
+     */
+    final public synchronized static void initialize(
+            final AbstractPuppeTorMasterFactory factory) {
+        if (AbstractPuppeTorMasterFactory.factory == null) {
+            AbstractPuppeTorMasterFactory.factory = factory;
+        }
+    }
+
+    /**
+     * Override this to create a subclass of <code>RemotePuppeTor</code>
+     *
+     * @param slave
+     *            Create the server represantation for this connected slave
+     * @return The new <code>RemotePuppeTor</code> instance
+     */
+    public abstract RemotePuppeTorMaster createRemotePuppeTor(PuppeTorSlave slave)
+            throws RemoteException;
+}

Deleted: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractRemotePuppeTorFactory.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractRemotePuppeTorFactory.java	2008-07-03 06:08:49 UTC (rev 15616)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/AbstractRemotePuppeTorFactory.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2008, Sebastian Hahn
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- *     * Neither the names of the copyright owners nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package de.uniba.wiai.lspi.puppetor.rmi;
-
-import java.rmi.RemoteException;
-
-/**
- * Create a new representation of the server. Initialize this once with a
- * concrete subclass of itself to create the actual <code>RemotePuppeTor</code>
- * instance.
- *
- * @author Sebastian Hahn
- */
-public abstract class AbstractPuppeTorMasterFactory {
-
-    /**
-     * Hold the concrete RemotePuppeTorFactory that will be used to create
-     * <code>RemotePuppeTor</code> instances. Uses
-     * <code>AbstractRemotePuppeTorFactory.class</code> for locking.
-     */
-    private static AbstractPuppeTorMasterFactory factory;
-
-    /**
-     * @return a new concrete
-     *         <code>AbstractRemotePuppeTorFactory<code>subclass as
-     *     specified by the initialization
-     */
-    final public synchronized static AbstractPuppeTorMasterFactory getInstance() {
-        return factory;
-    }
-
-    /**
-     * @param factory
-     *            save this as the factory if this hasn't been called before.
-     */
-    final public synchronized static void initialize(
-            final AbstractPuppeTorMasterFactory factory) {
-        if (AbstractPuppeTorMasterFactory.factory == null) {
-            AbstractPuppeTorMasterFactory.factory = factory;
-        }
-    }
-
-    /**
-     * Override this to create a subclass of <code>RemotePuppeTor</code>
-     *
-     * @param slave
-     *            Create the server represantation for this connected slave
-     * @return The new <code>RemotePuppeTor</code> instance
-     */
-    public abstract RemotePuppeTorMaster createRemotePuppeTor(PuppeTorSlave slave)
-            throws RemoteException;
-}

Deleted: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTor.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTor.java	2008-07-03 06:08:49 UTC (rev 15616)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTor.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2008, Sebastian Hahn
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- *     * Neither the names of the copyright owners nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package de.uniba.wiai.lspi.puppetor.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * <code>RemotePuppeTor</code> is the main interface that drives the
- * interaction between the interconnected master and its slave instances. It is
- * published by the master's instance, and represents the view of the master a
- * slave has. It provides ways for the slave to register a
- * <code>PuppeTorSlave</code> to provide information about its capabilities,
- * as well as a way for the slave to poll the master for new work and then
- * report back results. XXX We will need a way to allow the master to access
- * this, as well as a way for clients with open ports to register for callback
- * support instead of polling for new tasks =SH
- *
- * @author Sebastian Hahn
- */
-public interface RemotePuppeTorMaster extends Remote {
-
-    /**
-     * Slaves that must poll because they are not reachable can use this method
-     * to ask the master for new work.
-     *
-     * @throws RemoteException
-     *             RMI...
-     */
-    public PuppeTorTest getNewJob() throws RemoteException;
-
-    /**
-     * XXX We want the slaves to report back when they have an update for the
-     * master-SH
-     *
-     * @param jobResult
-     * @throws RemoteException
-     *
-     * public void reportResults(PuppeTorTestResult testResult) throws
-     * RemoteException;
-     */
-}

Copied: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTorMaster.java (from rev 15616, puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTor.java)
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTorMaster.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/RemotePuppeTorMaster.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * <code>RemotePuppeTor</code> is the main interface that drives the
+ * interaction between the interconnected master and its slave instances. It is
+ * published by the master's instance, and represents the view of the master a
+ * slave has. It provides ways for the slave to register a
+ * <code>PuppeTorSlave</code> to provide information about its capabilities,
+ * as well as a way for the slave to poll the master for new work and then
+ * report back results. XXX We will need a way to allow the master to access
+ * this, as well as a way for clients with open ports to register for callback
+ * support instead of polling for new tasks =SH
+ *
+ * @author Sebastian Hahn
+ */
+public interface RemotePuppeTorMaster extends Remote {
+
+    /**
+     * Slaves that must poll because they are not reachable can use this method
+     * to ask the master for new work.
+     *
+     * @throws RemoteException
+     *             RMI...
+     */
+    public PuppeTorTest getNewJob() throws RemoteException;
+
+    /**
+     * XXX We want the slaves to report back when they have an update for the
+     * master-SH
+     *
+     * @param jobResult
+     * @throws RemoteException
+     *
+     * public void reportResults(PuppeTorTestResult testResult) throws
+     * RemoteException;
+     */
+}

Copied: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImpl.java (from rev 15616, puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImpl.java)
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImpl.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImpl.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.impl;
+
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.rmi.server.Unreferenced;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentHashMap;
+
+import de.uniba.wiai.lspi.puppetor.rmi.CreateNetwork;
+import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorMaster;
+import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorSlave;
+import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorTest;
+
+/**
+ * Represent the master at the slave, and give the master a way to interact with
+ * the respective slave.
+ *
+ * @author Sebastian Hahn
+ */
+public class PuppeTorMasterImpl extends UnicastRemoteObject implements
+        PuppeTorMaster, Unreferenced {
+
+    /**
+     * Required for serialization. Needs to change for new released versions.
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Store the reference to the connected slave
+     */
+    private final PuppeTorSlave slave;
+
+    /**
+     * We store all the connected <code>PuppeTorSlave</code>s here. Make sure
+     * the key is never null.
+     */
+    private static final ConcurrentMap<String, PuppeTorSlave> slaves =
+            new ConcurrentHashMap<String, PuppeTorSlave>();
+
+    /**
+     * Check the slave object for validity and save it for further reference
+     *
+     * @throws RemoteException
+     *             RMI
+     * @throws IllegalArgumentException
+     */
+    public PuppeTorMasterImpl(final PuppeTorSlave slave) throws RemoteException {
+        if (null != slaves.putIfAbsent(slave.getName(), slave)) {
+            throw new IllegalArgumentException(slave.getName()
+                    + " has already registered with this Server");
+        }
+        this.slave = slave;
+    }
+
+    /**
+     * XXX Currently, there is no logic to give back useful tasks, but if the
+     * client is known, a new <code>CreateNetwork</code> test is submitted.-SH
+     */
+    public PuppeTorTest getNewJob() throws RemoteException {
+        return new CreateNetwork();
+
+    }
+
+    // public void repoprtResults(final String slaveName,
+    // final PuppeTorTestResult jobResult) throws RemoteException {
+    // XXX We want to let the server know that the client did some work and
+    // how it turned out to be. -SH
+    // }
+
+    /**
+     * Remove the slave from the Map of slaves and destroy its workqueues.
+     * Inform the TestRunner that all still-running tests failed because the
+     * slave went away. XXX Don't just promise to do that - we actually have to
+     * do that when there are the queues that I mentioned.
+     */
+    public void unreferenced() {
+        slaves.remove(slave.getName());
+    }
+
+}

Copied: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImplFactory.java (from rev 15616, puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImplFactory.java)
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImplFactory.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/PuppeTorMasterImplFactory.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.impl;
+
+import java.rmi.RemoteException;
+import de.uniba.wiai.lspi.puppetor.rmi.AbstractPuppeTorMasterFactory;
+import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorSlave;
+import de.uniba.wiai.lspi.puppetor.rmi.RemotePuppeTorMaster;
+
+/**
+ * Create <code>RemotePuppeTorImpl</code> instances
+ *
+ * @author Sebastian Hahn
+ */
+public class PuppeTorMasterImplFactory extends AbstractPuppeTorMasterFactory {
+
+    /**
+     * @return a new <code>RemotePuppeTorImpl</code> instance.
+     */
+    @Override
+    public RemotePuppeTorMaster createRemotePuppeTor(final PuppeTorSlave slave)
+            throws RemoteException {
+        return new PuppeTorMasterImpl(slave);
+    }
+
+}

Deleted: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImpl.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImpl.java	2008-07-03 06:08:49 UTC (rev 15616)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImpl.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2008, Sebastian Hahn
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- *     * Neither the names of the copyright owners nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package de.uniba.wiai.lspi.puppetor.rmi.impl;
-
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-import java.rmi.server.Unreferenced;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-import de.uniba.wiai.lspi.puppetor.rmi.CreateNetwork;
-import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorMaster;
-import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorSlave;
-import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorTest;
-
-/**
- * Represent the master at the slave, and give the master a way to interact with
- * the respective slave.
- *
- * @author Sebastian Hahn
- */
-public class PuppeTorMasterImpl extends UnicastRemoteObject implements
-        PuppeTorMaster, Unreferenced {
-
-    /**
-     * Required for serialization. Needs to change for new released versions.
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Store the reference to the connected slave
-     */
-    private final PuppeTorSlave slave;
-
-    /**
-     * We store all the connected <code>PuppeTorSlave</code>s here. Make sure
-     * the key is never null.
-     */
-    private static final ConcurrentMap<String, PuppeTorSlave> slaves =
-            new ConcurrentHashMap<String, PuppeTorSlave>();
-
-    /**
-     * Check the slave object for validity and save it for further reference
-     *
-     * @throws RemoteException
-     *             RMI
-     * @throws IllegalArgumentException
-     */
-    public PuppeTorMasterImpl(final PuppeTorSlave slave) throws RemoteException {
-        if (null != slaves.putIfAbsent(slave.getName(), slave)) {
-            throw new IllegalArgumentException(slave.getName()
-                    + " has already registered with this Server");
-        }
-        this.slave = slave;
-    }
-
-    /**
-     * XXX Currently, there is no logic to give back useful tasks, but if the
-     * client is known, a new <code>CreateNetwork</code> test is submitted.-SH
-     */
-    public PuppeTorTest getNewJob() throws RemoteException {
-        return new CreateNetwork();
-
-    }
-
-    // public void repoprtResults(final String slaveName,
-    // final PuppeTorTestResult jobResult) throws RemoteException {
-    // XXX We want to let the server know that the client did some work and
-    // how it turned out to be. -SH
-    // }
-
-    /**
-     * Remove the slave from the Map of slaves and destroy its workqueues.
-     * Inform the TestRunner that all still-running tests failed because the
-     * slave went away. XXX Don't just promise to do that - we actually have to
-     * do that when there are the queues that I mentioned.
-     */
-    public void unreferenced() {
-        slaves.remove(slave.getName());
-    }
-
-}

Deleted: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImplFactory.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImplFactory.java	2008-07-03 06:08:49 UTC (rev 15616)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/impl/RemotePuppeTorImplFactory.java	2008-07-03 06:13:12 UTC (rev 15617)
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, Sebastian Hahn
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- *     * Neither the names of the copyright owners nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package de.uniba.wiai.lspi.puppetor.rmi.impl;
-
-import java.rmi.RemoteException;
-import de.uniba.wiai.lspi.puppetor.rmi.AbstractPuppeTorMasterFactory;
-import de.uniba.wiai.lspi.puppetor.rmi.PuppeTorSlave;
-import de.uniba.wiai.lspi.puppetor.rmi.RemotePuppeTorMaster;
-
-/**
- * Create <code>RemotePuppeTorImpl</code> instances
- *
- * @author Sebastian Hahn
- */
-public class PuppeTorMasterImplFactory extends AbstractPuppeTorMasterFactory {
-
-    /**
-     * @return a new <code>RemotePuppeTorImpl</code> instance.
-     */
-    @Override
-    public RemotePuppeTorMaster createRemotePuppeTor(final PuppeTorSlave slave)
-            throws RemoteException {
-        return new PuppeTorMasterImpl(slave);
-    }
-
-}



More information about the tor-commits mailing list