incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmidd...@apache.org
Subject svn commit: r515575 - in /incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba: CorbaConduit.java CorbaMessage.java interceptors/CorbaFaultInInterceptor.java interceptors/CorbaInInterceptor.java
Date Wed, 07 Mar 2007 14:12:50 GMT
Author: dmiddlem
Date: Wed Mar  7 06:12:49 2007
New Revision: 515575

URL: http://svn.apache.org/viewvc?view=rev&rev=515575
Log:
Updates to handle CORBA system exceptions correctly (YOKO-267).  Yoko clients can now
now catch these types of exceptions.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaMessage.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaFaultInInterceptor.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java?view=diff&rev=515575&r1=515574&r2=515575
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java
Wed Mar  7 06:12:49 2007
@@ -60,10 +60,10 @@
 import org.omg.CORBA.NamedValue;
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Request;
+import org.omg.CORBA.SystemException;
 import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.UnknownUserException;
 
-
 public class CorbaConduit implements Conduit {
     private static final Logger LOG = LogUtils.getL7dLogger(CorbaConduit.class);
 
@@ -174,7 +174,14 @@
         if (request == null) {
             throw new CorbaBindingException("Couldn't build the corba request");
         }
-        request.invoke();
+        try {
+            request.invoke();
+        } catch (SystemException ex) {
+            message.setContent(Exception.class, new Fault(ex));
+            message.setSystemException(ex);
+            return;
+        }
+        
         Exception ex = request.env().exception();
         if (ex != null) {
             if (ex instanceof UnknownUserException) {
@@ -343,6 +350,9 @@
             if (corbaMsg.getStreamableException() != null) {
                 exchange.setInFaultMessage(corbaMsg);
                 inCorbaMsg.setStreamableException(corbaMsg.getStreamableException());   
            
+            } else if (corbaMsg.getSystemException() != null) {
+                exchange.setInFaultMessage(corbaMsg);
+                inCorbaMsg.setSystemException(corbaMsg.getSystemException());
             }
             LOG.log(Level.FINE, "incoming observer is " + incomingObserver);
             incomingObserver.onMessage((Message)inCorbaMsg);          

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaMessage.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaMessage.java?view=diff&rev=515575&r1=515574&r2=515575
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaMessage.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaMessage.java
Wed Mar  7 06:12:49 2007
@@ -29,12 +29,15 @@
 
 import org.apache.yoko.bindings.corba.types.CorbaObjectHandler;
 import org.omg.CORBA.NVList;
+import org.omg.CORBA.SystemException;
 
 public class CorbaMessage extends AbstractWrappedMessage {
 
     private List<CorbaStreamable> arguments;
     private CorbaStreamable returnParam;
     private CorbaStreamable except;
+    private SystemException systemExcept;
+    
     private NVList list;
 
     private Map<Class<?>, Object> contents = new HashMap<Class<?>, Object>();
@@ -47,6 +50,7 @@
             setStreamableArguments(data);            
             returnParam = msg.getStreamableReturn();
             except = msg.getStreamableException();
+            systemExcept = msg.getSystemException();
             list = msg.getList();
         } else {
             this.arguments = new ArrayList<CorbaStreamable>();    
@@ -68,6 +72,14 @@
 
     public CorbaStreamable getStreamableReturn() {
         return this.returnParam;
+    }
+    
+    public SystemException getSystemException() {
+        return this.systemExcept;
+    }
+    
+    public void setSystemException(SystemException sysEx) {
+        systemExcept = sysEx;
     }
 
     public void addStreamableArgument(CorbaStreamable arg) {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaFaultInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaFaultInInterceptor.java?view=diff&rev=515575&r1=515574&r2=515575
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaFaultInInterceptor.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaFaultInInterceptor.java
Wed Mar  7 06:12:49 2007
@@ -48,17 +48,18 @@
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
+
 import org.apache.yoko.bindings.corba.ContextUtils;
 import org.apache.yoko.bindings.corba.CorbaBindingException;
 import org.apache.yoko.bindings.corba.CorbaMessage;
 import org.apache.yoko.bindings.corba.CorbaStaxObject;
 import org.apache.yoko.bindings.corba.CorbaStreamable;
 import org.apache.yoko.bindings.corba.CorbaTypeMap;
-
 import org.apache.yoko.wsdl.CorbaConstants;
 
+import org.omg.CORBA.SystemException;
+
 public class CorbaFaultInInterceptor extends AbstractPhaseInterceptor<Message> {
         
     private static final Logger LOG = LogUtils.getL7dLogger(CorbaFaultInInterceptor.class);
 
@@ -77,12 +78,19 @@
     public void handleMessage(Message msg) {
         CorbaMessage message = (CorbaMessage)msg;
         try {
+            SystemException sysEx = message.getSystemException();
+            if (sysEx != null) {
+                // TODO: Do we need anything else to handle system exceptions here...i.e.
do
+                // we want to add a wrapper around this so that we can add some more information?
+                message.setContent(Exception.class, sysEx);
+                return;
+            }
+
             CorbaStreamable exStreamable = message.getStreamableException();
             if (exStreamable != null) {
                 EventDataReader reader = (EventDataReader) ContextUtils.getDataReader(message);
 
                 BindingOperationInfo bopInfo = message.getExchange().get(BindingOperationInfo.class);
-                OperationType opType = bopInfo.getExtensor(OperationType.class);
                 OperationInfo opInfo = bopInfo.getOperationInfo();
                 
                 List<CorbaTypeMap> typeMaps = new ArrayList<CorbaTypeMap>();
@@ -155,5 +163,5 @@
             xif = XMLInputFactory.newInstance();            
         }
         return xif;
-    }        
+    }     
 }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java?view=diff&rev=515575&r1=515574&r2=515575
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
Wed Mar  7 06:12:49 2007
@@ -183,7 +183,7 @@
         } else {
             corbaStaxObject = new CorbaStaxObject(orb);
         }
-        if (message.getStreamableException() != null) {
+        if (message.getStreamableException() != null || message.getSystemException() != null)
{
             Endpoint ep = message.getExchange().get(Endpoint.class);
             message.getInterceptorChain().abort();
             if (ep.getInFaultObserver() != null) {



Mime
View raw message