51 |
import java.rmi.ServerError; |
import java.rmi.ServerError; |
52 |
import java.rmi.server.ObjID; |
import java.rmi.server.ObjID; |
53 |
import java.rmi.server.UID; |
import java.rmi.server.UID; |
54 |
|
import java.util.Collections; |
55 |
|
import java.util.Map; |
56 |
import java.util.Hashtable; |
import java.util.Hashtable; |
57 |
|
import java.util.IdentityHashMap; |
58 |
|
|
59 |
public class UnicastServer |
public class UnicastServer |
60 |
implements ProtocolConstants { |
implements ProtocolConstants { |
61 |
|
|
62 |
static private Hashtable objects = new Hashtable(); //mapping OBJID to server ref |
static private Hashtable objects = new Hashtable(); //mapping OBJID to server ref |
63 |
static private Hashtable refcache = new Hashtable(); //mapping obj itself to server ref |
static private Map refcache = Collections.synchronizedMap(new IdentityHashMap()); //mapping obj itself to server ref |
64 |
static private DGCImpl dgc; |
static private DGCImpl dgc; |
65 |
|
|
66 |
public static void exportObject(UnicastServerRef obj) { |
public static void exportObject(UnicastServerRef obj) { |