hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Maasing" <>
Subject int translator default not working?
Date Fri, 31 Aug 2007 14:40:21 GMT
Hivemind 1.1.1
I am trying to get the int translator to provide a default value in my
schema rules.
The schema looks somehting like this (abbreviated):
<schema id="myid">
	<element name="Semaphore">
		<attribute name="name" required="true" />
		<attribute name="maxPermits" />

		<attribute name="maxWait" translator="int,default=1000" />

			<create-object class="my.config.Config" />
			<read-attribute attribute="name" property="name" />
			<read-attribute attribute="maxPermits"
				property="maxPermits"  translator="int,default=25"/>
			<read-attribute attribute="maxWait" property="maxWait" />
			<invoke-parent method="addElement" />

I use it to configure an interceptor ( the interceptor factory points
to a schema-id ) :

<interceptor service-id="my.Interceptor">
	<Semaphore name="myName" />

The interceptor can retrieve the configuration class from its
parameters in the createInterceptor call
my.config.Config config = (my.config.Config) parameters.get(0);

However the maxPermits and maxWait both have 0 as the value. I would
assume that the attribute definition:
	<attribute name="maxWait" translator="int,default=1000" />
Would provide the default value.
I've tried to override the translator in the read-attribute rule (see
example above) but still no default value.

So, did I do something wrong?

View raw message