[activemq-dev] Adding InetSocketAddress property to ConnectorGBean

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-dev] Adding InetSocketAddress property to ConnectorGBean

ammulder
        I've put a change in to Geronimo that prints ports that the server
is listening on during the startup sequence.  It creates that list by
looking for attributes of type java.net.InetSocketAddress in the GBeans.  
So I'd like to add such an attribute to the ActiveMQConnectorGBean.  It
would return null for in-VM connectors and return a value with listen host
and port for TCP connectors.

        The problem is, I'm not sure how to get the listen host and listen
port for a particular connector URL from the broker.  It looks like I
could get the TransportServerChannel, but then I'd need to cast it to a
TCP-specific implementation (what would that be?) to get the listen
address and port.  Or else try parsing the URL, but that seems less
reliable.

        Any tips?

Thanks,
        Aaron
Reply | Threaded
Open this post in threaded view
|

Re: [activemq-dev] Adding InetSocketAddress property to ConnectorGBean

jstrachan
On 5 Jul 2005, at 02:43, Aaron Mulder wrote:
>     I've put a change in to Geronimo that prints ports that the server
> is listening on during the startup sequence.

Great! :)


> It creates that list by
> looking for attributes of type java.net.InetSocketAddress in the  
> GBeans.
> So I'd like to add such an attribute to the  
> ActiveMQConnectorGBean.  It
> would return null for in-VM connectors and return a value with  
> listen host
> and port for TCP connectors.

Cool

>     The problem is, I'm not sure how to get the listen host and listen
> port for a particular connector URL from the broker.  It looks like I
> could get the TransportServerChannel, but then I'd need to cast it  
> to a
> TCP-specific implementation (what would that be?) to get the listen
> address and port.  Or else try parsing the URL, but that seems less
> reliable.

I've added a method to TransportServerChannel called getSocketAddress
() which returns an InetSocketAddress, which may be null - so you  
should be able to expose that in the ActiveMQConnectorGBean if you like?

James
-------
http://radio.weblogs.com/0112098/