users@glassfish.java.net

How to get glassfish host info for deployed application?

From: <glassfish_at_javadesktop.org>
Date: Fri, 02 Mar 2007 09:39:29 PST

I did a little bit of searching in the forum, but maybe I was using the wrong terms.

What I want to do seems like it ought to be easy, but...

Say I have a lab with multiple machines, all running Glassfish -- say v2 M4.

I have used netbeans to create a web service. I can deploy to my co-located glassfish from netbeans itself. For other glassfish instances, I can drop the war file in the auto-deploy folder.

This works.

But I want to be able, from inside the running web service app, to determine its host context -- at least the host name (or IP number) and preferably the port number.

I thought perhaps that WSServletContextListener might be useful in this regard but I have not been able to get information about the methods that might be available to me.

Information in:

http://developers.sun.com/prodtech/appserver/reference/techart/ws_mgmt.html

seems like it ought to be relevant too but there is nothing that jumps right out at me (being a novice and all).

I am looking for a pointer as to where/how to introspect on the app container hosting my deployed service. I need to be able to disambiguate among the same web service deployed to multiple places to support some experiments I wish to run.

Thanks for any help.
[Message sent by forum member 'jjsban' (jjsban)]

http://forums.java.net/jive/thread.jspa?messageID=206006