You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Markus Wiederkehr <ma...@gmail.com> on 2005/03/02 14:34:12 UTC

configuration

I would like to implement a service that requires some configuration.
Amongst other things it needs to know the location of a certain file.

So I have defined an element for this purpose:

<element name="file">
  <attribute name="location" required="true"/>
  ...
</element>

It doesn't make sense to specify the file location more than once. But
as far as I can see there is no way to prevent it:

<contribution configuration-id="Test">
  <file location="file1"/>
  <file location="file2"/>
</contribution>

Using <configuration-point occurs="1"> does not help. I think it would
be better to have something like <element occurs="1"> for situations
like this.

If Hivemind knew that a certain element can only occur once it would
also be possible to inject the corresponding object directly into the
service, instead of injecting a list of objects. Of course this would
also require that the configuration schema defines only one element.

Any thoughts?

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: configuration

Posted by James Carman <ja...@carmanconsulting.com>.
Actually, that's the documentation for the current development version of
HiveMind (the HEAD branch in CVS).  The default documentation you see when
you click the link from the Jakarta site is for HiveMind 1.0.  So, you
wouldn't have seen that if you went to the default documentation site, as it
is a new feature in 1.1.  The 1.1 releases are pretty stable if you want to
use them.  At least, none of our test cases fail. :-)


-----Original Message-----
From: Zachary Pinter [mailto:zpinter@gmail.com] 
Sent: Wednesday, March 02, 2005 9:34 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: configuration


My bad,

I should have checked the documentation more closely before posting.
Hopefully this will help Marcus as well.

-- 
Zachary Pinter
z@absolutez.net

On Wed, 2 Mar 2005 09:07:03 -0500, James Carman <ja...@carmanconsulting.com>
wrote:
> You can access configurations as a map in HiveMind 1.1?
> 
> http://jakarta.apache.org/hivemind/current/configurations.html#Accessi
> ng+Con
> figuration+Points
> 
> Does that help?  Maybe not immediately, but is that what you are 
> asking for?
> 
> -----Original Message-----
> From: Zachary Pinter [mailto:zpinter@gmail.com]
> Sent: Wednesday, March 02, 2005 9:01 AM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: configuration
> 
> Continuing with this question,
> 
> Is it possible to do a hashmap type configuration element where 
> instead of looping through a list of objects that have key/value 
> attributes, you can just pass a key into a hashmap and get the value?
> 
> So, for single properties you can do get("filelocation") and have it 
> return an object?
> 
> --
> Zachary Pinter
> z@absolutez.net
> 
> On Wed, 2 Mar 2005 14:34:12 +0100, Markus Wiederkehr 
> <ma...@gmail.com> wrote:
> > I would like to implement a service that requires some 
> > configuration. Amongst other things it needs to know the location of 
> > a certain file.
> >
> > So I have defined an element for this purpose:
> >
> > <element name="file">
> >   <attribute name="location" required="true"/>
> >   ...
> > </element>
> >
> > It doesn't make sense to specify the file location more than once. 
> > But as far as I can see there is no way to prevent it:
> >
> > <contribution configuration-id="Test">
> >   <file location="file1"/>
> >   <file location="file2"/>
> > </contribution>
> >
> > Using <configuration-point occurs="1"> does not help. I think it 
> > would be better to have something like <element occurs="1"> for 
> > situations like this.
> >
> > If Hivemind knew that a certain element can only occur once it would 
> > also be possible to inject the corresponding object directly into 
> > the service, instead of injecting a list of objects. Of course this 
> > would also require that the configuration schema defines only one 
> > element.
> >
> > Any thoughts?
> >
> > Markus
> >
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: configuration

Posted by Zachary Pinter <zp...@gmail.com>.
My bad,

I should have checked the documentation more closely before posting.
Hopefully this will help Marcus as well.

-- 
Zachary Pinter
z@absolutez.net

