|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.lifecycle.Lifecycle
public final class Lifecycle
Lifecycle class.
| Field Summary |
|---|
| Fields inherited from interface com.caucho.lifecycle.LifecycleState |
|---|
IS_ACTIVE, IS_DESTROYED, IS_DESTROYING, IS_FAILED, IS_INIT, IS_INITIALIZING, IS_NEW, IS_STANDBY, IS_STARTING, IS_STOPPED, IS_STOPPING, IS_WARMUP |
| Constructor Summary | |
|---|---|
Lifecycle()
Creates an anonymous lifecycle. |
|
Lifecycle(java.util.logging.Logger log)
Creates an lifecycle with logger and name. |
|
Lifecycle(java.util.logging.Logger log,
java.lang.String name)
Creates an lifecycle with logger and name. |
|
Lifecycle(java.util.logging.Logger log,
java.lang.String name,
java.util.logging.Level level)
Creates an lifecycle with logger, a name, and a level. |
|
| Method Summary | |
|---|---|
void |
addListener(LifecycleListener listener)
Adds a listener to detect lifecycle changes. |
void |
copyState(Lifecycle source)
Copies from a target state. |
long |
getActiveCount()
Returns the number of times the lifecycle has switched to active. |
long |
getFailCount()
Returns the number of times the lifecycle has switched to failing. |
long |
getLastChangeTime()
Returns the last lifecycle change time. |
long |
getLastFailTime()
Returns the last failure time. |
java.util.logging.Level |
getLevel()
Gets the lifecycle logging level. |
java.lang.String |
getName()
Gets the lifecycle name. |
int |
getState()
Returns the current state. |
java.lang.String |
getStateName()
Returns the current state name. |
static java.lang.String |
getStateName(int state)
Returns the state name for the passed state. |
boolean |
isActive()
Returns true for the active state. |
boolean |
isAfterActive()
Returns true for the closing states |
boolean |
isAfterInit()
Returns true for the init state. |
boolean |
isBeforeActive()
Returns true for the initializing state. |
boolean |
isBeforeInit()
Returns true for the init state. |
boolean |
isDestroyed()
Returns true if the state is closed |
boolean |
isDestroying()
Returns true if the state is closed |
boolean |
isError()
Returns true for the failed state. |
boolean |
isFailed()
Returns true for the failed state. |
boolean |
isInit()
Returns true for the init state. |
boolean |
isInitializing()
Returns true for the initializing state. |
boolean |
isRunnable()
Returns true for the a runnable state, including warmup |
boolean |
isStarting()
Returns true if the service is starting. |
boolean |
isStopped()
Returns true if the state is stopping. |
boolean |
isStopping()
Returns true if the state is stopping. |
boolean |
isWarmup()
Returns true for the warmup state. |
void |
removeListener(LifecycleListener listener)
Removes a listener. |
void |
setLevel(java.util.logging.Level level)
Sets the lifecycle logging level. |
void |
setName(java.lang.String name)
Sets the lifecycle name, and the level to Level.INFO. |
boolean |
toActive()
Changes to the active state. |
boolean |
toDestroy()
Changes to the closed state. |
boolean |
toDestroying()
Changes to the destroying state. |
boolean |
toError()
Changes to the error state. |
boolean |
toFail()
Changes to the failed state. |
boolean |
toInit()
Changes to the init state. |
boolean |
toInitializing()
Changes to the initializing state. |
boolean |
toPostInit()
Changes to the init from the stopped state. |
boolean |
toStarting()
Changes to the starting state. |
boolean |
toStop()
Changes to the stopped state. |
boolean |
toStopping()
Changes to the stopping state. |
java.lang.String |
toString()
Debug string value. |
boolean |
waitForActive(long timeout)
Wait for a period of time until the service starts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Lifecycle()
public Lifecycle(java.util.logging.Logger log)
public Lifecycle(java.util.logging.Logger log,
java.lang.String name)
public Lifecycle(java.util.logging.Logger log,
java.lang.String name,
java.util.logging.Level level)
| Method Detail |
|---|
public java.lang.String getName()
public void setName(java.lang.String name)
public java.util.logging.Level getLevel()
public void setLevel(java.util.logging.Level level)
public void addListener(LifecycleListener listener)
public void removeListener(LifecycleListener listener)
public int getState()
getState in interface LifecycleStatepublic static java.lang.String getStateName(int state)
public java.lang.String getStateName()
getStateName in interface LifecycleStatepublic long getLastChangeTime()
public long getLastFailTime()
public long getActiveCount()
public long getFailCount()
public boolean isInitializing()
isInitializing in interface LifecycleStatepublic boolean isInit()
isInit in interface LifecycleStatepublic boolean isBeforeInit()
isBeforeInit in interface LifecycleStatepublic boolean isAfterInit()
isAfterInit in interface LifecycleStatepublic boolean isStarting()
isStarting in interface LifecycleStatepublic boolean isWarmup()
isWarmup in interface LifecycleStatepublic boolean isBeforeActive()
isBeforeActive in interface LifecycleStatepublic boolean isAfterActive()
isAfterActive in interface LifecycleStatepublic boolean waitForActive(long timeout)
public boolean isActive()
isActive in interface LifecycleStatepublic boolean isRunnable()
public boolean isError()
isError in interface LifecycleStatepublic boolean isFailed()
public boolean isStopping()
isStopping in interface LifecycleStatepublic boolean isStopped()
isStopped in interface LifecycleStatepublic boolean isDestroying()
isDestroying in interface LifecycleStatepublic boolean isDestroyed()
isDestroyed in interface LifecycleStatepublic boolean toInitializing()
public boolean toInit()
public boolean toPostInit()
public boolean toStarting()
public boolean toActive()
public boolean toError()
public boolean toFail()
public boolean toStopping()
public boolean toStop()
public boolean toDestroying()
public boolean toDestroy()
public void copyState(Lifecycle source)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||