admin@glassfish.java.net

Re: ServerEnvironment.DEFAULT_INSTANCE_NAME

From: Jerome Dochez <jerome.dochez_at_oracle.com>
Date: Mon, 17 May 2010 13:44:35 -0700

On May 17, 2010, at 1:33 PM, Hong Zhang wrote:

> In ServerEnvironment class, we have this constant:
>
> String DEFAULT_INSTANCE_NAME = "default-instance-name";
>
> Should the value be "server" instead as that is the default instance name?
and you think that the default instance name *has* to be "server" ;-)...

> I was trying to use this constant earlier in the code and then realized this constant was not defined the way I was expecting...
>
whatever the default instance really is, it will also be registered under that DEFAULT_INSTANCE_NAME, so if you do

@Inject(name="DEFAULT_INSTANCE_NAME")
Server server

will always get injected with the default instance (whatever its name is...)

jerome

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>