Package org.apache.tuscany.sca.binding.corba.provider.reference

Examples of org.apache.tuscany.sca.binding.corba.provider.reference.DynaCorbaRequest


    /**
     * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
     */
    public Message invoke(Message msg) {
        try {
            DynaCorbaRequest request = new DynaCorbaRequest(remoteObject, msg.getOperation().getName());
            request.setReferenceClass(referenceClass);
            request.setOperationsMap(operationsMap);
            if (msg.getOperation().getOutputType() != null) {
                Annotation[] notes = operationMethodMapping.get(msg.getOperation()).getAnnotations();
                request.setOutputType(msg.getOperation().getOutputType().getPhysical(), notes);
            }
            java.lang.Object[] args = msg.getBody();
            if (args != null) {
                Annotation[][] notes = operationMethodMapping.get(msg.getOperation()).getParameterAnnotations();
                for (int i = 0; i < args.length; i++) {
                    request.addArgument(args[i], notes[i]);
                }
            }
            if (msg.getOperation().getFaultTypes() != null) {
                for (DataType<?> type : msg.getOperation().getFaultTypes()) {
                    request.addExceptionType(type.getPhysical());
                }
            }
            DynaCorbaResponse response = request.invoke();
            msg.setBody(response.getContent());
        } catch (RequestConfigurationException e) {
            throw new ServiceRuntimeException(e);
        } catch (Exception e) {
            msg.setFaultBody(e);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.corba.provider.reference.DynaCorbaRequest

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.