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> TbottomNode(Class<T> nodeClass) <T> Call<T>Returns aCallthat completes thecontinuation.voidcloseDownlink(LinkBinding link) void<V> CommandLane<V><A extends Agent>
AgentFactory<A>createAgentFactory(NodeBinding node, Class<? extends A> agentClass) AgentFactory<?>createAgentFactory(NodeBinding node, AgentDef agentDef) longprotected LaneContextcreateLaneContext(LaneAddress laneAddress, LaneBinding lane) voidLogs a debug-level message.<V> DemandLane<V><K,V> DemandMapLane<K, V> voiddidClose()protected voiddidCloseLane(LaneBinding lane) voidprotected voiddidOpenLane(LaneBinding lane) final StringedgeName()voidLogs an error-level message.voidSchedules arunnablefor concurrent execution.voidLogs an fail-level message.<K,V> SpatialLane<K, R2Shape, V> final HostBindinghost()final UrihostUri()<V> HttpLane<V>httpLane()final Identityidentity()voidLogs 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 UrimeshUri()final NodeContextfinal UrinodeUri()final NodeBindingprotected static UrinormalizedLaneUri(Uri laneUri) voidopenAgents(NodeBinding node) voidopenDownlink(LinkBinding link) openLane(Uri laneUri, LaneBinding lane) voidopenLanes(NodeBinding node) openLaneView(Uri laneUri, LaneView laneView) voidopenMetaDownlink(LinkBinding downlink, NodeBinding metaDownlink) voidopenMetaLane(LaneBinding lane, NodeBinding metaLane) voidopenMetaNode(NodeBinding node, NodeBinding metaNode) voidopenMetaUplink(LinkBinding uplink, NodeBinding metaUplink) protected voidopenUnknownUplink(Uri laneUri, LinkBinding link) voidopenUplink(LinkBinding link) final ValuepartKey()policy()voidvoidvoidreportDown(Metric metric) voidrunTask()Executes this sequential process.schedule()voidsetNodeContext(NodeContext nodeContext) voidsetTaskContext(TaskContext taskContext) Sets the context used to managed thisTask.setTimer(long millis, TimerFunction timer) Schedulestimerto execute aftermillismilliseconds have elapsed.<K,S, V> SpatialLane<K, S, V> spatialLane(Z2Form<S> shapeForm) stage()store()<V> SupplyLane<V>task(TaskFunction task) Returns an uncuedTaskRefbound to thetask, which can later be used to cue thetask.final TaskContextReturns the context used to managed thisTask.voidLifecycle callback invoked after thisTaskis explicitly cancelled.booleanReturnstrueif thisTaskmight block its thread of execution when running; returnsfalseif thisTaskwill never block.voidLifecycle callback invoked before thisTaskis scheduled for execution.final TierContexttimer(TimerFunction timer) Returns an unscheduledTimerRefbound totimer, which can later be used to scheduletimer.voidLogs a trace-level message.<T> TunwrapNode(Class<T> nodeClass) <V> ValueLane<V>voidLogs a warn-level message.protected voidprotected voidwillLoad()protected voidwillOpen()protected voidprotected voidwillStop()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, unloadMethods 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:
tierContextin interfaceTierBinding- Specified by:
tierContextin classAbstractTierBinding
-
host
- Specified by:
hostin interfaceNodeBinding
-
nodeWrapper
- Specified by:
nodeWrapperin interfaceNodeBinding
-
nodeContext
- Specified by:
nodeContextin interfaceNodeBinding
-
setNodeContext
- Specified by:
setNodeContextin interfaceNodeBinding
-
unwrapNode
- Specified by:
unwrapNodein interfaceNodeBinding
-
bottomNode
- Specified by:
bottomNodein interfaceNodeBinding
-
taskContext
Description copied from interface:Task- Specified by:
taskContextin interfaceTask
-
setTaskContext
Description copied from interface:TaskSets the context used to managed thisTask. ATaskContextis assigned when binding thisTaskto aStage.- Specified by:
setTaskContextin interfaceTask
-
createLaneContext
-
cellAddress
- Specified by:
cellAddressin interfaceCellContext- Specified by:
cellAddressin interfaceNodeBinding
-
edgeName
- Specified by:
edgeNamein interfaceCellContext
-
meshUri
- Specified by:
meshUriin interfaceCellContext- Specified by:
meshUriin interfaceNodeBinding
-
partKey
- Specified by:
partKeyin interfaceNodeBinding
-
hostUri
- Specified by:
hostUriin interfaceNodeBinding
-
nodeUri
- Specified by:
nodeUriin interfaceNodeBinding
-
createdTime
public long createdTime()- Specified by:
createdTimein interfaceNodeBinding
-
identity
-
openMetaNode
- Specified by:
openMetaNodein interfaceNodeBinding
-
openLanes
- Specified by:
openLanesin interfaceNodeBinding
-
agentIds
- Specified by:
agentIdsin interfaceNodeBinding
-
agents
- Specified by:
agentsin interfaceNodeBinding
-
createAgentFactory
- Specified by:
createAgentFactoryin interfaceNodeBinding
-
createAgentFactory
public <A extends Agent> AgentFactory<A> createAgentFactory(NodeBinding node, Class<? extends A> agentClass) - Specified by:
createAgentFactoryin interfaceNodeBinding
-
openAgents
- Specified by:
openAgentsin interfaceNodeBinding
-
lanes
- Specified by:
lanesin interfaceNodeBinding
-
getLane
- Specified by:
getLanein interfaceNodeBinding
-
openLaneView
-
openLane
-
openLane
- Specified by:
openLanein interfaceNodeBinding
-
openLane
- Specified by:
openLanein interfaceNodeBinding
-
closeLane
-
didOpenLane
-
didCloseLane
-
commandLane
- Specified by:
commandLanein interfaceLaneFactory
-
demandLane
- Specified by:
demandLanein interfaceLaneFactory
-
demandMapLane
- Specified by:
demandMapLanein interfaceLaneFactory
-
httpLane
- Specified by:
httpLanein interfaceLaneFactory
-
joinMapLane
- Specified by:
joinMapLanein interfaceLaneFactory
-
joinValueLane
- Specified by:
joinValueLanein interfaceLaneFactory
-
listLane
- Specified by:
listLanein interfaceLaneFactory
-
mapLane
- Specified by:
mapLanein interfaceLaneFactory
-
spatialLane
- Specified by:
spatialLanein interfaceLaneFactory
-
geospatialLane
- Specified by:
geospatialLanein interfaceLaneFactory
-
supplyLane
- Specified by:
supplyLanein interfaceLaneFactory
-
valueLane
- Specified by:
valueLanein interfaceLaneFactory
-
wsLane
- Specified by:
wsLanein interfaceLaneFactory
-
openMetaLane
- Specified by:
openMetaLanein interfaceNodeBinding
-
openMetaUplink
- Specified by:
openMetaUplinkin interfaceNodeBinding
-
openMetaDownlink
- Specified by:
openMetaDownlinkin interfaceCellContext
-
openUplink
- Specified by:
openUplinkin interfaceCellBinding
-
openUnknownUplink
-
bindDownlink
- Specified by:
bindDownlinkin interfaceCellContext
-
openDownlink
- Specified by:
openDownlinkin interfaceCellContext
-
closeDownlink
- Specified by:
closeDownlinkin interfaceCellContext
-
pushUp
- Specified by:
pushUpin interfaceCellBinding
-
pushDown
- Specified by:
pushDownin interfaceCellContext
-
reportDown
- Specified by:
reportDownin interfaceCellContext
-
trace
Description copied from interface:LogLogs a trace-level message. -
debug
Description copied from interface:LogLogs a debug-level message. -
info
Description copied from interface:LogLogs an info-level message. -
warn
Description copied from interface:LogLogs a warn-level message. -
error
Description copied from interface:LogLogs an error-level message. -
fail
Description copied from interface:LogLogs an fail-level message. -
willOpen
protected void willOpen()- Overrides:
willOpenin classAbstractTierBinding
-
willLoad
protected void willLoad()- Overrides:
willLoadin classAbstractTierBinding
-
willStart
protected void willStart()- Overrides:
willStartin classAbstractTierBinding
-
willStop
protected void willStop()- Overrides:
willStopin classAbstractTierBinding
-
willUnload
protected void willUnload()- Overrides:
willUnloadin classAbstractTierBinding
-
willClose
protected void willClose()- Overrides:
willClosein classAbstractTierBinding
-
didClose
public void didClose()- Specified by:
didClosein interfaceTierBinding- Overrides:
didClosein classAbstractTierBinding
-
didFail
- Specified by:
didFailin interfaceTierBinding- Overrides:
didFailin classAbstractTierBinding
-
policy
- Specified by:
policyin interfaceCellContext
-
schedule
- Specified by:
schedulein interfaceCellContext
-
stage
- Specified by:
stagein interfaceCellContext
-
asyncStage
-
store
- Specified by:
storein interfaceCellContext
-
timer
Description copied from interface:ScheduleReturns an unscheduledTimerRefbound totimer, which can later be used to scheduletimer. -
setTimer
Description copied from interface:ScheduleSchedulestimerto execute aftermillismilliseconds have elapsed. Returns aTimerRefthat can be used to check the status of, reschedule, and canceltimer. -
task
Description copied from interface:StageReturns an uncuedTaskRefbound to thetask, which can later be used to cue thetask. -
call
Description copied from interface:StageReturns aCallthat completes thecontinuation. -
execute
Description copied from interface:StageSchedules arunnablefor concurrent execution. -
taskWillBlock
public boolean taskWillBlock()Description copied from interface:TaskReturnstrueif thisTaskmight block its thread of execution when running; returnsfalseif thisTaskwill never block. Used by the executionStageto prevent thread starvation when concurrently running many blocking tasks.- Specified by:
taskWillBlockin interfaceTask
-
runTask
public void runTask()Description copied from interface:TaskExecutes this sequential process. Only one thread at a time will executerunTaskfor thisTask.- Specified by:
runTaskin interfaceTask- Specified by:
runTaskin interfaceTaskFunction
-
taskWillCue
public void taskWillCue()Description copied from interface:TaskLifecycle callback invoked before thisTaskis scheduled for execution.- Specified by:
taskWillCuein interfaceTask
-
taskDidCancel
public void taskDidCancel()Description copied from interface:TaskLifecycle callback invoked after thisTaskis explicitly cancelled.- Specified by:
taskDidCancelin interfaceTask
-
normalizedLaneUri
-