changeset 677:6bbe5a7732db

Merge
author ewendeli
date Sun, 03 Feb 2013 22:43:34 +0100
parents f9a20c477c97 2a6c7c63f9a0
children 08e281a52adf
files .hgtags
diffstat 3 files changed, 66 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Feb 01 10:25:16 2013 -0800
+++ b/.hgtags	Sun Feb 03 22:43:34 2013 +0100
@@ -199,6 +199,7 @@
 2a8376123fbb81bc4b2f643ff7cfaf7f87b21c35 jdk7u6-b23
 02512f61591f55d84458d1ea4ce84eecb7324f89 jdk7u6-b24
 8b20875b3faa01ef56331045de88747df278eaeb jdk7u6-b30
+d7fe6c13adf9e06d98c061449d171bc06c2ba0a3 jdk7u6-b31
 d7fe6c13adf9e06d98c061449d171bc06c2ba0a3 jdk7u7-b10
 496baf62d0550c704505b0ff6f390279f6a569e0 jdk7u7-b30
 e57e4274a3575f278115cc8ef03c5bdf3c43a7ed jdk7u7-b11
@@ -232,3 +233,22 @@
 983fac5b27376839142ac5a8770461e4e48c2dc8 jdk7u11-b08
 b192d148731916e4b1b47b7a3e6b0a1d7ddf3f14 jdk7u13-b09
 b9ab9b203a41469a274419d26be2c04558b57ce8 jdk7u13-b20
+353c15c4bc371f2f8258344c988d1403477cc140 jdk7u8-b01
+d17ca8d088f7cc0dd42230472f534c8d1e415bcb jdk7u8-b02
+7c62cfa17e9613bf69d4f9b2ae74f3724d7a2955 jdk7u8-b03
+86961c802e87688ff264a946ca647d062f538302 jdk7u8-b04
+a274cd0c309b4da766dc73cac644cb44f1c23787 jdk7u8-b05
+292eab1079e7b62db7cf848781eddf1b6fc718e5 jdk7u10-b06
+ff5e33bcfc2bb7c2a69cd20b91490922eb158af2 jdk7u10-b07
+76811225baeccd3ed77a3e2ec7745ba3d42acff5 jdk7u10-b08
+f8e8ef8e0a5eea83938dab38d9a8cf6354f5a92d jdk7u10-b09
+3f309ff1d8ecd0210340ae9cfb40cc9072f66757 jdk7u12-b01
+06a04d95a12f18f07610f5d787324e2ea15e6376 jdk7u12-b02
+665ee21ff3ef309147e7f7872e2d4f446a31b642 jdk7u12-b03
+f89f101d3dfea98b143b693cebccdefc89b691ff jdk7u12-b04
+2516fd4adf4af010c217e073cdb0a1fa9eefd827 jdk7u12-b05
+16287175b517e48da9b24d31a3e9da200b6bc563 jdk7u12-b06
+7969d5f219248de033c296ef75fff7aae7545bbd jdk7u12-b07
+6f4d4c7a254d4aca3a7f2caabb75e6559a290393 jdk7u12-b08
+c8c261b2220c5b966c07784682057a915defb0da jdk7u12-b09
+3877f9ae971eefbfbbcb16f2ff79c72ac10ac4bd jdk7u14-b10
--- a/src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java	Fri Feb 01 10:25:16 2013 -0800
+++ b/src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java	Sun Feb 03 22:43:34 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
 
 package com.sun.corba.se.impl.transport;
 
-import java.util.Hashtable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 import org.omg.CORBA.CompletionStatus;
 import org.omg.CORBA.SystemException;
@@ -68,7 +71,7 @@
 
     private CorbaConnection connection;
     // Maps requestId to an OutCallDesc.
-    private Hashtable out_calls = null; // REVISIT - use int hastable/map
+    final private Map<Integer, OutCallDesc> out_calls;
 
     public CorbaResponseWaitingRoomImpl(ORB orb, CorbaConnection connection)
     {
@@ -76,7 +79,8 @@
         wrapper = ORBUtilSystemException.get( orb,
             CORBALogDomains.RPC_TRANSPORT ) ;
         this.connection = connection;
-        out_calls = new Hashtable();
+        out_calls =
+            Collections.synchronizedMap(new HashMap<Integer, OutCallDesc>());
     }
 
     ////////////////////////////////////////////////////
@@ -139,7 +143,7 @@
             return null;
         }
 
