Package jsl.modeling.elements.component
Class ComponentStateChangeListener
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.SchedulingElement
-
- jsl.modeling.elements.component.ComponentStateChangeListener
-
- All Implemented Interfaces:
ComponentStateChangeListenerIfc,ObservableIfc,GetNameIfc,IdentityIfc
- Direct Known Subclasses:
ComponentAssembly
public abstract class ComponentStateChangeListener extends SchedulingElement implements ComponentStateChangeListenerIfc
A component state change listener can be attached to a component and will have it's stateChange() method called at each state change of the component.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jsl.simulation.ModelElement
ModelElement.EventBuilderIfc<T>, ModelElement.EventScheduler<T>, ModelElement.ModelElementComparator, ModelElement.RequestBuilder, ModelElement.RequestDurationIfc, ModelElement.RequestTimeIfc, ModelElement.RequestUsingIfc, ModelElement.TimedUpdateEventAction, ModelElement.TimeUnitIfc<T>, ModelElement.WarmUpEventAction
-
-
Field Summary
-
Fields inherited from class jsl.simulation.ModelElement
AFTER_EXPERIMENT, AFTER_REPLICATION, BEFORE_EXPERIMENT, BEFORE_REPLICATION, CONDITIONAL_ACTION_REGISTRATION, DEFAULT_TIMED_EVENT_PRIORITY, INITIALIZED, MONTE_CARLO, myAfterExperimentOption, myAfterReplicationOption, myBeforeExperimentOption, myBeforeReplicationOption, myInitializationOption, myLengthOfWarmUp, myModelElements, myMonteCarloOption, myObservableComponent, myReplicationEndedOption, myTimedUpdateActionListener, myTimedUpdateEvent, myTimedUpdateInterval, myTimedUpdateOption, myTimedUpdatePriority, myWarmUpActionListener, myWarmUpEvent, myWarmUpIndicator, myWarmUpOption, myWarmUpPriority, NONE, REMOVED_FROM_MODEL, REPLICATION_ENDED, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TIMED_UPDATE, UPDATE, WARMUP
-
-
Constructor Summary
Constructors Constructor Description ComponentStateChangeListener(ModelElement parent)Creates a component state change listenerComponentStateChangeListener(ModelElement parent, java.lang.String name)Creates a component state change listener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcomponentAvailable(Component c)Called when the component transitions into the available state from any other legal stateprotected voidcomponentAvailableAfterCreation(Component c)Called after componentAvailable() but only when the component enters from the created stateprotected voidcomponentAvailableAfterOperating(Component c)Called after componentAvailable() but only when the component enters from the operating stateprotected voidcomponentAvailableAfterRepair(Component c)Called after componentAvailable() but only when the component enters from the repairing stateprotected voidcomponentAvailableAfterUnavailable(Component c)Called after componentAvailable() but only when the component enters from the unavailable stateprotected voidcomponentFailed(Component c)Called when the component transitions into the failed stateprotected voidcomponentStartedOperating(Component c)Called when the component transitions into the operating stateprotected voidcomponentStartedRepair(Component c)Called when the component transitions into the repairing stateprotected voidcomponentUnavailable(Component c)Called when the component transitions into the unavailable statevoidstateChange(Component c)This method is called by the component when a state change occurs-
Methods inherited from class jsl.simulation.SchedulingElement
cancelEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, rescheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent, scheduleEvent
-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication, afterReplication_, asString, beforeExperiment, beforeExperiment_, beforeReplication, beforeReplication_, buildEventGenerator, cancelTimedUpdateEvent, cancelWarmUpEvent, changeParentModelElement, checkForAfterExperiment, checkForAfterReplication, checkForBeforeExperiment, checkForBeforeReplication, checkForConditionalActionRegistration, checkForInitialize, checkForMonteCarlo, checkForRemoveFromModel, checkForReplicationEnded, checkForTimedUpdate, checkForUpdate, checkForWarmUp, checkObserverState, checkWarmUpOption, clearModelElementObservers, contains, countObservers, createEntity, createEntity, createQObject, day, deleteObserver, deleteObserverFromModelElements, deleteObservers, findModelElementWithWarmUpEvent, getAfterExperimentOption, getAfterReplicationOption, getAllCounters, getAllModelElements, getAllRandomElements, getAllResponseVariables, getAllVariables, getBeforeExperimentOption, getBeforeReplicationOption, getChildModelElementIterator, getCurrentReplicationNumber, getDefaultEntityType, getExecutive, getExperiment, getId, getInitializationOption, getInitializationOrderAsString, getLeftPreOrderTraversalCount, getLengthOfWarmUp, getModel, getModelElementCompartor, getModelElementsAsString, getModelElementsAsString, getModelElementsAsString, getMonteCarloOption, getName, getNumberOfModelElements, getObserverState, getParentModelElement, getPreviousObserverState, getReplicationEndedOption, getRightPreOrderTraversalCount, getSimulation, getSpatialModel, getStringLabel, getThisElementsCounters, getThisElementsModelElements, getThisElementsRandomVariables, getThisElementsResponseVariables, getThisElementsVariables, getTime, getTimedUpdateInterval, getTimedUpdateOption, getUpdateNotificationFlag, getVariable, getWarmUpEventTime, getWarmUpOption, hour, indent, initialize, initialize_, isTimedUpdateEventScheduled, isWarmedUp, isWarmUpEventScheduled, isWarmUpScheduled, millisecond, minute, montecarlo, montecarlo_, notifyAfterExperimentObservers, notifyAfterReplicationObservers, notifyBeforeExperimentObservers, notifyBeforeReplicationObservers, notifyConditionalActionRegistrationObservers, notifyInitializationObservers, notifyMonteCarloObservers, notifyObservers, notifyObservers, notifyRemovingFromModelObservers, notifyReplicationEndedObservers, notifyTimedUpdateObservers, notifyUpdateObservers, notifyWarmUpObservers, registerConditionalActions, registerConditionalActions_, removedFromModel, removeFromModel, replicationEnded, replicationEnded_, schedule, second, seize, setAfterExperimentOption, setAfterExperimentOptionForModelElements, setAfterReplicationOption, setAfterReplicationOptionForModelElements, setBeforeExperimentOption, setBeforeExperimentOptionForModelElements, setBeforeReplicationOption, setBeforeReplicationOptionForModelElements, setInitializationOption, setInitializationOptionForModelElements, setLengthOfWarmUp, setModel, setMonteCarloOption, setMonteCarloOptionForModelElements, setName, setObserverState, setParentModelElement, setReplicationEndedOption, setReplicationEndedOptionForModelElements, setSpatialModel, setStringLabel, setTimedUpdateInterval, setTimedUpdateOption, setTimedUpdateOptionForModelElements, setUpdateNotificationFlag, setWarmUpOption, setWarmUpOptionForModelElements, stopExecutive, stopExecutive, timedUpdate, timedUpdate_, toString, update, useControls, warmUp, warmUp_, week
-
-
-
-
Constructor Detail
-
ComponentStateChangeListener
public ComponentStateChangeListener(ModelElement parent)
Creates a component state change listener- Parameters:
parent-
-
ComponentStateChangeListener
public ComponentStateChangeListener(ModelElement parent, java.lang.String name)
Creates a component state change listener- Parameters:
parent-name-
-
-
Method Detail
-
stateChange
public void stateChange(Component c)
Description copied from interface:ComponentStateChangeListenerIfcThis method is called by the component when a state change occurs- Specified by:
stateChangein interfaceComponentStateChangeListenerIfc
-
componentAvailable
protected void componentAvailable(Component c)
Called when the component transitions into the available state from any other legal state- Parameters:
c-
-
componentAvailableAfterCreation
protected void componentAvailableAfterCreation(Component c)
Called after componentAvailable() but only when the component enters from the created state- Parameters:
c-
-
componentAvailableAfterRepair
protected void componentAvailableAfterRepair(Component c)
Called after componentAvailable() but only when the component enters from the repairing state- Parameters:
c-
-
componentAvailableAfterUnavailable
protected void componentAvailableAfterUnavailable(Component c)
Called after componentAvailable() but only when the component enters from the unavailable state- Parameters:
c-
-
componentAvailableAfterOperating
protected void componentAvailableAfterOperating(Component c)
Called after componentAvailable() but only when the component enters from the operating state- Parameters:
c-
-
componentStartedOperating
protected void componentStartedOperating(Component c)
Called when the component transitions into the operating state- Parameters:
c-
-
componentUnavailable
protected void componentUnavailable(Component c)
Called when the component transitions into the unavailable state- Parameters:
c-
-
componentFailed
protected void componentFailed(Component c)
Called when the component transitions into the failed state- Parameters:
c-
-
componentStartedRepair
protected void componentStartedRepair(Component c)
Called when the component transitions into the repairing state- Parameters:
c-
-
-