You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ri...@apache.org on 2008/04/01 17:25:31 UTC

svn commit: r643446 - in /geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb: OBPortableServer/ OCI/IIOP/ PortableInterceptor/

Author: rickmcguire
Date: Tue Apr  1 08:25:28 2008
New Revision: 643446

URL: http://svn.apache.org/viewvc?rev=643446&view=rev
Log:
YOKO-425 POA.destroy() should not be an error if called multiple times.


Modified:
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java?rev=643446&r1=643445&r2=643446&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java Tue Apr  1 08:25:28 2008
@@ -302,6 +302,7 @@
     // Complete the destroy of the POA
     //
     private void completeDestroy() {
+        logger.fine("Completing destroy of POA " + name_ + " using POAContrl " + poaControl_); 
         //
         // Wait for all pending requests to terminate. If the POA has
         // destruction has already completed waitPendingRequests
@@ -362,6 +363,8 @@
             // Mark the destroy as complete
             //
             poaControl_.markDestroyCompleted();
+            
+            logger.fine("POA " + name_ + " is in a destroyed state"); 
 
             //
             // Release the IORInfo object now
@@ -476,7 +479,7 @@
         // Create the POA control
         //
         poaControl_ = new POAControl();
-
+        
         //
         // Initialize the ServantLocationStategy
         //
@@ -641,7 +644,7 @@
         // Has the POA been destroyed?
         //
         if (poaControl_.getDestroyed()) {
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
         }
         
         logger.fine("POA " + name_ + " creating new POA with name " + adapter); 
@@ -737,7 +740,7 @@
         org.apache.yoko.orb.OB.Assert._OB_assert(adapter != null);
 
         if (poaControl_.getDestroyed()) {
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
         }
         
         logger.fine("POA " + name_ + " finding POA with name " + adapter); 
@@ -879,22 +882,25 @@
     // ----------------------------------------------------------------------
 
     public String the_name() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         return name_;
     }
 
     public org.omg.PortableServer.POA the_parent() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         return parent_;
     }
 
     public org.omg.PortableServer.POA[] the_children() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // Since its possible that the children list changes while
@@ -904,21 +910,21 @@
         java.util.Vector content = new java.util.Vector();
         java.util.Enumeration e = children_.elements();
         while (e.hasMoreElements()) {
-            org.omg.PortableServer.POA child = (org.omg.PortableServer.POA) e
-                    .nextElement();
-            if (child != null)
+            org.omg.PortableServer.POA child = (org.omg.PortableServer.POA) e.nextElement();
+            if (child != null) {
                 content.addElement(child);
+            }
         }
-        org.omg.PortableServer.POA[] children = new org.omg.PortableServer.POA[content
-                .size()];
+        org.omg.PortableServer.POA[] children = new org.omg.PortableServer.POA[content.size()];
         content.copyInto(children);
 
         return children;
     }
 
     public org.omg.PortableServer.POAManager the_POAManager() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         return manager_;
     }
@@ -928,16 +934,18 @@
     }
 
     public org.omg.PortableServer.AdapterActivator the_activator() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         return adapterActivator_.getAdapterActivator();
     }
 
     public void the_activator(org.omg.PortableServer.AdapterActivator activator) {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
-
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
+        
         adapterActivator_.setAdapterActivator(activator);
     }
 
@@ -975,22 +983,25 @@
 
     public org.omg.PortableServer.ServantManager get_servant_manager()
             throws org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         ServantManagerStrategy servantManagerStrategy = servantLocationStrategy_
                 .getServantManagerStrategy();
 
-        if (servantManagerStrategy == null)
+        if (servantManagerStrategy == null) {
             throw new org.omg.PortableServer.POAPackage.WrongPolicy();
+        }
 
         return servantManagerStrategy.getServantManager();
     }
 
     public void set_servant_manager(org.omg.PortableServer.ServantManager mgr)
             throws org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         ServantManagerStrategy servantManagerStrategy = servantLocationStrategy_
                 .getServantManagerStrategy();
@@ -1004,8 +1015,9 @@
     public org.omg.PortableServer.Servant get_servant()
             throws org.omg.PortableServer.POAPackage.NoServant,
             org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         DefaultServantHolder defaultServantHolder = servantLocationStrategy_
                 .getDefaultServantHolder();
