Package org.apache.tuscany.sca.binding.corba.impl.types

Examples of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree


            try {
                // invocation and sending result
                Object result = invocationProxy.invoke(operationName, inputInstances);
                OutputStream out = rh.createReply();
                if (types.getOutputType() != null) {
                    TypeTree tree = types.getOutputType();
                    TypeHelpersProxy.write(tree.getRootNode(), out, result);
                }
                return out;
            } catch (InvocationException ie) {
                // handling user exception
                try {
                    OutputStream out = rh.createExceptionReply();
                    Class<?> exceptionClass = ie.getTargetException().getClass();
                    TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, null);
                    String exceptionId = Utils.getTypeId(exceptionClass);
                    out.write_string(exceptionId);
                    TypeHelpersProxy.write(tree.getRootNode(), out, ie.getTargetException());
                    return out;
                } catch (Exception e) {
                    logger.log(Level.WARNING, "Exception during handling invocation exception", e);
                }
            } catch (Exception e) {
View Full Code Here


                List<TypeTree> inputInstances = new ArrayList<TypeTree>();
                // cache output type tree
                if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
                    && !operation.getOutputType().getPhysical().equals(void.class)) {
                    Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
                    TypeTree outputType =
                        TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), notes);
                    operationTypes.setOutputType(outputType);
                }
                // cache input types trees
                if (operation.getInputType() != null) {
                    Method method = operationMethodMapping.get(operation);
                    Annotation[][] notes = method.getParameterAnnotations();
                    int i = 0;
                    for (DataType<List<DataType<?>>> type : operation.getInputType().getLogical()) {
                        Class<?> forClass = type.getPhysical();
                        TypeTree inputType = TypeTreeCreator.createTypeTree(forClass, notes[i]);
                        inputInstances.add(inputType);
                        i++;
                    }

                }
View Full Code Here

     * Adds operation argument - stores arguments and caches its TypeTree
     *
     * @param argument
     */
    public void addArgument(java.lang.Object argument, Annotation[] notes) throws RequestConfigurationException {
        TypeTree tree = TypeTreeCreator.createTypeTree(argument.getClass(), notes);
        argumentsTypes.add(tree);
        arguments.add(argument);
    }
View Full Code Here

     * @param outputStream
     * @throws RequestConfigurationException
     */
    private void passArguments(OutputStream outputStream) throws RequestConfigurationException {
        for (int i = 0; i < arguments.size(); i++) {
            TypeTree tree = argumentsTypes.get(i);
            TypeHelpersProxy.write(tree.getRootNode(), outputStream, arguments.get(i));
        }
    }
View Full Code Here

     * Configures possible exceptions
     *
     * @param forClass
     */
    public void addExceptionType(Class<?> forClass) throws RequestConfigurationException {
        TypeTree tree = TypeTreeCreator.createTypeTree(forClass, null);
        String exceptionId = Utils.getTypeId(forClass);
        exceptions.put(exceptionId, tree);
    }
View Full Code Here

                                                      ae.getId());
                throw exception;
            }
            InputStream is = ae.getInputStream();
            String exceptionId = is.read_string();
            TypeTree tree = exceptions.get(exceptionId);
            if (tree == null) {
                RequestConfigurationException exception =
                    new RequestConfigurationException(
                                                      "ApplicationException occured, but no such exception was defined",
                                                      ae.getId());
                throw exception;
            } else {
                Exception ex = (Exception)TypeHelpersProxy.read(tree.getRootNode(), is);
                throw ex;
            }
        } catch (Exception e) {
            throw e;
        }
View Full Code Here

            try {
                // invocation and sending result
                Object result = invocationProxy.invoke(operationName, inputInstances);
                OutputStream out = rh.createReply();
                if (types.getOutputType() != null) {
                    TypeTree tree = types.getOutputType();
                    TypeHelpersProxy.write(tree.getRootNode(), out, result);
                }
                return out;
            } catch (InvocationException ie) {
                // handling user exception
                try {
                    OutputStream out = rh.createExceptionReply();
                    Class<?> exceptionClass = ie.getTargetException().getClass();
                    TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, null);
                    String exceptionId = Utils.getTypeId(exceptionClass);
                    out.write_string(exceptionId);
                    TypeHelpersProxy.write(tree.getRootNode(), out, ie.getTargetException());
                    return out;
                } catch (Exception e) {
                    logger.log(Level.WARNING, "Exception during handling invocation exception", e);
                }
            } catch (Exception e) {
View Full Code Here

                List<TypeTree> inputInstances = new ArrayList<TypeTree>();
                // cache output type tree
                if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
                    && !operation.getOutputType().getPhysical().equals(void.class)) {
                    Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
                    TypeTree outputType =
                        TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), notes);
                    operationTypes.setOutputType(outputType);
                }
                // cache input types trees
                if (operation.getInputType() != null) {
                    Method method = operationMethodMapping.get(operation);
                    Annotation[][] notes = method.getParameterAnnotations();
                    int i = 0;
                    for (DataType<List<DataType<?>>> type : operation.getInputType().getLogical()) {
                        Class<?> forClass = type.getPhysical();
                        TypeTree inputType = TypeTreeCreator.createTypeTree(forClass, notes[i]);
                        inputInstances.add(inputType);
                        i++;
                    }

                }
View Full Code Here

     * Adds operation argument - stores arguments and caches its TypeTree
     *
     * @param argument
     */
    public void addArgument(java.lang.Object argument, Annotation[] notes) throws RequestConfigurationException {
        TypeTree tree = TypeTreeCreator.createTypeTree(argument.getClass(), notes);
        argumentsTypes.add(tree);
        arguments.add(argument);
    }
View Full Code Here

     * @param outputStream
     * @throws RequestConfigurationException
     */
    private void passArguments(OutputStream outputStream) throws RequestConfigurationException {
        for (int i = 0; i < arguments.size(); i++) {
            TypeTree tree = argumentsTypes.get(i);
            TypeHelpersProxy.write(tree.getRootNode(), outputStream, arguments.get(i));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree

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.