geronimo-xbean-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu" <akaras...@apache.org>
Subject Setting a property with List<? extends SocketAddress> objects
Date Wed, 27 Aug 2008 03:39:32 GMT
Hi all,

I've been trying to setup a module for MINA to enable easy use of
XBean-Spring with MINA classes.  I've been trying to figure out how to
compose the XML for a List property of a class.  The List contains elements
extending the java.net.SocketAddress class which I cannot alter the javadocs
of.  Here's a mock up of the situation:

class Foo
{
     ....

     public void setLocalAddress( SocketAddress address )
     ....

     public void setLocalAddresses( List<? extends SocketAddress> addresses)

     ....
}

The first property taking a single address is configured easily using the
following XML frag:

<foo  localAddress="192.168.0.1:10001" />

I'm using a InetSocketAddressEditor (PropertyEditor) which is registered
with Spring for SocketAddress.class.  It works great for the first
property.  However I have not been able to figure out much less find a way
to make the second property with the list of addresses work.  I've tried a
number of combinations but none have worked.  Here's a list of them:

<foo  localAddresses="192.168.0.1:10001 192.168.0.1:10002" />

---

<foo  localAddresses="192.168.0.1:10001, 192.168.0.1:10002" />

---

<foo  localAddresses="192.168.0.1:10001,192.168.0.1:10002" />

---

<foo>
   <localAddresses>
     <s:value>192.168.0.1:10001</s:value>
     <s:value>192.168.0.1:10002</s:value>
   </localAddresses>
</foo>

I think half the problem is in the fact that I cannot annotate the javadocs
of the SocketAddress in the JDK.  I was wondering if anyone has an idea on
how to get around this limitation.

Thanks,
Alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message