activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: Changing the ManagmentContext to point to non-localhost
Date Thu, 23 Jul 2009 23:57:01 GMT
On Fri, Jul 17, 2009 at 7:38 AM, Gary Tully<gary.tully@gmail.com> wrote:
> I guess it should be consistent with what TcpTransportServer does when
> binding to a broker Url.
> There is an open discussion in
> http://issues.apache.org/activemq/browse/AMQ-2094 and I think the
> upshot of that is to do the minimum interpretation of what is passed
> in and let the OS resolve the string.
>
> See org.apache.activemq.transport.tcp.TcpTransportServer.bind()
>
>        URI bind = getBindLocation();
>        String host = bind.getHost();
>        host = (host == null || host.length() == 0) ? "localhost" : host;
>        InetAddress addr = InetAddress.getByName(host);

Good point, Gary. I just decided to use the same logic. Here is the
getHostName() method:

    public String getHostName() {
    	String resolvedHostName = (hostName == null || hostName.length()
== 0) ? "localhost" : hostName;
        return resolvedHostName;
    }

Any thoughts? If not, I'll commit the change.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Mime
View raw message