One solution would be to add an array of whatever type it is, rather than
the individual values. So, instead of:
QName fooName = ...
Foo fooValue1 = ...
Foo fooValue2 = ...
message.addMessageContent(fooName, fooValue1);
message.addMessageContent(fooName, fooValue2); // doesn't work
you could do:
Foo[] fooValues = new Foo[]{ fooValue1, fooValue2 };
message.addMessageContent(fooName, fooValues);
then, on the consumer side, you would do:
Foo[] fooValues = message.getMessageContent(fooName, Foo[].class);
Dan
"Rosberg Mattias" <[EMAIL PROTECTED]> wrote on 03/20/2007
06:02:35 AM:
> In my system I have a number of properties changing very rapidly.
Instead of
> sending a SetPropertiesRequest on every change I collect the values in
arrays
> and send it every second or every ten seconds or so.
>
> I noticed that I only received one value on the consumer side so I used
the
> debugger to track down the problem. It seems the problem is in
> SimpleNotificationMessage.addMessageContent(). My problem is that the
values
> in the array all have the same QName as name. Since the message content
is
> represented by a LinkedHashMap my values gets overwritten everytime the
> addMessageContent method is called since the all have the same key.
>
> One solution would be to represent the message content with another
Collection
> class allowing multiple properties with the same key. Any comments or
suggestions?
>
> By the way, I'm using the latest nightly build for Muse 2.2.0.
>
> /Mattias
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]