admin@glassfish.java.net

Re: Item for next Tuedays's iTeam Meeting

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Thu, 15 Apr 2010 11:07:36 -0700

Byron Nevins wrote on 04/15/2010 10:39 AM:
>
> On 4/15/2010 9:33 AM, Jerome Dochez wrote:
>>
>> there is already that mechanism in place.
>>
>> On startup the startup code determines which server and config are
>> current for this instance and stores those configuration with a
>> specific registration name in the habitat
>> (ServerEnvironment.DEFAULT_INSTANCE_NAME).
>>
> Unless there is some new Java rule -- that is impossible! Any String
> declared in an interface is automatically final and public. It can not
> be changed from the default value which is:
> String DEFAULT_INSTANCE_NAME = "default-instance-name";

You misunderstand.

The constant DEFAULT_INSTANCE_NAME is the *name* of the thing to inject.
The *value* of the thing that is injected is the instance, which is an
object of type Server. See the code in EnableCommand that Jerome referenced.