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

Print this page




 101     }
 102 
 103     /**
 104      * Adds the specified reference to this DGCAckHandler.
 105      **/
 106     synchronized void add(Object obj) {
 107         if (objList != null) {
 108             objList.add(obj);
 109         }
 110     }
 111 
 112     /**
 113      * Starts the timer for this DGCAckHandler.  After the timeout has
 114      * expired, the references are released even if the acknowledgment
 115      * has not been received.
 116      **/
 117     synchronized void startTimer() {
 118         if (objList != null && task == null) {
 119             task = scheduler.schedule(new Runnable() {
 120                 public void run() {



 121                     release();
 122                 }
 123             }, dgcAckTimeout, TimeUnit.MILLISECONDS);
 124         }
 125     }
 126 
 127     /**
 128      * Releases the references held by this DGCAckHandler.
 129      **/
 130     synchronized void release() {
 131         if (task != null) {
 132             task.cancel(false);
 133             task = null;
 134         }
 135         objList = null;
 136     }
 137 
 138     /**
 139      * Causes the DGCAckHandler associated with the specified UID to
 140      * release its references.


 101     }
 102 
 103     /**
 104      * Adds the specified reference to this DGCAckHandler.
 105      **/
 106     synchronized void add(Object obj) {
 107         if (objList != null) {
 108             objList.add(obj);
 109         }
 110     }
 111 
 112     /**
 113      * Starts the timer for this DGCAckHandler.  After the timeout has
 114      * expired, the references are released even if the acknowledgment
 115      * has not been received.
 116      **/
 117     synchronized void startTimer() {
 118         if (objList != null && task == null) {
 119             task = scheduler.schedule(new Runnable() {
 120                 public void run() {
 121                     if (id != null) {
 122                         idTable.remove(id);
 123                     }
 124                     release();
 125                 }
 126             }, dgcAckTimeout, TimeUnit.MILLISECONDS);
 127         }
 128     }
 129 
 130     /**
 131      * Releases the references held by this DGCAckHandler.
 132      **/
 133     synchronized void release() {
 134         if (task != null) {
 135             task.cancel(false);
 136             task = null;
 137         }
 138         objList = null;
 139     }
 140 
 141     /**
 142      * Causes the DGCAckHandler associated with the specified UID to
 143      * release its references.