dev@glassfish.java.net

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

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Wed, 13 Aug 2008 15:46:51 -0700


Peter Williams 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...
Please don't do this.

OK.  I'll revise my guarantee:
It is guaranteed to be there no matter how you started the server.


NetBeans plugin does not use the launcher to start the server.  Nor is the launcher used if the user just invokes "java -jar ..." as mentioned in several existing blogs.

Or make a list of all such required properties and send to me so I can ensure they are there.  At least that'll solve half of it.

-Peter


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@glassfish.dev.java.net
For additional commands, e-mail: dev-help@glassfish.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: dev-help@glassfish.dev.java.net


-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.