public class AssetMonitorImpl extends AbstractLinkedListSetEntry<AssetMonitor,AssetManager> implements AssetMonitor
AssetMonitor
.Constructor and Description |
---|
AssetMonitorImpl(Asset asset,
AssetManager assetManager)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
activateJobNodes(JobNodeActivateSet activateSet,
boolean isPermanent)
Adds all the
JobNode instances waiting on the Asset to
the input JobNodeActivateSet to be activated. |
void |
failJobNodes(JobNodeActivateSet activateSet,
Throwable failure,
boolean isPermanent)
Adds all the
JobNode instances waiting on this Asset to
the input JobNodeActivateSet to be activated with the
ThreadState receiving the input failure. |
Asset |
getAsset()
Obtains the
Asset for this AssetMonitor . |
AssetManager |
getLinkedListSetOwner()
Obtains the owner of the
LinkedListSet that this
LinkedListSetEntry may be added. |
boolean |
waitOnAsset(JobNode jobNode,
JobNodeActivateSet activateSet)
Flags for the
JobNode (and more specifically the
ThreadState of the JobNode ) to wait until the
Asset activates it. |
getNext, getPrev, setNext, setPrev
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNext, getPrev, setNext, setPrev
public AssetMonitorImpl(Asset asset, AssetManager assetManager)
asset
- Asset
to be managed.assetManager
- AssetManager
for managing this.public AssetManager getLinkedListSetOwner()
LinkedListSetEntry
Obtains the owner of the LinkedListSet
that this
LinkedListSetEntry
may be added.
LinkedListSetEntry
instances may only be added to the
LinkedListSet
they were intended for and can not be shared
between LinkedListSet
instances. This constraint:
JobNode
, JobSequence
,
ThreadState
, ProcessState
structure, andLinkedListSetEntry.getNext()
and
LinkedListSetEntry.getPrev()
both returning null
indicates not addedgetLinkedListSetOwner
in interface LinkedListSetEntry<AssetMonitor,AssetManager>
LinkedListSet
that may contain this
LinkedListSetEntry
.public Asset getAsset()
AssetMonitor
Asset
for this AssetMonitor
.getAsset
in interface AssetMonitor
Asset
for this AssetMonitor
.public boolean waitOnAsset(JobNode jobNode, JobNodeActivateSet activateSet)
AssetMonitor
Flags for the JobNode
(and more specifically the
ThreadState
of the JobNode
) to wait until the
Asset
activates it.
This is typically because the Asset
is doing some processing that
the JobNode
requires completed before proceeding.
waitOnAsset
in interface AssetMonitor
jobNode
- JobNode
to be activated when Asset
processing
is complete.activateSet
- JobNodeActivateSet
that the JobNode
is added
to if the Asset
has permanently activated this
AssetMonitor
. This may be null
to
activate via the OfficeManager
however it is much more
efficient to provide a JobNodeActivateSet
.true
if the JobNode
is waiting on the
Asset
.public void activateJobNodes(JobNodeActivateSet activateSet, boolean isPermanent)
AssetMonitor
JobNode
instances waiting on the Asset
to
the input JobNodeActivateSet
to be activated.activateJobNodes
in interface AssetMonitor
activateSet
- JobNodeActivateSet
that will later activate the
JobNode
instances waiting on the Asset
. This
may be null
to activate via the
OfficeManager
however it is much more efficient to
provide a JobNodeActivateSet
.isPermanent
- true
indicates that all JobNode
instances
added to the AssetMonitor
from now on are activated
immediately. It is useful to flag an AssetMonitor
in
this state when the Asset
is no longer being used to
stop a JobNode
from waiting forever.public void failJobNodes(JobNodeActivateSet activateSet, Throwable failure, boolean isPermanent)
AssetMonitor
JobNode
instances waiting on this Asset
to
the input JobNodeActivateSet
to be activated with the
ThreadState
receiving the input failure.failJobNodes
in interface AssetMonitor
activateSet
- JobNodeActivateSet
that will later activate the
JobNode
instances waiting on the Asset
. This
may be null
to activate via the
OfficeManager
however it is much more efficient to
provide a JobNodeActivateSet
.failure
- Failure to propagate to the ThreadState
of the
JobNode
instances waiting on the Asset
.isPermanent
- true
indicates that all JobNode
instances
added to the AssetMonitor
from now on are activated
immediately with the input failure. It is useful to flag an
AssetMonitor
in this state when the Asset
is
in a failed state that can not be recovered from.Copyright © 2005–2016. All rights reserved.