Package org.apache.tuscany.sca.interfacedef.util

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException


    public Object getFaultInfo(Exception exception) {
        if (exception == null) {
            return null;
        }
        FaultException faultException = (FaultException)exception;
        return faultException.getFaultInfo();

    }
View Full Code Here


    public void testCreate() {

        Exception ex = handler.createException(null, "Order", faultElement, null);
        assertTrue(ex instanceof FaultException);
        FaultException exception = (FaultException)ex;
        assertEquals("Order", exception.getMessage());
        assertSame(faultElement, exception.getFaultInfo());
    }
View Full Code Here

        assertEquals("Order", exception.getMessage());
        assertSame(faultElement, exception.getFaultInfo());
    }

    public void testGetFaultInfo() {
        FaultException exception = new FaultException("Order", faultElement, null);
        Object faultInfo = handler.getFaultInfo(exception);
        assertSame(faultElement, faultInfo);
    }
View Full Code Here

* @version $Rev: 567542 $ $Date: 2007-08-19 22:13:29 -0700 (Sun, 19 Aug 2007) $
*/
public class AxiomExceptionHandler implements ExceptionHandler {

    public Exception createException(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause) {
        return new FaultException(message, faultInfo, cause);
    }
View Full Code Here

    public Object getFaultInfo(Exception exception) {
        if (exception == null) {
            return null;
        }
        FaultException faultException = (FaultException)exception;
        return faultException.getFaultInfo();

    }
View Full Code Here

        try {
            Object resp = invokeTarget(msg);
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail());
                f.setLogical(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

            Object resp = invokeTarget(msg);
          
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

            //
            // Note this may happen even if we find a constructor above, that is the type of the non-generic fault exc may be an instance
            // of FaultException
            //
            if ((exc instanceof FaultException) && (faultBeanType.getLogical() instanceof XMLType)) {
                FaultException faultExc = (FaultException)exc;
                DataType<XMLType> faultBeanXMLType = (DataType<XMLType>)faultBeanType;
                XMLType faultLogical = faultBeanXMLType.getLogical();
                faultExc.setFaultName(faultLogical.getElementName());
            }
            return exc;
        } catch (Throwable e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here

                                ctor = exceptionClass.getConstructor();
                                if (ctor != null) {
                                    ex = ctor.newInstance();
                                    populateException(ex, faultInfo);
                                } else {
                                    ex = new FaultException(message, faultInfo, cause);
                                }
                            } catch (NoSuchMethodException e5) {
                                try {
                                    ctor = exceptionClass.getConstructor(Throwable.class);
                                    ex = ctor.newInstance(cause);
View Full Code Here

            Object resp = invokeTarget(msg);
          
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.util.FaultException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.