Package org.apache.tuscany.sca.databinding

Examples of org.apache.tuscany.sca.databinding.ExceptionHandler


    public Exception transform(Exception source, TransformationContext context) {
        DataType<DataType> sourceType = context.getSourceDataType();

        DataType<DataType> targetType = context.getTargetDataType();

        ExceptionHandler exceptionHandler = getExceptionHandler(sourceType);
        if (exceptionHandler == null) {
            return source;
        }

        Object sourceFaultInfo = exceptionHandler.getFaultInfo(source);
        Object targetFaultInfo =
            mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());

        ExceptionHandler targetHandler = getExceptionHandler(targetType);

        if (targetHandler != null) {
            Exception targetException =
                targetHandler.createException(targetType, source.getMessage(), targetFaultInfo, source.getCause());
            return targetException;
        }

        // FIXME
        return source;
View Full Code Here


        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(targetFaultType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        return targetHandler;
    }
View Full Code Here

        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(exceptionType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        if (targetHandler == null) {
            return null;
        }
        return targetHandler.getFaultType(exceptionType);
    }
View Full Code Here

    public Exception transform(Exception source, TransformationContext context) {
        DataType<DataType> sourceType = context.getSourceDataType();

        DataType<DataType> targetType = context.getTargetDataType();

        ExceptionHandler exceptionHandler = getExceptionHandler(sourceType);
        if (exceptionHandler == null) {
            return source;
        }

        Object sourceFaultInfo = exceptionHandler.getFaultInfo(source);
        Object targetFaultInfo =
            mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());

        ExceptionHandler targetHandler = getExceptionHandler(targetType);

        if (targetHandler != null) {
            Exception targetException =
                targetHandler.createException(targetType, source.getMessage(), targetFaultInfo, source.getCause());
            return targetException;
        }

        // FIXME
        return source;
View Full Code Here

        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(targetFaultType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        return targetHandler;
    }
View Full Code Here

        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(exceptionType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        if (targetHandler == null) {
            return null;
        }
        return targetHandler.getFaultType(exceptionType);
    }
View Full Code Here

        // FIXME: We cannot assume the exception will have a databinding set
        DataBinding targetDataBinding = mediator.getDataBindings().getDataBinding(exceptionType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        if (targetHandler == null) {
            return null;
        }
        return targetHandler.getFaultType(exceptionType);
    }
View Full Code Here

        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(exceptionType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        if (targetHandler == null) {
            return null;
        }
        return targetHandler.getFaultType(exceptionType);
    }
View Full Code Here

    public Exception transform(Exception source, TransformationContext context) {
        DataType<DataType> sourceType = context.getSourceDataType();

        DataType<DataType> targetType = context.getTargetDataType();

        ExceptionHandler exceptionHandler = getExceptionHandler(sourceType);
        if (exceptionHandler == null) {
            return source;
        }

        Object sourceFaultInfo = exceptionHandler.getFaultInfo(source);
        Object targetFaultInfo =
            mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());

        ExceptionHandler targetHandler = getExceptionHandler(targetType);

        if (targetHandler != null) {
            Exception targetException =
                targetHandler.createException(targetType, source.getMessage(), targetFaultInfo, source.getCause());
            return targetException;
        }

        // FIXME
        return source;
View Full Code Here

        DataBinding targetDataBinding =
            mediator.getDataBindings().getDataBinding(targetFaultType.getDataBinding());
        if (targetDataBinding == null) {
            return null;
        }
        ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler();
        return targetHandler;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.databinding.ExceptionHandler

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.