dev@glassfish.java.net

Re: [GFv3] How do I get installDir location?

From: Ludovic Champenois <Ludovic.Champenois_at_Sun.COM>
Date: Wed, 13 Aug 2008 15:45:36 -0700

Tim Quinn wrote:
> Byron Nevins wrote:
>> The Implementation of ServerEnvironment is problematic because there
>> is plenty of functionality that is available in the impl. class but
>> not in the interface. Therefore the impl class is used everywhere
>> instead of the interface.
>>
>> Here's how you get at any such well-known properties:
>>
>> ServerEnvironmentImpl.getProps().get(SystemPropertyConstants.INSTALL_ROOT_PROPERTY);
>>
>>
>> You could also just do System.getProperty(...) -- it is guaranteed to
>> be there and correct -- if you used Launcher to startup the server.
>> It is frowned upon though...
> Of course, the module name in which we find ServerEnvironment is
> telling: Public API of GlassFish v3.
> If we truly intend this to be an interface which developers of new
> containers can use, then if there is something they legitimately need
> that is not present in the interface (or some other public interface)
> then we should be adding it to the interface rather than "cheating"
> and using the implementation directly or, worse, getting the property
> directly... How well is that going to work in the embedded case??
>
> Sahoo, just to satisfy my curiosity, did you want this location for
> some particular purpose or did you just notice it was not exposed
> through the interface and were curious why?
Requesting the location of a running server knowing its machine name and
port number is critical for NetBeans or eclipse when you can register 10
different servers (only 1 being running of course) on the same machine.
This way, we know exactly which one is running and can display the
correct status on these 10 different installations on the same machine
with the same port number. (The location attribute gives us the extra
data for a unique primary key in our internal registry of registered
servers)
Otherwise, we would display 10 runtime nodes in NetBeans as the running
status which would be a bug.

Hope this help,

Ludo
>
> - Tim
>>
>>
>> Sahoo wrote:
>>> Why does ServerEnvironment not have an API t to provide the
>>> install_dir location? This information is available in asenv.conf
>>> file as the value of AS_INSTALL property.
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>