org.curjent.agent
Enum CallState

java.lang.Object
  extended by java.lang.Enum<CallState>
      extended by org.curjent.agent.CallState
All Implemented Interfaces:
Serializable, Comparable<CallState>

public enum CallState
extends Enum<CallState>

Execution state of a call. Calls transition through a set of well-defined states in a well-defined order. All calls start in the STARTING state and finish in the FINISHED state. In the nominal case, the case for most calls, a call transitions from STARTING to ACCEPTED to EXECUTING to FINISHED. A call can transition to the FINISHED state from any other state due to an error, cancellation, etc. See the documentation for individual states for exceptions.


Enum Constant Summary
ACCEPTED
          Call is queued and ready to run as soon as a task is available to execute it.
EXECUTING
          An agent's task is executing the call.
FINISHED
          The call has finished, normally or otherwise.
PENDING
          Call is pending acceptance by the agent.
STARTING
          Call is initialized and ready for queing and execution.
 
Method Summary
static CallState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CallState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STARTING

public static final CallState STARTING
Call is initialized and ready for queing and execution. Calls always start in this state.

Calls can transition from the STARTING state to any other state.


PENDING

public static final CallState PENDING
Call is pending acceptance by the agent. This state is only possible for calls configured with limited queing capacity.

Calls can transition from the PENDING state to ACCEPTED or FINISHED.

See Also:
Capacity

ACCEPTED

public static final CallState ACCEPTED
Call is queued and ready to run as soon as a task is available to execute it. Most calls transition to the ACCEPTED state before they transition to the EXECUTING state. The one exception is a reentrant call which is not queued and therefore transitions directly from STARTING to EXECUTING (see Reentrant).

Calls can transition from the ACCEPTED state to EXECUTING or FINISHED.


EXECUTING

public static final CallState EXECUTING
An agent's task is executing the call. The agent, within the context of the task's background thread, sets the call's state to EXECUTING, notifies the EXECUTING CallStateListener if present, calls the task's method, transitions the call to FINISHED, and notifies the FINISHED CallStateListener if present.

Calls can only transition from the EXECUTING state to the FINISHED state.


FINISHED

public static final CallState FINISHED
The call has finished, normally or otherwise. See CallCompletion for possible reasons.

Once a call has transitioned to the FINISHED state, its state is fixed and can no longer change.

All calls transition to FINISHED when they're done, and a call can transition to FINISHED from any other state.

Method Detail

values

public static CallState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CallState c : CallState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CallState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright 2009-2011 Tom Landon
Apache License 2.0