Package org.apache.tuscany.sca.interfacedef.java

Examples of org.apache.tuscany.sca.interfacedef.java.JavaOperation


        List<Operation> asyncOperations = new ArrayList<Operation>();

        validOperations.addAll(javaInterface.getOperations());
        for (Operation o : javaInterface.getOperations()) {
            if (!o.getName().endsWith(ASYNC)) {
                JavaOperation op = (JavaOperation)o;
                if (op.getJavaMethod().getName().endsWith(ASYNC)) {
                    continue;
                }
                for (Operation asyncOp : getAsyncOperations(javaInterface.getOperations(), op)) {
                    if (isJAXWSAsyncPoolingOperation(op, asyncOp) || isJAXWSAsyncCallbackOperation(op, asyncOp)) {
                        validOperations.remove(asyncOp);
View Full Code Here


            List<Operation> operations =
                filterOperationsByHttpMethod(interfaceContract, bindingContext.getHttpRequest().getMethod());

            Operation operation = findOperation(path, operations);

            final JavaOperation javaOperation = (JavaOperation)operation;
            final Method method = javaOperation.getJavaMethod();

            if (path != null && path.length() > 0) {
                if (method.getAnnotation(Path.class) != null) {
                    msg.setBody(new Object[] {path});
                }
View Full Code Here

     */
    private Operation findOperation(String path, List<Operation> operations) {
        Operation operation = null;

        for (Operation op : operations) {
            final JavaOperation javaOperation = (JavaOperation)op;
            final Method method = javaOperation.getJavaMethod();

            if (path != null && path.length() > 0) {
                if (method.getAnnotation(Path.class) != null) {
                    operation = op;
                    break;
View Full Code Here

        //
        // But for now we'll keep the else-block in here.
        //
        String methodName = null;
        if (operation instanceof JavaOperation) {
            JavaOperation javaOp = (JavaOperation) operation;
            methodName = javaOp.getJavaMethod().getName();
        } else {
            methodName = operation.getName();
        }

        // invoke business method on ejb
View Full Code Here

     */
    // FIXME: Should it be in the InterfaceContractMapper?
    @SuppressWarnings("unchecked")
    private static boolean match(Operation operation, Method method) {
        if (operation instanceof JavaOperation) {
            JavaOperation javaOp = (JavaOperation)operation;
            Method m = javaOp.getJavaMethod();
            if (!method.getName().equals(m.getName())) {
                return false;
            }
            if (method.equals(m)) {
                return true;
View Full Code Here

                                         Mediator mediator) {
        super();
        this.sourceOperation = sourceOperation;
        this.targetOperation = targetOperation;
        if ( sourceOperation instanceof JavaOperation ) {
          JavaOperation javaOp = (JavaOperation) sourceOperation;
          Method sourceMethod = javaOp.getJavaMethod();
        }
       
        this.mediator = mediator;
        this.invocable = invocable;
    }
View Full Code Here

            dataBindingId = dataBinding.value();
            wrapperStyle = dataBinding.wrapped();
        }

        for (Operation op : javaInterface.getOperations()) {
            JavaOperation operation = (JavaOperation) op;
            // In the case of @WebMethod, the method name can be different from the operation name

            if (dataBindingId != null) {
                op.setDataBinding(dataBindingId);
                op.setWrapperStyle(wrapperStyle);
            }

            Method method = operation.getJavaMethod();

            DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
            if (methodDataBinding == null) {
                methodDataBinding = dataBinding;
            }
            dataBindingId = null;
            wrapperStyle = false;
            if (dataBinding != null) {
                dataBindingId = dataBinding.value();
                wrapperStyle = dataBinding.wrapped();
                operation.setDataBinding(dataBindingId);
                operation.setWrapperStyle(wrapperStyle);
            }

            // FIXME: We need a better way to identify simple java types
            int i = 0;
            for (org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getInputType().getLogical()) {
                if (d.getDataBinding() == null) {
                    d.setDataBinding(dataBindingId);
                }
                for (Annotation a : method.getParameterAnnotations()[i]) {
                    if (a.annotationType() == org.apache.tuscany.sca.databinding.annotation.DataType.class) {
                        String value = ((org.apache.tuscany.sca.databinding.annotation.DataType)a).value();
                        d.setDataBinding(value);
                    }
                }
                dataBindingRegistry.introspectType(d, operation);
                i++;
            }
            if (operation.getOutputType() != null) {
              for ( org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getOutputType().getLogical()) {
                if ( d != null ) {
                  // The DataType is null for void operations
                  if ( d.getDataBinding() == null ) {
                    d.setDataBinding(dataBindingId);
                  }
                  dataBindingRegistry.introspectType(d, operation);
                }
              }
             
                org.apache.tuscany.sca.databinding.annotation.DataType dt =
                    method.getAnnotation(org.apache.tuscany.sca.databinding.annotation.DataType.class);
                if (dt != null) {
                    operation.getOutputType().getLogical().get(0).setDataBinding(dt.value());
                }
               
            }
        }
    }
View Full Code Here

     */
    // FIXME: Should it be in the InterfaceContractMapper?
    @SuppressWarnings("unchecked")
    private static boolean match(Operation operation, Method method) {
        if (operation instanceof JavaOperation) {
            JavaOperation javaOp = (JavaOperation)operation;
            Method m = javaOp.getJavaMethod();
            if (!method.getName().equals(m.getName())) {
                return false;
            }
            if (method.equals(m)) {
                return true;
View Full Code Here

        // annotation to something other than the Java operation name.
        //
        // But for now we'll keep the else-block in here.
        //
        if (operation instanceof JavaOperation) {
            JavaOperation javaOp = (JavaOperation) operation;
            methodName = javaOp.getJavaMethod().getName();
        } else {
            methodName = operation.getName();
        }

        // invoke business method on ejb
View Full Code Here

     */
    // FIXME: Should it be in the InterfaceContractMapper?
    @SuppressWarnings("unchecked")
    private static boolean match(Operation operation, Method method) {
        if (operation instanceof JavaOperation) {
            JavaOperation javaOp = (JavaOperation)operation;
            Method m = javaOp.getJavaMethod();
            if (!method.getName().equals(m.getName())) {
                return false;
            }
            if (method.equals(m)) {
                return true;
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.java.JavaOperation

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.