admin@glassfish.java.net

Re: InstanceState service : getting the state of an instance

From: Vijay Ramachandran <vijay.ramachandran_at_oracle.com>
Date: Wed, 07 Jul 2010 10:19:48 -0700

On 7/7/10 10:16 AM, Anissa Lam wrote:
> Hi Vijay,
>
> On 7/7/10 10:02 AM, Vijay Ramachandran wrote:
>> For those CLI/module owners who want a way to get the state of an
>> instance at any time :
>>
>> A new service, InstanceState, has been introduced. You can use this
>> by doing the following in your code :
>>
>> @Inject InstanceState state;
>>
>> As of now, this service interacts with the command replication
>> framework and, hence, the state of an instance changes from RUNNING
>> to RESTART_REQUIRED only. Soon this service will interact with GMS
>> subsystem and every other instance state change will be reflected.
> What are other state that will be returned besides RUNNING,
> NOT_RUNNING and RESTART_REQUIRED ?

Currently the above + STARTING are the only states. I have not looked
into GMS stuff in detail as yet - more states may have to be added once
I get a better understanding of GMS sub system.

> Is this an enum ? where is this defined ?

Look at InstanceState.StateType

Vijay
>
> thanks
> Anissa.
>>
>> You may want to consider using this instead doing other forms of
>> pinging an instance (like doing uptime / version / locations command)
>> to see if an instance is alive.
>>
>> Let me know if you have any feedback / comments / issues with this.
>>
>> Vijay
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>