org.oddjob.state
Class StateEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.oddjob.state.StateEvent
All Implemented Interfaces:
Serializable

public class StateEvent
extends EventObject
implements Serializable

An instance of this class is produced when a job state changes. It is passed to all JobStateListeners.

See Also:
Serialized Form
Author:
Rob Gordon

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
StateEvent(Stateful job, State jobState)
          Constructor.
StateEvent(Stateful job, State jobState, Date time, Throwable exception)
          Constructor.
StateEvent(Stateful job, State jobState, Throwable exception)
          Constructor.
 
Method Summary
 Throwable getException()
          Get the exception if applicable, null otherwise.
 Stateful getSource()
           
 State getState()
          Get the job state.
 Date getTime()
          Get the time of the event..
 String toString()
          Override toString.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateEvent

public StateEvent(Stateful job,
                  State jobState,
                  Date time,
                  Throwable exception)
Constructor.

Parameters:
job - The source of the event.
jobState - The state.
time - the Time of the event.
exception - The exception if applicable, or null otherwise.

StateEvent

public StateEvent(Stateful job,
                  State jobState,
                  Throwable exception)
Constructor.

Parameters:
job - The source of the event.
jobState - The state.
exception - The exception if applicable, or null otherwise.

StateEvent

public StateEvent(Stateful job,
                  State jobState)
Constructor.

Parameters:
job - The source of the event.
jobState - The state.
Method Detail

getSource

public Stateful getSource()
Overrides:
getSource in class EventObject

getState

public State getState()
Get the job state.

Returns:
The job state.

getException

public Throwable getException()
Get the exception if applicable, null otherwise.

Returns:
The exception of null.

getTime

public Date getTime()
Get the time of the event..

Returns:
The time.

toString

public String toString()
Override toString.

Overrides:
toString in class EventObject