Package com.j_spaces.core
Class JSpaceState
java.lang.Object
com.j_spaces.core.JSpaceState
- All Implemented Interfaces:
ISpaceState,Serializable
Copyright (c) 2010 GigaSpaces Technologies Ltd. All rights reserved
The software source code is proprietary and confidential information of GigaSpaces. You may use
the software source code solely under the terms and limitations of The license agreement granted
to you by GigaSpaces.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertToString(Integer state) intgetState()Get the current state of the servicebooleanCheck if we're aborting or abortedbooleanbooleanbooleanCheck if we're terminated completely, abort process is considered completevoidsetState(int newState) Set the state of the serviceintverifyTransition(int newState) Verify the state transition, checking if the proposed new state is allowed from the current state.
-
Constructor Details
-
JSpaceState
public JSpaceState()Create a service state object
-
-
Method Details
-
convertToString
-
getState
public int getState()Get the current state of the service- Returns:
- int - The state of the service
-
setState
public void setState(int newState) Set the state of the service- Parameters:
newState- - The new state
-
verifyTransition
public int verifyTransition(int newState) Verify the state transition, checking if the proposed new state is allowed from the current state. If the proposed state is not allowed an IllegalStateException will be thrown- Parameters:
newState- - The new state to check- Throws:
IllegalStateException- - If the proposed newState is not allowed
-
isTerminated
public boolean isTerminated()Check if we're terminated completely, abort process is considered complete- Returns:
- boolean - If the current state is ABORTED, return
true
-
isAborted
public boolean isAborted()Check if we're aborting or aborted- Returns:
- boolean - If the current state is ABORTED or ABORTING, return
true
-
isStopped
public boolean isStopped() -
isStarted
public boolean isStarted()
-