river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sijs...@apache.org
Subject svn commit: r1389804 - in /river/jtsk/trunk/netbeans/federation/src/org/apache/river: examples/federation/Main.java federation/Federation.java
Date Tue, 25 Sep 2012 11:13:19 GMT
Author: sijskes
Date: Tue Sep 25 11:13:19 2012
New Revision: 1389804

URL: http://svn.apache.org/viewvc?rev=1389804&view=rev
Log:
added joinmgr

Modified:
    river/jtsk/trunk/netbeans/federation/src/org/apache/river/examples/federation/Main.java
    river/jtsk/trunk/netbeans/federation/src/org/apache/river/federation/Federation.java

Modified: river/jtsk/trunk/netbeans/federation/src/org/apache/river/examples/federation/Main.java
URL: http://svn.apache.org/viewvc/river/jtsk/trunk/netbeans/federation/src/org/apache/river/examples/federation/Main.java?rev=1389804&r1=1389803&r2=1389804&view=diff
==============================================================================
--- river/jtsk/trunk/netbeans/federation/src/org/apache/river/examples/federation/Main.java
(original)
+++ river/jtsk/trunk/netbeans/federation/src/org/apache/river/examples/federation/Main.java
Tue Sep 25 11:13:19 2012
@@ -29,7 +29,7 @@ public class Main
         launchClient();        
     }
 
-    private void launchServer()
+    private void launchServer() throws Exception
     {
         DemoServiceImpl dsi = new DemoServiceImpl();
         

Modified: river/jtsk/trunk/netbeans/federation/src/org/apache/river/federation/Federation.java
URL: http://svn.apache.org/viewvc/river/jtsk/trunk/netbeans/federation/src/org/apache/river/federation/Federation.java?rev=1389804&r1=1389803&r2=1389804&view=diff
==============================================================================
--- river/jtsk/trunk/netbeans/federation/src/org/apache/river/federation/Federation.java (original)
+++ river/jtsk/trunk/netbeans/federation/src/org/apache/river/federation/Federation.java Tue
Sep 25 11:13:19 2012
@@ -5,7 +5,17 @@
 
 package org.apache.river.federation;
 
+import java.io.IOException;
+import java.io.Serializable;
 import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.HashMap;
+import java.util.Map;
+import net.jini.config.Configuration;
+import net.jini.config.ConfigurationException;
+import net.jini.config.EmptyConfiguration;
+import net.jini.core.lookup.ServiceID;
+import net.jini.lookup.JoinManager;
 
 /**
  *
@@ -13,18 +23,47 @@ import java.rmi.Remote;
 public class Federation
 {
     private static Remote dummy;
-
+    
+    private static Map<Remote,JoinManager> joins = new HashMap<>();
+    
     public static void start()
     {
         //TODO
     }
 
-    public static void register(Remote svc)
+    public static class DummyServiceProxy 
+        implements Serializable
+    {
+
+        private DummyServiceProxy(Remote svc)
+        {
+        }
+
+    }
+    
+    public static void register(Remote svc) throws RemoteException, IOException, ConfigurationException
     {
         //TODO
         dummy = svc ;
+        
+        Configuration config = getConfiguration(svc);
+        
+        Object svcproxy = new DummyServiceProxy(svc); // TODO
+        
+        JoinManager joinMgr = new JoinManager(svcproxy,null,(ServiceID)null,null,null,config);
// TODO
+
+        joins.put( svc, joinMgr );
+    }
+
+    /**
+     * Debatable if whe need the service here.
+     */
+    private static Configuration getConfiguration(Remote svc)
+    {
+        return EmptyConfiguration.INSTANCE; // TODO 
     }
 
+
     @SuppressWarnings("unchecked")
     public static <T extends Remote> T lookup(Class<T> svcif)
     {



Mime
View raw message