On Wed, 2 Mar 2005 09:07:03 -0500, James Carman
<ja...@carmanconsulting.com> wrote:
> You can access configurations as a map in HiveMind 1.1?
> 
> http://jakarta.apache.org/hivemind/current/configurations.html#Accessing+Con
> figuration+Points
> 
> Does that help?  Maybe not immediately, but is that what you are asking for?
> 
> -----Original Message-----
> From: Zachary Pinter [mailto:zpinter@gmail.com]
> Sent: Wednesday, March 02, 2005 9:01 AM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: configuration
> 
> Continuing with this question,
> 
> Is it possible to do a hashmap type configuration element where instead of
> looping through a list of objects that have key/value attributes, you can
> just pass a key into a hashmap and get the value?
> 
> So, for single properties you can do get("filelocation") and have it return
> an object?
> 
> --
> Zachary Pinter
> z@absolutez.net
> 
> On Wed, 2 Mar 2005 14:34:12 +0100, Markus Wiederkehr
> <ma...@gmail.com> wrote:
> > I would like to implement a service that requires some configuration.
> > Amongst other things it needs to know the location of a certain file.
> >
> > So I have defined an element for this purpose:
> >
> > <element name="file">
> >   <attribute name="location" required="true"/>
> >   ...
> > </element>
> >
> > It doesn't make sense to specify the file location more than once. But
> > as far as I can see there is no way to prevent it:
> >
> > <contribution configuration-id="Test">
> >   <file location="file1"/>
> >   <file location="file2"/>
> > </contribution>
> >
> > Using <configuration-point occurs="1"> does not help. I think it would
> > be better to have something like <element occurs="1"> for situations
> > like this.
> >
> > If Hivemind knew that a certain element can only occur once it would
> > also be possible to inject the corresponding object directly into the
> > service, instead of injecting a list of objects. Of course this would
> > also require that the configuration schema defines only one element.
> >
> > Any thoughts?
> >
> > Markus
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: configuration

Posted by James Carman <ja...@carmanconsulting.com>.
You can access configurations as a map in HiveMind 1.1?

http://jakarta.apache.org/hivemind/current/configurations.html#Accessing+Con
figuration+Points

Does that help?  Maybe not immediately, but is that what you are asking for?

-----Original Message-----
From: Zachary Pinter [mailto:zpinter@gmail.com] 
Sent: Wednesday, March 02, 2005 9:01 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: configuration


Continuing with this question,

Is it possible to do a hashmap type configuration element where instead of
looping through a list of objects that have key/value attributes, you can
just pass a key into a hashmap and get the value?

So, for single properties you can do get("filelocation") and have it return
an object?

-- 
Zachary Pinter
z@absolutez.net

On Wed, 2 Mar 2005 14:34:12 +0100, Markus Wiederkehr
<ma...@gmail.com> wrote:
> I would like to implement a service that requires some configuration. 
> Amongst other things it needs to know the location of a certain file.
> 
> So I have defined an element for this purpose:
> 
> <element name="file">
>   <attribute name="location" required="true"/>
>   ...
> </element>
> 
> It doesn't make sense to specify the file location more than once. But 
> as far as I can see there is no way to prevent it:
> 
> <contribution configuration-id="Test">
>   <file location="file1"/>
>   <file location="file2"/>
> </contribution>
> 
> Using <configuration-point occurs="1"> does not help. I think it would 
> be better to have something like <element occurs="1"> for situations 
> like this.
> 
> If Hivemind knew that a certain element can only occur once it would 
> also be possible to inject the corresponding object directly into the 
> service, instead of injecting a list of objects. Of course this would 
> also require that the configuration schema defines only one element.
> 
> Any thoughts?
> 
> Markus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: configuration

Posted by Zachary Pinter <zp...@gmail.com>.
Continuing with this question,

Is it possible to do a hashmap type configuration element where
instead of looping through a list of objects that have key/value
attributes, you can just pass a key into a hashmap and get the value?

So, for single properties you can do get("filelocation") and have it
return an object?

-- 
Zachary Pinter
z@absolutez.net

On Wed, 2 Mar 2005 14:34:12 +0100, Markus Wiederkehr
<ma...@gmail.com> wrote:
> I would like to implement a service that requires some configuration.
> Amongst other things it needs to know the location of a certain file.
> 
> So I have defined an element for this purpose:
> 
> <element name="file">
>   <attribute name="location" required="true"/>
>   ...
> </element>
> 
> It doesn't make sense to specify the file location more than once. But
> as far as I can see there is no way to prevent it:
> 
> <contribution configuration-id="Test">
>   <file location="file1"/>
>   <file location="file2"/>
> </contribution>
> 
> Using <configuration-point occurs="1"> does not help. I think it would
> be better to have something like <element occurs="1"> for situations
> like this.
> 
> If Hivemind knew that a certain element can only occur once it would
> also be possible to inject the corresponding object directly into the
> service, instead of injecting a list of objects. Of course this would
> also require that the configuration schema defines only one element.
> 
> Any thoughts?
> 
> Markus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org