예제 #1
0
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", ""));
    }
}
예제 #2
0
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;
}
예제 #3
0
void
ServerDescriptorBuilder::init(const ServerDescriptorPtr& desc, const XmlAttributesHelper& attrs)
{
    CommunicatorDescriptorBuilder::init(desc, attrs);
    _descriptor = desc;
    _descriptor->id = attrs("id");
    _descriptor->exe = attrs("exe");
    _descriptor->activationTimeout = attrs("activation-timeout", "");
    _descriptor->deactivationTimeout = attrs("deactivation-timeout", "");
    _descriptor->pwd = attrs("pwd", "");
    _descriptor->activation = attrs("activation", "manual");
    _descriptor->applicationDistrib = attrs.asBool("application-distrib", true);
    _descriptor->allocatable = attrs.asBool("allocatable", false);
    _descriptor->user = attrs("user", "");
}
예제 #4
0
void
CommunicatorDescriptorBuilder::addLog(const XmlAttributesHelper& attrs)
{
    if(attrs.contains("property"))
    {
        addProperty(_hiddenProperties, attrs("property"), attrs("path"));
    }
    _descriptor->logs.push_back(attrs("path"));
}
예제 #5
0
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.
    }
}
예제 #6
0
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);
}
예제 #7
0
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);
}
예제 #8
0
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);
}
예제 #9
0
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", "")));
    }
}
예제 #10
0
ServiceInstanceDescriptorBuilder::ServiceInstanceDescriptorBuilder(const XmlAttributesHelper& attrs)
{
    _descriptor._cpp_template = attrs("template");
    _descriptor.parameterValues = attrs.asMap();
    _descriptor.parameterValues.erase("template");
}