Package jsl.modeling.resource
Class FailureNotice
- java.lang.Object
-
- jsl.modeling.queue.QObject
-
- jsl.modeling.resource.FailureNotice
-
- All Implemented Interfaces:
java.lang.Comparable<QObject>
,GetNameIfc
public class FailureNotice extends QObject
A FailureNotice represents a notification that the ResourceUnit should go down due to a failure. The failure notice may be required to be immediate or not. If not immediate, then the failure may be delayed until the resource unit finishes its current activity. A FailureNotice has a well-defined state pattern. When created, the notice is placed in the Created state. From the created state, the notice can become active, delayed, or ignored. If the notice is active, the failure is in progress. After being active, the notice can only become completed. If the notice is delayed, the notice is waiting to become active. After being delayed, the notice can become active or be ignored. If the resource unit ignored the notice, then the notice is placed in the ignored state. The ignored state is terminal. Once the notice finishes being active, it is placed in the completed state. The completed state is terminal. The associated FailureProcess is notified when the notice enters these states. This allows FailureProcesses to react accordingly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FailureNotice.ActiveState
protected class
FailureNotice.CompletedState
protected class
FailureNotice.CreatedState
protected class
FailureNotice.DelayedState
protected class
FailureNotice.FailureNoticeState
protected class
FailureNotice.IgnoredState
-
Field Summary
-
Fields inherited from class jsl.modeling.queue.QObject
myTimeStamp, myValue
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDuration()
FailureProcess
getFailureProcess()
ResourceUnit
getResourceUnit()
boolean
isActive()
boolean
isCompleted()
boolean
isCreated()
boolean
isDelayable()
If the notice can be delayed while resource finishes busy stateboolean
isDelayed()
boolean
isIgnored()
protected void
setState(FailureNotice.FailureNoticeState nextState)
java.lang.String
toString()
-
Methods inherited from class jsl.modeling.queue.QObject
compareTo, enterQueue, exitQueue, getAttachedObject, getCreateTime, getId, getName, getPriority, getQueue, getQueuedState, getTimeEnteredQueue, getTimeExitedQueue, getTimeInQueue, getTimeStamp, getValueObject, initialize, isQueued, nullify, setAttachedObject, setName, setNulls, setPriority, setPriority_, setQueue, setTimeStamp, setValueObject
-
-
-
-
Method Detail
-
getResourceUnit
public final ResourceUnit getResourceUnit()
- Returns:
- the ResourceUnit that the FailureNotice was sent to, or null if not sent
-
getDuration
public final double getDuration()
- Returns:
- the time that the failure should last
-
getFailureProcess
public final FailureProcess getFailureProcess()
- Returns:
- the associated FailureProcess
-
isDelayable
public final boolean isDelayable()
If the notice can be delayed while resource finishes busy state- Returns:
- true if the notice can be delayed
-
isCreated
public final boolean isCreated()
- Returns:
- true if in created state
-
isDelayed
public final boolean isDelayed()
- Returns:
- true if in delayed state
-
isIgnored
public final boolean isIgnored()
- Returns:
- true if in ignored state
-
isCompleted
public final boolean isCompleted()
- Returns:
- true if in completed state
-
isActive
public final boolean isActive()
- Returns:
- true if in active state
-
setState
protected final void setState(FailureNotice.FailureNoticeState nextState)
-
-