java.lang.Object
swim.system.AbstractWarpRef
swim.system.AbstractTierBinding
swim.system.agent.AgentNode
- All Implemented Interfaces:
Executor
,DownlinkFactory
,LaneFactory
,WarpRef
,Schedule
,Stage
,Task
,TaskFunction
,CellBinding
,CellContext
,NodeBinding
,TierBinding
,Log
- Direct Known Subclasses:
AgentModel
,MetaEdgeAgent
,MetaHostAgent
,MetaLaneAgent
,MetaMeshAgent
,MetaPartAgent
public class AgentNode
extends AbstractTierBinding
implements NodeBinding, CellContext, LaneFactory, Schedule, Stage, Task
-
Field Summary
FieldsFields inherited from class swim.system.AbstractTierBinding
CLOSED_PHASE, CLOSED_STATE, CLOSING_STATE, FAILED_STATE, FAILING_STATE, LOADED_PHASE, LOADED_STATE, LOADING_STATE, OPENED_PHASE, OPENED_STATE, OPENING_STATE, PHASE_MASK, PHASE_SHIFT, RECOVERING_STATE, STARTED_PHASE, STARTED_STATE, STARTING_STATE, STATE_MASK, status, STATUS, STOPPING_STATE, UNLOADING_STATE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionagentIds()
agents()
bindDownlink
(Downlink downlink) <T> T
bottomNode
(Class<T> nodeClass) <T> Call<T>
Returns aCall
that completes thecont
inuation.void
closeDownlink
(LinkBinding link) void
<V> CommandLane<V>
<A extends Agent>
AgentFactory<A>createAgentFactory
(NodeBinding node, Class<? extends A> agentClass) AgentFactory<?>
createAgentFactory
(NodeBinding node, AgentDef agentDef) long
protected LaneContext
createLaneContext
(LaneAddress laneAddress, LaneBinding lane) void
Logs a debug-level message.<V> DemandLane<V>
<K,
V> DemandMapLane<K, V> void
didClose()
protected void
didCloseLane
(LaneBinding lane) void
protected void
didOpenLane
(LaneBinding lane) final String
edgeName()
void
Logs an error-level message.void
Schedules arunnable
for concurrent execution.void
Logs an fail-level message.<K,
V> SpatialLane<K, R2Shape, V> final HostBinding
host()
final Uri
hostUri()
<V> HttpLane<V>
httpLane()
final Identity
identity()
void
Logs an info-level message.<L,
K, V> JoinMapLane<L, K, V> <K,
V> JoinValueLane<K, V> lanes()
<V> ListLane<V>
listLane()
<K,
V> MapLane<K, V> mapLane()
final Uri
meshUri()
final NodeContext
final Uri
nodeUri()
final NodeBinding
protected static Uri
normalizedLaneUri
(Uri laneUri) void
openAgents
(NodeBinding node) void
openDownlink
(LinkBinding link) openLane
(Uri laneUri, LaneBinding lane) void
openLanes
(NodeBinding node) openLaneView
(Uri laneUri, LaneView laneView) void
openMetaDownlink
(LinkBinding downlink, NodeBinding metaDownlink) void
openMetaLane
(LaneBinding lane, NodeBinding metaLane) void
openMetaNode
(NodeBinding node, NodeBinding metaNode) void
openMetaUplink
(LinkBinding uplink, NodeBinding metaUplink) protected void
openUnknownUplink
(Uri laneUri, LinkBinding link) void
openUplink
(LinkBinding link) final Value
partKey()
policy()
void
void
void
reportDown
(Metric metric) void
runTask()
Executes this sequential process.schedule()
void
setNodeContext
(NodeContext nodeContext) void
setTaskContext
(TaskContext taskContext) Sets the context used to managed thisTask
.setTimer
(long millis, TimerFunction timer) Schedulestimer
to execute aftermillis
milliseconds have elapsed.<K,
S, V> SpatialLane<K, S, V> spatialLane
(Z2Form<S> shapeForm) stage()
store()
<V> SupplyLane<V>
task
(TaskFunction task) Returns an uncuedTaskRef
bound to thetask
, which can later be used to cue thetask
.final TaskContext
Returns the context used to managed thisTask
.void
Lifecycle callback invoked after thisTask
is explicitly cancelled.boolean
Returnstrue
if thisTask
might block its thread of execution when running; returnsfalse
if thisTask
will never block.void
Lifecycle callback invoked before thisTask
is scheduled for execution.final TierContext
timer
(TimerFunction timer) Returns an unscheduledTimerRef
bound totimer
, which can later be used to scheduletimer
.void
Logs a trace-level message.<T> T
unwrapNode
(Class<T> nodeClass) <V> ValueLane<V>
void
Logs a warn-level message.protected void
protected void
willLoad()
protected void
willOpen()
protected void
protected void
willStop()
protected void
<I,
O> WsLane<I, O> wsLane()
Methods inherited from class swim.system.AbstractTierBinding
activate, awaitStart, close, didLoad, didOpen, didStart, didStop, didUnload, isClosed, isLoaded, isOpened, isStarted, load, open, start, stop, unload
Methods inherited from class swim.system.AbstractWarpRef
command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
-
Field Details
-
nodeContext
-
taskContext
-
-
Constructor Details
-
AgentNode
public AgentNode()
-
-
Method Details
-
tierContext
- Specified by:
tierContext
in interfaceTierBinding
- Specified by:
tierContext
in classAbstractTierBinding
-
host
- Specified by:
host
in interfaceNodeBinding
-
nodeWrapper
- Specified by:
nodeWrapper
in interfaceNodeBinding
-
nodeContext
- Specified by:
nodeContext
in interfaceNodeBinding
-
setNodeContext
- Specified by:
setNodeContext
in interfaceNodeBinding
-
unwrapNode
- Specified by:
unwrapNode
in interfaceNodeBinding
-
bottomNode
- Specified by:
bottomNode
in interfaceNodeBinding
-
taskContext
Description copied from interface:Task
- Specified by:
taskContext
in interfaceTask
-
setTaskContext
Description copied from interface:Task
Sets the context used to managed thisTask
. ATaskContext
is assigned when binding thisTask
to aStage
.- Specified by:
setTaskContext
in interfaceTask
-
createLaneContext
-
cellAddress
- Specified by:
cellAddress
in interfaceCellContext
- Specified by:
cellAddress
in interfaceNodeBinding
-
edgeName
- Specified by:
edgeName
in interfaceCellContext
-
meshUri
- Specified by:
meshUri
in interfaceCellContext
- Specified by:
meshUri
in interfaceNodeBinding
-
partKey
- Specified by:
partKey
in interfaceNodeBinding
-
hostUri
- Specified by:
hostUri
in interfaceNodeBinding
-
nodeUri
- Specified by:
nodeUri
in interfaceNodeBinding
-
createdTime
public long createdTime()- Specified by:
createdTime
in interfaceNodeBinding
-
identity
-
openMetaNode
- Specified by:
openMetaNode
in interfaceNodeBinding
-
openLanes
- Specified by:
openLanes
in interfaceNodeBinding
-
agentIds
- Specified by:
agentIds
in interfaceNodeBinding
-
agents
- Specified by:
agents
in interfaceNodeBinding
-
createAgentFactory
- Specified by:
createAgentFactory
in interfaceNodeBinding
-
createAgentFactory
public <A extends Agent> AgentFactory<A> createAgentFactory(NodeBinding node, Class<? extends A> agentClass) - Specified by:
createAgentFactory
in interfaceNodeBinding
-
openAgents
- Specified by:
openAgents
in interfaceNodeBinding
-
lanes
- Specified by:
lanes
in interfaceNodeBinding
-
getLane
- Specified by:
getLane
in interfaceNodeBinding
-
openLaneView
-
openLane
-
openLane
- Specified by:
openLane
in interfaceNodeBinding
-
openLane
- Specified by:
openLane
in interfaceNodeBinding
-
closeLane
-
didOpenLane
-
didCloseLane
-
commandLane
- Specified by:
commandLane
in interfaceLaneFactory
-
demandLane
- Specified by:
demandLane
in interfaceLaneFactory
-
demandMapLane
- Specified by:
demandMapLane
in interfaceLaneFactory
-
httpLane
- Specified by:
httpLane
in interfaceLaneFactory
-
joinMapLane
- Specified by:
joinMapLane
in interfaceLaneFactory
-
joinValueLane
- Specified by:
joinValueLane
in interfaceLaneFactory
-
listLane
- Specified by:
listLane
in interfaceLaneFactory
-
mapLane
- Specified by:
mapLane
in interfaceLaneFactory
-
spatialLane
- Specified by:
spatialLane
in interfaceLaneFactory
-
geospatialLane
- Specified by:
geospatialLane
in interfaceLaneFactory
-
supplyLane
- Specified by:
supplyLane
in interfaceLaneFactory
-
valueLane
- Specified by:
valueLane
in interfaceLaneFactory
-
wsLane
- Specified by:
wsLane
in interfaceLaneFactory
-
openMetaLane
- Specified by:
openMetaLane
in interfaceNodeBinding
-
openMetaUplink
- Specified by:
openMetaUplink
in interfaceNodeBinding
-
openMetaDownlink
- Specified by:
openMetaDownlink
in interfaceCellContext
-
openUplink
- Specified by:
openUplink
in interfaceCellBinding
-
openUnknownUplink
-
bindDownlink
- Specified by:
bindDownlink
in interfaceCellContext
-
openDownlink
- Specified by:
openDownlink
in interfaceCellContext
-
closeDownlink
- Specified by:
closeDownlink
in interfaceCellContext
-
pushUp
- Specified by:
pushUp
in interfaceCellBinding
-
pushDown
- Specified by:
pushDown
in interfaceCellContext
-
reportDown
- Specified by:
reportDown
in interfaceCellContext
-
trace
Description copied from interface:Log
Logs a trace-level message. -
debug
Description copied from interface:Log
Logs a debug-level message. -
info
Description copied from interface:Log
Logs an info-level message. -
warn
Description copied from interface:Log
Logs a warn-level message. -
error
Description copied from interface:Log
Logs an error-level message. -
fail
Description copied from interface:Log
Logs an fail-level message. -
willOpen
protected void willOpen()- Overrides:
willOpen
in classAbstractTierBinding
-
willLoad
protected void willLoad()- Overrides:
willLoad
in classAbstractTierBinding
-
willStart
protected void willStart()- Overrides:
willStart
in classAbstractTierBinding
-
willStop
protected void willStop()- Overrides:
willStop
in classAbstractTierBinding
-
willUnload
protected void willUnload()- Overrides:
willUnload
in classAbstractTierBinding
-
willClose
protected void willClose()- Overrides:
willClose
in classAbstractTierBinding
-
didClose
public void didClose()- Specified by:
didClose
in interfaceTierBinding
- Overrides:
didClose
in classAbstractTierBinding
-
didFail
- Specified by:
didFail
in interfaceTierBinding
- Overrides:
didFail
in classAbstractTierBinding
-
policy
- Specified by:
policy
in interfaceCellContext
-
schedule
- Specified by:
schedule
in interfaceCellContext
-
stage
- Specified by:
stage
in interfaceCellContext
-
asyncStage
-
store
- Specified by:
store
in interfaceCellContext
-
timer
Description copied from interface:Schedule
Returns an unscheduledTimerRef
bound totimer
, which can later be used to scheduletimer
. -
setTimer
Description copied from interface:Schedule
Schedulestimer
to execute aftermillis
milliseconds have elapsed. Returns aTimerRef
that can be used to check the status of, reschedule, and canceltimer
. -
task
Description copied from interface:Stage
Returns an uncuedTaskRef
bound to thetask
, which can later be used to cue thetask
. -
call
Description copied from interface:Stage
Returns aCall
that completes thecont
inuation. -
execute
Description copied from interface:Stage
Schedules arunnable
for concurrent execution. -
taskWillBlock
public boolean taskWillBlock()Description copied from interface:Task
Returnstrue
if thisTask
might block its thread of execution when running; returnsfalse
if thisTask
will never block. Used by the executionStage
to prevent thread starvation when concurrently running many blocking tasks.- Specified by:
taskWillBlock
in interfaceTask
-
runTask
public void runTask()Description copied from interface:Task
Executes this sequential process. Only one thread at a time will executerunTask
for thisTask
.- Specified by:
runTask
in interfaceTask
- Specified by:
runTask
in interfaceTaskFunction
-
taskWillCue
public void taskWillCue()Description copied from interface:Task
Lifecycle callback invoked before thisTask
is scheduled for execution.- Specified by:
taskWillCue
in interfaceTask
-
taskDidCancel
public void taskDidCancel()Description copied from interface:Task
Lifecycle callback invoked after thisTask
is explicitly cancelled.- Specified by:
taskDidCancel
in interfaceTask
-
normalizedLaneUri
-