Package org.apache.tuscany.sca.runtime

Examples of org.apache.tuscany.sca.runtime.RuntimeComponentService


        try {

            JMSResourceFactory rf = ((JMSBindingServiceBindingProvider)jmsSLD).getResourceFactory();
           
            MessageListener listener = new ServiceInvoker(jmsSLD.getJmsBinding(), jmsSLD.getService(), jmsSLD.getTargetBinding(), jmsSLD.getMessageFactory(), rf);
            RuntimeComponentService service = jmsSLD.getService();

            return new ASFListener(listener, service.getName(), service.isCallback(), jmsSLD.getJmsBinding(), workScheduler, rf);

        } catch (NamingException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here


    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        RuntimeComponentService componentService = (RuntimeComponentService)service;
        RuntimeWire wire = componentService.getRuntimeWire(binding);

        GdataBindingListenerServlet servlet =
            new GdataBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle());

        servletMapping = binding.getURI();
View Full Code Here

    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        RuntimeComponentService componentService = (RuntimeComponentService)service;
        RuntimeWire wire = componentService.getRuntimeWire(binding);

        AtomBindingListenerServlet servlet =
            new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle());

        servletMapping = binding.getURI();
View Full Code Here

        final Object operationReturnValue = "Operation Success";

        // Mock up the Service. Basically, it is going to call:
        // List<Operation> opList = service.getInterfaceContract().getInterface().getOperations();
        final InterfaceContract ifaceContract = EasyMock.createStrictMock(InterfaceContract.class);
        final RuntimeComponentService service = EasyMock.createStrictMock(RuntimeComponentService.class);
        final Interface iface = EasyMock.createStrictMock(Interface.class);
        EasyMock.expect(iface.getOperations()).andReturn(operations);
        EasyMock.expect(ifaceContract.getInterface()).andReturn(iface);
        EasyMock.expect(service.getInterfaceContract()).andReturn(ifaceContract);

        // Mock up getting and invoking the RuntimeWire. It is going to call:
        // service.getRuntimeWire(jmsBinding).invoke(operation, (Object[])requestPayload);
        final RuntimeWire runtimeWire = EasyMock.createStrictMock(RuntimeWire.class);
        EasyMock.expect(service.getRuntimeWire(jmsBinding)).andReturn(runtimeWire);
        EasyMock.expect(runtimeWire.invoke(expectedOperation, new Object[] {operationParams}))
            .andReturn(operationReturnValue);

        // Create the JMS Binding Listener
      //  final DefaultJMSBindingListener bindingListener = new DefaultJMSBindingListener(jmsBinding, jmsResourceFactory, service, null);
View Full Code Here

       
    }

    public void start() {
        // Get the invokers for the supported operations
        RuntimeComponentService componentService = (RuntimeComponentService) service;
        RuntimeWire wire = componentService.getRuntimeWire(binding);
        Servlet servlet = null;
        bindingListenerServlet = new HTTPBindingListenerServlet(binding, messageFactory );
        for (InvocationChain invocationChain : wire.getInvocationChains()) {
            Operation operation = invocationChain.getTargetOperation();
            String operationName = operation.getName();
View Full Code Here

            "Module not found in SCA component.");
        sendMessage(connection, senderPid, senderRef,
            MessageHelper.ATOM_BADRPC, errorMsg);
      } else {
        // module found, looking for operation
        RuntimeComponentService service = nodeElement.getService();
        ErlangBinding binding = nodeElement.getBinding();
        List<Operation> operations = service.getInterfaceContract()
            .getInterface().getOperations();
        Operation operation = null;
        for (Operation o : operations) {
          if (o.getName().equals(function)) {
            operation = o;
            break;
          }
        }
        if (operation != null) {
          // operation found
          List<DataType> iTypes = operation.getInputType()
              .getLogical();
          Class<?>[] forClasses = new Class<?>[iTypes.size()];
          for (int i = 0; i < iTypes.size(); i++) {
            forClasses[i] = iTypes.get(i).getPhysical();
          }
          try {
            // invoke operation
            Method jmethod = ((JavaOperation) operation)
                .getJavaMethod();
            Object result = service.getRuntimeWire(binding,
                service.getInterfaceContract()).invoke(
                operation,
                TypeHelpersProxy.toJavaFromList(argsList,
                    forClasses, jmethod
                        .getParameterAnnotations()));
            OtpErlangObject response = null;
View Full Code Here

        Invoker result = null;
        BindingSCATransformer bindingTransformer = null;
           
        Endpoint target = endpointReference.getTargetEndpoint();
        if (target != null) {
            RuntimeComponentService service = (RuntimeComponentService) target.getService();
            if (service != null) { // not a callback wire
                               
                InvocationChain chain = ((RuntimeEndpoint) target).getInvocationChain(operation);

                boolean passByValue = false;
View Full Code Here

                configure(chain, chain.getSourceOperation());
            }
        } else if (subject instanceof RuntimeComponent) {
            RuntimeComponent component = (RuntimeComponent)subject;
            for (ComponentService s : component.getServices()) {
                RuntimeComponentService service = (RuntimeComponentService)s;
                for (Endpoint ep : service.getEndpoints()) {
                    List<InvocationChain> chains = ((RuntimeEndpoint)ep).getInvocationChains();
                    for (InvocationChain chain : chains) {
                        configure(chain, chain.getTargetOperation());
                    }
                }
View Full Code Here

    }

    private Invoker getInvoker(RuntimeEndpointReference epr, Operation operation) {
        Endpoint target = epr.getTargetEndpoint();
        if (target != null) {
            RuntimeComponentService service = (RuntimeComponentService)target.getService();
            if (service != null) { // not a callback wire
                InvocationChain chain = ((RuntimeEndpoint)target).getInvocationChain(operation);

                boolean passByValue = false;
                Operation targetOp = chain.getTargetOperation();
View Full Code Here

            // if the user has spun up a new thread inside their component implementation
            return null;
        }
       
        Endpoint to = msgContext.getTo();
        RuntimeComponentService service = (RuntimeComponentService) to.getService();
        RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
        if (callbackReference == null) {
            return null;
        }
        JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
        Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.runtime.RuntimeComponentService

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.