Package org.apache.tuscany.sca.runtime

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


        }
        return null;
    }

    public static CompositeActivator getCurrentCompositeActivator() {
        RuntimeComponent component = getCurrentComponent();
        if (component != null) {
            ComponentContextImpl context = (ComponentContextImpl)component.getComponentContext();
            return context.getCompositeActivator();
        }
        return null;
    }
View Full Code Here


            }
           
        } else {
            // It's the service wire
            RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
            RuntimeComponent serviceComponent = wireTarget.getComponent();
            Binding serviceBinding = wireTarget.getBinding();
            for (Operation operation : sourceContract.getInterface().getOperations()) {
                Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
                if (targetOperation == null) {
                    throw new ServiceRuntimeException("No matching operation for " + operation.getName()
                        + " is found in service "
                        + serviceComponent.getURI()
                        + "#"
                        + service.getName());
                }
                InvocationChain chain = new InvocationChainImpl(operation, targetOperation, false);
                if (operation.isNonBlocking()) {
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.runtime.RuntimeComponentContext#read(java.io.Reader)
     */
    public RuntimeComponent read(Reader reader) throws IOException {
        RuntimeComponent component = compositeActivator.getCompositeContext().read(reader);
        compositeActivator.configureComponentContext(component);
        return component;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    private ScopeContainer getConversationalScopeContainer(Message msg) {
        ScopeContainer scopeContainer = null;

        RuntimeComponent component = msg.getTo().getComponent();

        if (component instanceof ScopedRuntimeComponent) {
            ScopedRuntimeComponent scopedRuntimeComponent = (ScopedRuntimeComponent)component;
            ScopeContainer container = scopedRuntimeComponent.getScopeContainer();
View Full Code Here

    public <B> CallableReference<B> getServiceReference() {
        Message msgContext = ThreadMessageContext.getMessageContext();
        // FIXME: [rfeng] Is this the service reference matching the caller side?
        EndpointReference to = msgContext.getTo();
        RuntimeComponentService service = (RuntimeComponentService) to.getContract();
        RuntimeComponent component = (RuntimeComponent) to.getComponent();
       
        CallableReference<B> callableReference = component.getComponentContext().getCallableReference(null, component, service);
        ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
        ((CallableReferenceExt<B>) callableReference).attachCallbackID(parameters.getCallbackID());
        ((CallableReferenceExt<B>) callableReference).attachConversation(parameters.getConversationID());
        return callableReference;
    }
View Full Code Here

        if (message != null) {
            EndpointReference to = message.getTo();
            if (to == null) {
                return null;
            }
            RuntimeComponent component = message.getTo().getComponent();
            return component;
        }
        return null;
    }
View Full Code Here

    /**
     * @return
     */
    public static CompositeActivator getCurrentCompositeActivator() {
        RuntimeComponent component = getCurrentComponent();
        if (component != null) {
            ComponentContextExt context = (ComponentContextExt)component.getComponentContext();
            return context.getCompositeActivator();
        }
        return null;
    }
View Full Code Here

    private void addCallbackInterfaceInterceptors(RuntimeWire wire) {
        Contract contract = wire.getSource().getContract();
        if (!(contract instanceof RuntimeComponentReference)) {
            return;
        }
        RuntimeComponent component = wire.getSource().getComponent();
        Implementation implementation = component.getImplementation();
        if (!(implementation instanceof JavaImplementation)) {
            return;
        }
        JavaImplementation javaImpl = (JavaImplementation)implementation;
        EndpointReference callbackEndpoint = wire.getSource().getCallbackEndpoint();
View Full Code Here

            }
           
        } else {
            // It's the service wire
            RuntimeComponentService service = (RuntimeComponentService)endpoint.getService();
            RuntimeComponent serviceComponent = (RuntimeComponent)endpoint.getComponent();
            Binding serviceBinding = endpoint.getBinding();
            for (Operation operation : sourceContract.getInterface().getOperations()) {
                Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
                if (targetOperation == null) {
                    throw new ServiceRuntimeException("No matching operation for " + operation.getName()
                        + " is found in service "
                        + serviceComponent.getURI()
                        + "#"
                        + service.getName());
                }
                InvocationChain chain = new InvocationChainImpl(operation, targetOperation, false);
                if (operation.isNonBlocking()) {
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.runtime.RuntimeComponentContext#read(java.io.Reader)
     */
    public RuntimeComponent read(Reader reader) throws IOException {
        RuntimeComponent component = compositeActivator.getCompositeContext().read(reader);
        compositeActivator.configureComponentContext(component);
        return component;
    }
View Full Code Here

TOP

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

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.