src/share/classes/sun/rmi/transport/Target.java

Print this page

        

*** 51,63 **** /** dispatcher for remote object */ private volatile Dispatcher disp; /** stub for remote object */ private final Remote stub; /** set of clients that hold references to this target */ ! private final Vector refSet = new Vector(); /** table that maps client endpoints to sequence numbers */ ! private final Hashtable sequenceTable = new Hashtable(5); /** access control context in which target was created */ private final AccessControlContext acc; /** context class loader in which target was created */ private final ClassLoader ccl; /** number of pending/executing calls */ --- 51,64 ---- /** dispatcher for remote object */ private volatile Dispatcher disp; /** stub for remote object */ private final Remote stub; /** set of clients that hold references to this target */ ! private final Vector<VMID> refSet = new Vector<>(); /** table that maps client endpoints to sequence numbers */ ! private final Hashtable<VMID, SequenceEntry> sequenceTable = ! new Hashtable<>(5); /** access control context in which target was created */ private final AccessControlContext acc; /** context class loader in which target was created */ private final ClassLoader ccl; /** number of pending/executing calls */
*** 239,249 **** * to call back if the address space associated with the endpoint * dies. */ synchronized void referenced(long sequenceNum, VMID vmid) { // check sequence number for vmid ! SequenceEntry entry = (SequenceEntry) sequenceTable.get(vmid); if (entry == null) { sequenceTable.put(vmid, new SequenceEntry(sequenceNum)); } else if (entry.sequenceNum < sequenceNum) { entry.update(sequenceNum); } else { --- 240,250 ---- * to call back if the address space associated with the endpoint * dies. */ synchronized void referenced(long sequenceNum, VMID vmid) { // check sequence number for vmid ! SequenceEntry entry = sequenceTable.get(vmid); if (entry == null) { sequenceTable.put(vmid, new SequenceEntry(sequenceNum)); } else if (entry.sequenceNum < sequenceNum) { entry.update(sequenceNum); } else {
*** 278,288 **** * remove server from Transport's object table. */ synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong) { // check sequence number for vmid ! SequenceEntry entry = (SequenceEntry) sequenceTable.get(vmid); if (entry == null || entry.sequenceNum > sequenceNum) { // late clean call; ignore return; } else if (strong) { // strong clean call; retain sequenceNum --- 279,289 ---- * remove server from Transport's object table. */ synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong) { // check sequence number for vmid ! SequenceEntry entry = sequenceTable.get(vmid); if (entry == null || entry.sequenceNum > sequenceNum) { // late clean call; ignore return; } else if (strong) { // strong clean call; retain sequenceNum
*** 364,376 **** * Also, unregister all vmids referencing this target * so target can be gc'd. */ unpinImpl(); DGCImpl dgc = DGCImpl.getDGCImpl(); ! Enumeration enum_ = refSet.elements(); while (enum_.hasMoreElements()) { ! VMID vmid = (VMID) enum_.nextElement(); dgc.unregisterTarget(vmid, this); } return true; } else { return false; --- 365,377 ---- * Also, unregister all vmids referencing this target * so target can be gc'd. */ unpinImpl(); DGCImpl dgc = DGCImpl.getDGCImpl(); ! Enumeration<VMID> enum_ = refSet.elements(); while (enum_.hasMoreElements()) { ! VMID vmid = enum_.nextElement(); dgc.unregisterTarget(vmid, this); } return true; } else { return false;