-        OutCallDesc call = (OutCallDesc)out_calls.get(requestId);
+        OutCallDesc call = out_calls.get(requestId);
         if (call == null) {
             throw wrapper.nullOutCall(CompletionStatus.COMPLETED_MAYBE);
         }
@@ -197,7 +201,7 @@
         LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
             inputObject.getMessageHeader();
         Integer requestId = new Integer(header.getRequestId());
-        OutCallDesc call = (OutCallDesc) out_calls.get(requestId);
+        OutCallDesc call = out_calls.get(requestId);
 
         if (orb.transportDebugFlag) {
             dprint(".responseReceived: id/"
@@ -248,7 +252,6 @@
 
     public int numberRegistered()
     {
-        // Note: Hashtable.size() is not synchronized
         return out_calls.size();
     }
 
@@ -264,29 +267,41 @@
             dprint(".signalExceptionToAllWaiters: " + systemException);
         }
 
-        OutCallDesc call;
-        java.util.Enumeration e = out_calls.elements();
-        while(e.hasMoreElements()) {
-            call = (OutCallDesc) e.nextElement();
+        synchronized (out_calls) {
+            if (orb.transportDebugFlag) {
+                dprint(".signalExceptionToAllWaiters: out_calls size :" +
+                       out_calls.size());
+            }
 
-            synchronized(call.done){
-                // anything waiting for BufferManagerRead's fragment queue
-                // needs to be cancelled
-                CorbaMessageMediator corbaMsgMediator =
-                             (CorbaMessageMediator)call.messageMediator;
-                CDRInputObject inputObject =
-                           (CDRInputObject)corbaMsgMediator.getInputObject();
-                // IMPORTANT: If inputObject is null, then no need to tell
-                //            BufferManagerRead to cancel request processing.
-                if (inputObject != null) {
-                    BufferManagerReadStream bufferManager =
-                        (BufferManagerReadStream)inputObject.getBufferManager();
-                    int requestId = corbaMsgMediator.getRequestId();
-                    bufferManager.cancelProcessing(requestId);
+            for (OutCallDesc call : out_calls.values()) {
+                if (orb.transportDebugFlag) {
+                    dprint(".signalExceptionToAllWaiters: signaling " +
+                            call);
                 }
-                call.inputObject = null;
-                call.exception = systemException;
-                call.done.notify();
+                synchronized(call.done) {
+                    try {
+                        // anything waiting for BufferManagerRead's fragment queue
+                        // needs to be cancelled
+                        CorbaMessageMediator corbaMsgMediator =
+                                     (CorbaMessageMediator)call.messageMediator;
+                        CDRInputObject inputObject =
+                                   (CDRInputObject)corbaMsgMediator.getInputObject();
+                        // IMPORTANT: If inputObject is null, then no need to tell
+                        //            BufferManagerRead to cancel request processing.
+                        if (inputObject != null) {
+                            BufferManagerReadStream bufferManager =
+                                (BufferManagerReadStream)inputObject.getBufferManager();
+                            int requestId = corbaMsgMediator.getRequestId();
+                            bufferManager.cancelProcessing(requestId);
+                        }
+                    } catch (Exception e) {
+                    } finally {
+                        // attempt to wake up waiting threads in all cases
+                        call.inputObject = null;
+                        call.exception = systemException;
+                        call.done.notifyAll();
+                    }
+                }
             }
         }
     }
@@ -294,7 +309,7 @@
     public MessageMediator getMessageMediator(int requestId)
     {
         Integer id = new Integer(requestId);
-        OutCallDesc call = (OutCallDesc) out_calls.get(id);
+        OutCallDesc call = out_calls.get(id);
         if (call == null) {
             // This can happen when getting early reply fragments for a
             // request which has completed (e.g., client marshaling error).
--- a/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Fri Feb 01 10:25:16 2013 -0800
+++ b/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Sun Feb 03 22:43:34 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1521,7 +1521,7 @@
             // connection and give them the SystemException;
 
             responseWaitingRoom.signalExceptionToAllWaiters(systemException);
-
+        } finally {
             if (contactInfo != null) {
                 ((OutboundConnectionCache)getConnectionCache()).remove(contactInfo);
             } else if (acceptor != null) {
@@ -1542,7 +1542,6 @@
 
             writeUnlock();
 
-        } finally {
             if (orb.transportDebugFlag) {
                 dprint(".purgeCalls<-: "
                        + minor_code + "/" + die + "/" + lockHeld