You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/02/19 19:24:07 UTC

svn commit: r509286 - in /incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding: DataBinding.java ExceptionHandler.java extension/DataBindingExtension.java

Author: rfeng
Date: Mon Feb 19 10:24:06 2007
New Revision: 509286

URL: http://svn.apache.org/viewvc?view=rev&rev=509286
Log:
[sca-integration-branch] Adding ExceptionHandler as a databinding SPI to handle exceptions/faults

Added:
    incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java   (with props)
Modified:
    incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java?view=diff&rev=509286&r1=509285&r2=509286
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java Mon Feb 19 10:24:06 2007
@@ -66,4 +66,12 @@
      * @return The databinding-specific simple type mapper
      */
     SimpleTypeMapper getSimpleTypeMapper();
+    
+    /**
+     * Get the handler that can handle exceptions/faults in the
+     * databinding-specific way
+     * 
+     * @return An instance of the exception handler
+     */
+    ExceptionHandler getExceptionHandler();
 }

Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java?view=auto&rev=509286
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java Mon Feb 19 10:24:06 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.spi.databinding;
+
+import org.apache.tuscany.spi.model.DataType;
+
+/**
+ * ExceptionHandler provides databinding-specific logic for exception handling
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ExceptionHandler {
+    /**
+     * Create an exception to wrap the fault data
+     * 
+     * @param faultInfo The databinding-specific fault data
+     * @return An instance of java exception to represent the fault
+     */
+    Exception createException(Object faultInfo);
+
+    /**
+     * Retrieve the fault info from a java exception
+     * 
+     * @param exception The databinding-specific java exception that represents
+     *            the fault data
+     * @return The databinding-specific fault data
+     */
+    Object getFaultInfo(Exception exception);
+
+    /**
+     * Introspect an exception class to figure
+     * 
+     * @param exceptionType The exception class
+     * @return The data type for the fault
+     */
+    DataType<?> getFaultType(Class<? extends Exception> exceptionType);
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java?view=diff&rev=509286&r1=509285&r2=509286
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java Mon Feb 19 10:24:06 2007
@@ -36,6 +36,7 @@
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.databinding.DataBinding;
 import org.apache.tuscany.spi.databinding.DataBindingRegistry;
+import org.apache.tuscany.spi.databinding.ExceptionHandler;
 import org.apache.tuscany.spi.databinding.SimpleTypeMapper;
 import org.apache.tuscany.spi.databinding.WrapperHandler;
 import org.apache.tuscany.spi.model.DataType;
@@ -113,6 +114,10 @@
      * @see org.apache.tuscany.spi.databinding.DataBinding#getWrapperHandler()
      */
     public WrapperHandler getWrapperHandler() {
+        return null;
+    }
+    
+    public ExceptionHandler getExceptionHandler() {
         return null;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org