Archived

This forum has been archived. Please start a new discussion on GitHub.

wait-for-activation and register-process can not be templated

version:Ice-3.0.1

if write an adapter template like this
         <adapter name="DefaultAdapter" 
                  id="${server}.DefaultAdapter"
                  endpoints="${endpoints}" 
                  wait-for-activation="${actication}" 
                  register-process="${register}">
will result in errors:
invalid attribute 'wait-for-activation': value is not 'false' or 'true'
in src/IceGrid/DescriptorBuilder.cpp line 99
bool
XmlAttributesHelper::asBool(const string& name) const
{
    _used.insert(name);
    IceXML::Attributes::const_iterator p = _attributes.find(name);
    if(p == _attributes.end())
    {
        throw "missing attribute '" + name + "'";
        return true; // Keep the compiler happy.
    }
    else if(p->second == "true")//hard code here??
    {
        return true;
    }
    else if(p->second == "false")//hard code here??
    {
        return false;
    }
    else
    {
        throw "invalid attribute `" + name + "': value is not 'false' or 'true'";
        return true; // Keep the compiler happy.
    }
}
Is this a bug or you just don't want these properties to be templated?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    We didn't really think of any good reasons why these attributes would need to be defined with a variable or parameter since these attributes really depends on the implementation of the server. However, if you explain a little more why you need to use parameters or variables to define these attributes, we might change our mind ;).

    Cheers,
    Benoit.
  • benoit wrote:
    Hi,

    We didn't really think of any good reasons why these attributes would need to be defined with a variable or parameter since these attributes really depends on the implementation of the server. However, if you explain a little more why you need to use parameters or variables to define these attributes, we might change our mind ;).

    Cheers,
    Benoit.
    I think a server template should assume nothing about how the server really implemented,so the more elements can be defined with parameters, more flexiable the template is.No other reasons,I just feel strange about that.:)
    Cheers,
    Yunqiao Yin