void CommunicatorDescriptorBuilder::addAdapter(const XmlAttributesHelper& attrs) { AdapterDescriptor desc; desc.name = attrs("name"); if(attrs.contains("id")) { desc.id = attrs("id"); } else { string fqn = "${server}"; if(ServiceDescriptorPtr::dynamicCast(_descriptor)) { fqn += ".${service}"; } desc.id = fqn + "." + desc.name; } desc.replicaGroupId = attrs("replica-group", ""); desc.priority = attrs("priority", ""); desc.registerProcess = attrs.asBool("register-process", false); if(desc.id == "") { throw "empty `id' for adapter `" + desc.name + "'"; } desc.serverLifetime = attrs.asBool("server-lifetime", true); _descriptor->adapters.push_back(desc); addProperty(_hiddenProperties, desc.name + ".Endpoints", attrs("endpoints", "default")); if(attrs.contains("proxy-options")) { addProperty(_hiddenProperties, desc.name + ".ProxyOptions", attrs("proxy-options", "")); } }
void PropertySetDescriptorBuilder::addPropertySet(const XmlAttributesHelper& attrs) { if(attrs.contains("id") || !attrs.contains("refid")) { throw "only <properties refid=\"\"> can be a child of a <properties> element"; } if(!_descriptor.properties.empty()) { throw "<properties refid=\"\"> can't be defined after a <property> element"; } _descriptor.references.push_back(attrs("refid")); _inPropertySetRef = true; }
void CommunicatorDescriptorBuilder::addLog(const XmlAttributesHelper& attrs) { if(attrs.contains("property")) { addProperty(_hiddenProperties, attrs("property"), attrs("path")); } _descriptor->logs.push_back(attrs("path")); }
void NodeDescriptorBuilder::addVariable(const XmlAttributesHelper& attrs) { if(!_application.isOverride(attrs("name"))) { _descriptor.variables[attrs("name")] = attrs("value", ""); } else { attrs.contains("value"); // NOTE: prevents warning about "value" not being used. } }
void CommunicatorDescriptorBuilder::addAllocatable(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); object.id = _communicator->stringToIdentity(attrs("identity")); if(attrs.contains("property")) { addProperty(_hiddenProperties, attrs("property"), attrs("identity")); } _descriptor->adapters.back().allocatables.push_back(object); }
void ApplicationDescriptorBuilder::addObject(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); object.id = _communicator->stringToIdentity(attrs("identity")); if(attrs.contains("property")) { throw "property attribute is not allowed in object descriptors from a replica group"; } _descriptor.replicaGroups.back().objects.push_back(object); }
void CommunicatorDescriptorBuilder::addObject(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); object.id = Ice::stringToIdentity(attrs("identity")); object.proxyOptions = attrs("proxy-options", ""); if(attrs.contains("property")) { addProperty(_hiddenProperties, attrs("property"), attrs("identity")); } _descriptor->adapters.back().objects.push_back(object); }
void TemplateDescriptorBuilder::addParameter(const XmlAttributesHelper& attrs) { if(find(_descriptor.parameters.begin(), _descriptor.parameters.end(), attrs("name")) != _descriptor.parameters.end()) { throw "duplicate parameter `" + attrs("name") + "'"; } _descriptor.parameters.push_back(attrs("name")); if(attrs.contains("default")) { _descriptor.parameterDefaults.insert(make_pair(attrs("name"), attrs("default", ""))); } }