private void processPropertyValues(LogicalComponent<?> component, WebComponentDefinition physical) { for (LogicalProperty property : component.getAllProperties().values()) { Document document = property.getValue(); if (document != null) { String name = property.getName(); boolean many = property.isMany(); PhysicalPropertyDefinition definition = new PhysicalPropertyDefinition(name, document, many); physical.setPropertyDefinition(definition); } } }
public Object resolveVariable(QName qName) { String name = qName.getLocalPart(); LogicalProperty property = parent.getProperties(name); if (property == null) { return null; } if (propertyValue.getType() != null && property.getType() != null && !propertyValue.getType().equals(property.getType())) { throw new PropertyTypeException("Property types are incompatible:" + name + " and " + propertyValue.getName()); } Document value = property.getValue(); if (value == null || value.getDocumentElement().getChildNodes().getLength() == 0) { return null; } // select the first value return value.getDocumentElement(); } };
private Builder(String name, LogicalComponent<?> parent) { property = new LogicalProperty(name, parent); property.name = name; }
private void processPropertyValues(LogicalComponent<?> component, PhysicalWebComponent physical) { for (LogicalProperty property : component.getAllProperties().values()) { String name = property.getName(); boolean many = property.isMany(); if (property.getXmlValue() != null) { Document document = property.getXmlValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).xmlValue(document).many(many).build(); physical.setProperty(physicalProperty); } else if (property.getInstanceValue() != null) { Object value = property.getInstanceValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).instanceValue(value).many(many).build(); physical.setProperty(physicalProperty); } } }
public void processPropertyValues(LogicalComponent<?> component, PhysicalPojoComponent pojoComponent) { for (LogicalProperty property : component.getAllProperties().values()) { String name = property.getName(); boolean many = property.isMany(); boolean required = property.isRequired(); if (property.getKey() != null) { PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).key(property.getKey()).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } else if (property.getXmlValue() != null) { Document document = property.getXmlValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).xmlValue(document).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } else if (property.getInstanceValue() != null) { Object value = property.getInstanceValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).instanceValue(value).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } } } }
return null; if (propertyValue.getType() != null && property.getType() != null && !propertyValue.getType().equals(property.getType())) { throw new PropertyTypeException("Property types are incompatible:" + name + " and " + propertyValue.getName()); Document value = property.getXmlValue(); if (value == null || value.getDocumentElement().getChildNodes().getLength() == 0) { return null;
/** * Sets a collection of resolved property values * * @param property the parsed property */ public void setProperties(LogicalProperty property) { properties.put(property.getName(), property); }
private void processPropertyValues(LogicalComponent<?> component, PhysicalSpringComponent springComponent) { for (LogicalProperty property : component.getAllProperties().values()) { String name = property.getName(); boolean many = property.isMany(); if (property.getXmlValue() != null) { Document document = property.getXmlValue(); ComponentType componentType = component.getDefinition().getImplementation().getComponentType(); QName type = componentType.getProperties().get(property.getName()).getType(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).xmlValue(document).many(many).type(type).build(); springComponent.setProperty(physicalProperty); } else if (property.getInstanceValue() != null) { Object value = property.getInstanceValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).instanceValue(value).many(many).build(); springComponent.setProperty(physicalProperty); } } }
public void processPropertyValues(LogicalComponent<?> component, PhysicalPojoComponent pojoComponent) { for (LogicalProperty property : component.getAllProperties().values()) { String name = property.getName(); boolean many = property.isMany(); boolean required = property.isRequired(); if (property.getKey() != null) { PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).key(property.getKey()).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } else if (property.getXmlValue() != null) { Document document = property.getXmlValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).xmlValue(document).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } else if (property.getInstanceValue() != null) { Object value = property.getInstanceValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).instanceValue(value).required(required).many(many).build(); pojoComponent.setProperty(physicalProperty); } } } }
return null; if (propertyValue.getType() != null && property.getType() != null && !propertyValue.getType().equals(property.getType())) { throw new PropertyTypeException("Property types are incompatible:" + name + " and " + propertyValue.getName()); Document value = property.getXmlValue(); if (value == null || value.getDocumentElement().getChildNodes().getLength() == 0) { return null;
private void processPropertyValues(LogicalComponent<?> component, PhysicalSpringComponent springComponent) { for (LogicalProperty property : component.getAllProperties().values()) { String name = property.getName(); boolean many = property.isMany(); if (property.getXmlValue() != null) { Document document = property.getXmlValue(); ComponentType componentType = component.getDefinition().getImplementation().getComponentType(); QName type = componentType.getProperties().get(property.getName()).getType(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).xmlValue(document).many(many).type(type).build(); springComponent.setProperty(physicalProperty); } else if (property.getInstanceValue() != null) { Object value = property.getInstanceValue(); PhysicalProperty physicalProperty = PhysicalProperty.Builder.newBuilder(name).instanceValue(value).many(many).build(); springComponent.setProperty(physicalProperty); } } }
public void processPropertyValues(LogicalComponent<?> component, PojoComponentDefinition physical) { for (LogicalProperty property : component.getAllProperties().values()) { Document document = property.getValue(); if (document != null) { String name = property.getName(); boolean many = property.isMany(); PhysicalPropertyDefinition definition = new PhysicalPropertyDefinition(name, document, many); physical.setPropertyDefinition(definition); } } } }
public void bootSystem() throws InitializationException { try { // load the system composite Composite composite = BootstrapCompositeFactory.createSystemComposite(systemCompositeUrl, bootContribution, bootClassLoader, implementationProcessor); // create the property and merge it into the composite LogicalProperty logicalProperty = new LogicalProperty("systemConfig", systemConfig, false, domain); domain.setProperties(logicalProperty); // deploy the composite to the runtime domain runtimeDomain.include(composite, false); } catch (DeploymentException e) { throw new InitializationException(e); } }
private void processPropertyValues(LogicalComponent<?> component, SpringComponentDefinition physical) { for (LogicalProperty property : component.getAllProperties().values()) { Document document = property.getValue(); if (document != null) { String name = property.getName(); boolean many = property.isMany(); ComponentType componentType = component.getDefinition().getImplementation().getComponentType(); QName type = componentType.getProperties().get(property.getName()).getType(); PhysicalPropertyDefinition definition = new PhysicalPropertyDefinition(name, document, many, type); physical.setPropertyDefinition(definition); } } }
private void includeProperties(Composite composite, LogicalCompositeComponent domain, InstantiationContext context) { for (Property property : composite.getProperties().values()) { String name = property.getName(); if (domain.getAllProperties().containsKey(name)) { DuplicateProperty error = new DuplicateProperty(name, domain); context.addError(error); } else { Document value = property.getDefaultValue(); boolean many = property.isMany(); QName type = property.getType(); LogicalProperty logicalProperty = new LogicalProperty(name, value, many, type, domain); domain.setProperties(logicalProperty); } } }
QName type = property.getType(); if (type == null) { logicalProperty = new LogicalProperty(name, value, many, component); } else { logicalProperty = new LogicalProperty(name, value, many, type, component);