@@ -1025,8 +1037,9 @@
             throws org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(servant != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         DefaultServantHolder defaultServantHolder = servantLocationStrategy_
                 .getDefaultServantHolder();
@@ -1043,8 +1056,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(servant != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         byte[] oid = idGenerationStrategy_.createId();
 
@@ -1130,8 +1144,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(servant != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // Validate that the ObjectId is valid
@@ -1156,8 +1171,9 @@
     public void deactivate_object(byte[] oid)
             throws org.omg.PortableServer.POAPackage.ObjectNotActive,
             org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         servantLocationStrategy_.deactivate(this, oid);
 
@@ -1171,8 +1187,9 @@
             throws org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(intf != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         byte[] oid = idGenerationStrategy_.createId();
         return ort().make_object(intf, oid);
@@ -1181,9 +1198,9 @@
     public org.omg.CORBA.Object create_reference_with_id(byte[] oid, String intf) {
         org.apache.yoko.orb.OB.Assert._OB_assert(intf != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
-
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
         //
         // Validate that the ObjectId is valid
         //
@@ -1204,8 +1221,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(servant != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // Requires USE_DEFAULT_SERVANT policy or RETAIN policy and
@@ -1245,8 +1263,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(servant != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // If the operation was invoked in the context of executing
@@ -1276,8 +1295,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(reference != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // Requires the RETAIN policy or the USE_DEFAULT_SERVANT
@@ -1303,8 +1323,9 @@
             org.omg.PortableServer.POAPackage.WrongPolicy {
         org.apache.yoko.orb.OB.Assert._OB_assert(reference != null);
 
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         org.apache.yoko.orb.CORBA.Delegate d = (org.apache.yoko.orb.CORBA.Delegate) ((org.omg.CORBA.portable.ObjectImpl) reference)
                 ._get_delegate();
@@ -1347,8 +1368,9 @@
     public org.omg.PortableServer.Servant id_to_servant(byte[] oid)
             throws org.omg.PortableServer.POAPackage.ObjectNotActive,
             org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         //
         // Requires the RETAIN policy or the USE_DEFAULT_SERVANT policy.
@@ -1369,8 +1391,9 @@
     public org.omg.CORBA.Object id_to_reference(byte[] oid)
             throws org.omg.PortableServer.POAPackage.ObjectNotActive,
             org.omg.PortableServer.POAPackage.WrongPolicy {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         // Requires the RETAIN policy
         //
@@ -1387,8 +1410,9 @@
     }
 
     public byte[] id() {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        if (poaControl_.getDestroyed()) {
+            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA " + name_ + " has been destroyed");
+        }
 
         return adapterId_;
     }
@@ -1739,8 +1763,9 @@
     // Decrement the outstanding number of requests
     //
     public void _OB_decrementRequestCount() {
-        if (poaControl_.decrementRequestCount())
+        if (poaControl_.decrementRequestCount()) {
             completeDestroy();
+        }
     }
 
     //
@@ -1819,8 +1844,11 @@
 
     public void _OB_destroy(boolean etherealize, boolean waitForCompletion,
             java.util.Vector templates) {
-        if (poaControl_.getDestroyed())
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST("POA has been destroyed");
+        logger.fine("Destroying POA " + name_); 
+        if (poaControl_.getDestroyed()) {
+            // this is not an error on other ORBS. 
+            return;
+        }
 
         //
         // If waitForCompletion is TRUE and the current thread is in
@@ -1891,8 +1919,9 @@
             // completed then destruction of the the POA will
             // complete.
             //
-            if (!waitForCompletion && poaControl_.hasPendingRequests())
+            if (!waitForCompletion && poaControl_.hasPendingRequests()) {
                 return;
+            }
 
             completeDestroy();
         }
@@ -1901,10 +1930,12 @@
     private void _OB_handleBidirSCL(
             org.apache.yoko.orb.OCI.TransportInfo transportInfo,
             org.omg.IOP.ServiceContext[] contexts) {
-        if (policies_.bidirPolicy() != org.omg.BiDirPolicy.BOTH.value)
+        if (policies_.bidirPolicy() != org.omg.BiDirPolicy.BOTH.value) {
             return;
+        }
 
-        if (transportInfo != null)
+        if (transportInfo != null) {
             transportInfo.handle_service_contexts(contexts);
+        }
     }
 }

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java?rev=643446&r1=643445&r2=643446&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java Tue Apr  1 08:25:28 2008
@@ -566,8 +566,9 @@
 
     public void finalize() throws Throwable {
         // System.out.println("~Acceptor_impl");
-        if (socket_ != null)
+        if (socket_ != null) {
             close();
+        }
 
         //
         // remove this acceptor from the listenMap_

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java?rev=643446&r1=643445&r2=643446&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java Tue Apr  1 08:25:28 2008
@@ -26,8 +26,14 @@
 
 package org.apache.yoko.orb.PortableInterceptor;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 final public class Current_impl extends org.omg.CORBA.LocalObject implements
         org.omg.PortableInterceptor.Current {
+    // the real logger backing instance.  We use the interface class as the locator
+    static final Logger logger = Logger.getLogger(Current_impl.class.getName());
+    
     private class SlotData {
         org.omg.CORBA.Any[] slots;
 
@@ -80,8 +86,9 @@
             // then it's not necessary to allocate data for the actual
             // slots.
             //
-            if (!partial)
+            if (!partial) {
                 slots = new org.omg.CORBA.Any[maxSlots_];
+            }
 
             holder_.head = new SlotData(slots);
             holder_.head.next = null;
@@ -96,25 +103,33 @@
 
     public org.omg.CORBA.Any get_slot(int id)
             throws org.omg.PortableInterceptor.InvalidSlot {
-        if (id >= maxSlots_)
+        if (id >= maxSlots_) {
             throw new org.omg.PortableInterceptor.InvalidSlot();
+        }
 
+        logger.fine("getting slot " + id); 
+        
         SlotDataHolder holder = establishTSD(false);
 
         org.omg.CORBA.Any result;
         org.omg.CORBA.Any slot = holder.head.slots[id];
-        if (slot == null)
+        if (slot == null) {
             result = orb_.create_any();
-        else
+        }
+        else {
             result = new org.apache.yoko.orb.CORBA.Any(slot);
+        }
 
         return result;
     }
 
     public void set_slot(int id, org.omg.CORBA.Any any)
             throws org.omg.PortableInterceptor.InvalidSlot {
-        if (id >= maxSlots_)
+        if (id >= maxSlots_) {
             throw new org.omg.PortableInterceptor.InvalidSlot();
+        }
+        
+        logger.fine("setting slot " + id); 
 
         SlotDataHolder holder = establishTSD(false);
 
@@ -136,10 +151,10 @@
         org.omg.CORBA.Any[] data = new org.omg.CORBA.Any[holder.head.slots.length];
         for (int i = 0; i < holder.head.slots.length; i++) {
             org.omg.CORBA.Any slot = holder.head.slots[i];
-            if (slot != null)
+            if (slot != null) {
                 data[i] = new org.apache.yoko.orb.CORBA.Any(slot);
+            }
         }
-
         return data;
     }
 
@@ -152,6 +167,7 @@
     // interceptor and the server side PICurrent
     //
     void _OB_pushSlotData(org.omg.CORBA.Any[] slots) {
+        logger.fine("pushing slot data"); 
         SlotDataHolder holder = establishTSD(false);
 
         SlotData newSlots = new SlotData(slots);
@@ -160,6 +176,7 @@
     }
 
     void _OB_popSlotData() {
+        logger.fine("popping slot data"); 
         SlotDataHolder holder = establishTSD(false);
 
         holder.head = holder.head.next;

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java?rev=643446&r1=643445&r2=643446&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java Tue Apr  1 08:25:28 2008
@@ -17,8 +17,13 @@
 
 package org.apache.yoko.orb.PortableInterceptor;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 public class RequestInfo_impl extends org.omg.CORBA.LocalObject implements
         org.omg.PortableInterceptor.RequestInfo {
+// the real logger backing instance.  We use the interface class as the locator
+static final Logger logger = Logger.getLogger(RequestInfo_impl.class.getName());
     //
     // The ORB (Java only)
     //
@@ -119,13 +124,12 @@
     // Protected member implementations
     // ------------------------------------------------------------------
 
-    protected org.omg.IOP.ServiceContext getServiceContext(java.util.Vector l,
-            int id) {
+    protected org.omg.IOP.ServiceContext getServiceContext(java.util.Vector l, int id) {
         for (int i = 0; i < l.size(); i++) {
-            org.omg.IOP.ServiceContext sc = (org.omg.IOP.ServiceContext) l
-                    .elementAt(i);
-            if (sc.context_id == id)
+            org.omg.IOP.ServiceContext sc = (org.omg.IOP.ServiceContext) l.elementAt(i);
+            if (sc.context_id == id) {
                 return copyServiceContext(sc);
+            }
         }
 
         throw new org.omg.CORBA.BAD_PARAM(
@@ -136,24 +140,23 @@
                 org.omg.CORBA.CompletionStatus.COMPLETED_NO);
     }
 
-    protected void addServiceContext(java.util.Vector l,
-            org.omg.IOP.ServiceContext sc, boolean addReplace) {
+    protected void addServiceContext(java.util.Vector l, org.omg.IOP.ServiceContext sc, boolean addReplace) {
         //
         // It would be possible to use a hashtable internally for this
         // instead of a sequence. However, the additional overhead isn't
         // worth the effort.
         //
         for (int i = 0; i < l.size(); i++) {
-            org.omg.IOP.ServiceContext c = (org.omg.IOP.ServiceContext) l
-                    .elementAt(i);
+            org.omg.IOP.ServiceContext c = (org.omg.IOP.ServiceContext) l.elementAt(i);
             if (c.context_id == sc.context_id) {
-                if (!addReplace)
+                if (!addReplace) {
                     throw new org.omg.CORBA.BAD_INV_ORDER(
                             org.apache.yoko.orb.OB.MinorCodes
                                     .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorServiceContextExists)
                                     + ": " + sc.context_id,
                             org.apache.yoko.orb.OB.MinorCodes.MinorServiceContextExists,
                             org.omg.CORBA.CompletionStatus.COMPLETED_NO);
+                }
                 l.setElementAt(copyServiceContext(sc), i);
                 return;
             }
@@ -349,13 +352,13 @@
         // This cannot be called in send_poll, send_request or
         // receive_request_service_context, receive_request
         //
-        if (status_ < 0)
+        if (status_ < 0) {
             throw new org.omg.CORBA.BAD_INV_ORDER(
                     org.apache.yoko.orb.OB.MinorCodes
                             .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall),
                     org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall,
                     org.omg.CORBA.CompletionStatus.COMPLETED_NO);
-
+        }
         return status_;
     }
 
@@ -377,12 +380,13 @@
         // This can only be called if the status is location forward
         // or location forward perm
         //
-        if (status_ != org.omg.PortableInterceptor.LOCATION_FORWARD.value)
+        if (status_ != org.omg.PortableInterceptor.LOCATION_FORWARD.value) {
             throw new org.omg.CORBA.BAD_INV_ORDER(
                     org.apache.yoko.orb.OB.MinorCodes
                             .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall),
                     org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall,
                     org.omg.CORBA.CompletionStatus.COMPLETED_NO);
+        }
 
         org.apache.yoko.orb.OB.Assert._OB_assert(forwardReference_ != null);
         return orbInstance_.getObjectFactory().createObject(forwardReference_);
@@ -403,13 +407,16 @@
     //
     public org.omg.CORBA.Any get_slot(int id)
             throws org.omg.PortableInterceptor.InvalidSlot {
-        if (id >= slots_.length)
+        if (id >= slots_.length) {
             throw new org.omg.PortableInterceptor.InvalidSlot();
+        }
+        
+        logger.fine("getting slot " + id + " for operation " + op_); 
 
         org.omg.CORBA.Any result = orb_.create_any();
-        if (slots_[id] != null)
-            result.read_value(slots_[id].create_input_stream(), slots_[id]
-                    .type());
+        if (slots_[id] != null) {
+            result.read_value(slots_[id].create_input_stream(), slots_[id].type());
+        }
         return result;
     }
 
@@ -444,13 +451,13 @@
     // send_reply: yes send_exception: yes send_other: yes
     //
     public org.omg.IOP.ServiceContext get_reply_service_context(int id) {
-        if (status_ < 0)
+        if (status_ < 0) {
             throw new org.omg.CORBA.BAD_INV_ORDER(
                     org.apache.yoko.orb.OB.MinorCodes
                             .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall),
                     org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall,
                     org.omg.CORBA.CompletionStatus.COMPLETED_NO);
-
+        }
         return getServiceContext(replySCL_, id);
     }
 

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java?rev=643446&r1=643445&r2=643446&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java Tue Apr  1 08:25:28 2008
@@ -282,8 +282,10 @@
     //
     public void set_slot(int id, org.omg.CORBA.Any data)
             throws org.omg.PortableInterceptor.InvalidSlot {
-        if (id >= slots_.length)
+        if (id >= slots_.length) {
             throw new org.omg.PortableInterceptor.InvalidSlot();
+        }
+        logger.fine("setting slot " + id + " for operation " + op_); 
         slots_[id] = new org.apache.yoko.orb.CORBA.Any(data);
     }
 
@@ -296,12 +298,13 @@
     // send_reply: no send_exception: no send_other: no
     //
     public boolean target_is_a(String id) {
-        if (status_ == NO_REPLY_SC || servant_ == null)
+        if (status_ == NO_REPLY_SC || servant_ == null) {
             throw new org.omg.CORBA.BAD_INV_ORDER(
                     org.apache.yoko.orb.OB.MinorCodes
                             .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall),
                     org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall,
                     org.omg.CORBA.CompletionStatus.COMPLETED_NO);
+        }
 
         return servant_._is_a(id);
     }
@@ -545,9 +548,11 @@
     //
     public void _OB_contextSwitch() {
         if (popCurrent_) {
+            logger.fine("Popping the PICurrent because of a context switch"); 
             popCurrent_ = false;
             current_._OB_popSlotData();
         } else {
+            logger.fine("Pushing the PICurrent because of a context switch"); 
             popCurrent_ = true;
             current_._OB_pushSlotData(slots_);
         }