Package org.apache.tuscany.container.spring.model

Examples of org.apache.tuscany.container.spring.model.SpringImplementation


        String locationAttr = reader.getAttributeValue(null, "location");
        if (locationAttr == null && !contextProvided()) {
            throw new MissingResourceException("No location supplied");
        }

        SpringImplementation implementation = new SpringImplementation();
        ClassLoader classLoader = deploymentContext.getClassLoader();
        if (!contextProvided()) {
            implementation.setApplicationResource(getApplicationContextResource(locationAttr, classLoader));
        }
        registry.loadComponentType(parent, implementation, deploymentContext);
        SpringComponentType type = implementation.getComponentType();
        while (true) {
            switch (reader.next()) {
                case START_ELEMENT:
                    QName qname = reader.getName();
                    if (SERVICE_ELEMENT.equals(qname)) {
View Full Code Here


    public Component build(CompositeComponent parent,
                           ComponentDefinition<SpringImplementation> componentDefinition,
                           DeploymentContext deploymentContext) throws BuilderConfigException {
        String name = componentDefinition.getName();
        SpringImplementation implementation = componentDefinition.getImplementation();
        AbstractApplicationContext applicationContext = implementation.getComponentType().getApplicationContext();
        SpringCompositeComponent component =
            new SpringCompositeComponent(name, applicationContext, parent, connector, null);
        CompositeComponentType<BoundServiceDefinition<? extends Binding>,
            BoundReferenceDefinition<? extends Binding>,
            ? extends Property> componentType = implementation.getComponentType();

        // We still need to set the target invoker as opposed to having the connector do it since the
        // Spring context is "opaque" to the wiring fabric. In other words, the Spring context does not expose
        // its beans as SCA components to the connector to wire the services to
        for (BoundServiceDefinition<? extends Binding> serviceDefinition : componentType.getServices().values()) {
View Full Code Here

     * Verfies basic build of a spring context
     */
    @SuppressWarnings("unchecked")
    public void testBuild() throws Exception {
        // Create an assembly model consisting of a component implemented by Spring
        SpringImplementation impl = new SpringImplementation(new SpringComponentType(createContext()));
        ComponentDefinition<SpringImplementation> componentDefinition =
            new ComponentDefinition<SpringImplementation>("spring", impl);

        // Configure the mock builder registry
        BuilderRegistry registry = createNiceMock(BuilderRegistry.class);
View Full Code Here

     * <code>sca:service</code> tag is specified in the Spring application.xml
     */
    @SuppressWarnings("unchecked")
    public void testImplicitServiceWiring() throws Exception {
        // Create an assembly model consisting of a component implemented by Spring
        SpringImplementation impl = new SpringImplementation(createComponentType());
        ComponentDefinition<SpringImplementation> componentDefinition =
            new ComponentDefinition<SpringImplementation>("spring", impl);

        // Create a service instance that the mock builder registry will return
        WireService wireService = ArtifactFactory.createWireService();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.container.spring.model.SpringImplementation

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.