Package org.apache.tuscany.spi.model

Examples of org.apache.tuscany.spi.model.PropertyValue


    private void processProperties(Map<String, PropertyValue<?>> propertyValues,
                                   Collection<JavaMappedProperty<?>> properties,
                                   SystemAtomicComponentImpl component) {
        for (JavaMappedProperty<?> property : properties) {
            PropertyValue value = propertyValues.get(property.getName());
            ObjectFactory<?> factory;
            if (value != null) {
                factory = value.getValueFactory();
            } else {
                factory = property.getDefaultValueFactory();
            }
            if (factory != null) {
                component.addPropertyFactory(property.getName(), factory);
View Full Code Here


            for (Property<?> aProperty : properties.values()) {
                if (propertyValues.get(aProperty.getName()) == null) {
                    if (aProperty.getOverride() == OverrideOptions.MUST) {
                        throw new MissingMustOverridePropertyException(aProperty.getName());
                    } else {
                        PropertyValue propertyValue = new PropertyValue();
                        propertyValue.setName(aProperty.getName());
                        propertyValue.setValue(aProperty.getDefaultValue());
                        // propertyValue.setValueFactory(aProperty.getDefaultValueFactory());
                        propertyValue.setValueFactory(new SimplePropertyObjectFactory(aProperty,
                            propertyValue
                                .getValue()));
                        propertyValues.put(aProperty.getName(), propertyValue);
                    }
                }
            }
View Full Code Here

        type.setImplementationScope(Scope.STATELESS);
        JavaImplementation impl = new JavaImplementation();
        impl.setComponentType(type);
        impl.setImplementationClass(Foo.class);
        ComponentDefinition<JavaImplementation> definition = new ComponentDefinition<JavaImplementation>(impl);
        PropertyValue propertyValue = new PropertyValue(property.getName(), property.getDefaultValueFactory());
        definition.getPropertyValues().put(property.getName(), propertyValue);
        AtomicComponent component = builder.build(parent, definition, deploymentContext);
        JavaBuilderPropertyTestCase.Foo foo = (JavaBuilderPropertyTestCase.Foo) component.createInstance();
        assertEquals("foo", foo.getTest());
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.model.PropertyValue

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.