Examples of SpringImplementation


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

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

    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

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

     * 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

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

     * <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

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

     * in the METAINF/spring directory.
     */
    public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {

        // Create the Spring implementation
        SpringImplementation springImplementation = null;

        // Read the location attribute for the spring implementation
        String springLocation = reader.getAttributeValue(null, LOCATION);
        if (springLocation != null) {
          springImplementation = new SpringImplementation();
          springImplementation.setLocation(springLocation);
          springImplementation.setUnresolved(true);
            processComponentType(springImplementation);
        } else {
          error("LocationAttributeMissing", reader);
            //throw new ContributionReadException(MSG_LOCATION_MISSING);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

     * in the METAINF/spring directory.
     */
    public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {

        // Create the Spring implementation
        SpringImplementation springImplementation = null;

        // Read the location attribute for the spring implementation
        String springLocation = reader.getAttributeValue(null, LOCATION);
        if (springLocation != null) {
          springImplementation = new SpringImplementation();
          springImplementation.setLocation(springLocation);
          springImplementation.setUnresolved(true);
            processComponentType(springImplementation);
        } else {
          error("LocationAttributeMissing", reader);
            //throw new ContributionReadException(MSG_LOCATION_MISSING);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

     */
    public SpringImplementation read(XMLStreamReader reader, ProcessorContext context)
        throws ContributionReadException, XMLStreamException {

        // Create the Spring implementation
        SpringImplementation springImplementation = null;

        // Read the location attribute for the spring implementation
        String springLocation = getURIString(reader, LOCATION);
        if (springLocation != null) {
            springImplementation = new SpringImplementation();
            springImplementation.setLocation(springLocation);
            springImplementation.setUnresolved(true);
            processComponentType(springImplementation);
        } else {
            error(context.getMonitor(), "LocationAttributeMissing", reader);
            //throw new ContributionReadException(MSG_LOCATION_MISSING);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

        this.springContext = springContext;
        this.operation = operation;

        // From the component and the service, identify the Spring Bean which is the target
        SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
        beanElement = theImplementation.getBeanFromService(service.getService());

        if (beanElement == null) {
            badInvoker = true;
            return;
        }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

        this.springContext = springContext;
        this.operation = operation;

        // From the component and the service, identify the Spring Bean which is the target
        SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
        beanElement = theImplementation.getBeanFromService(service.getService());

        if (beanElement == null) {
            badInvoker = true;
            return;
        }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.spring.SpringImplementation

     * in the METAINF/spring directory.
     */
    public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {

        // Create the Spring implementation
        SpringImplementation springImplementation = null;

        // Read the location attribute for the spring implementation
        String springLocation = reader.getAttributeValue(null, LOCATION);
        if (springLocation != null) {
          springImplementation = new SpringImplementation();
          springImplementation.setLocation(springLocation);
          springImplementation.setUnresolved(true);
            processComponentType(springImplementation);
        } else {
          error("LocationAttributeMissing", reader);
            //throw new ContributionReadException(MSG_LOCATION_MISSING);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.