-
- All Superinterfaces:
DownlinkFactory
,LaneFactory
,Log
,Store
,SwimRef
- All Known Implementing Classes:
AgentView
public interface AgentContext extends SwimRef, LaneFactory, Store, Log
Internal context that enables URI-based addressability, contextualLane
andStore
creation mechanisms, logging, and scheduling to someAgent
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends Agent>
AaddAgent(String name, Class<? extends A> agentClass)
<A extends Agent>
AaddAgent(String name, AgentFactory<A> agentFactory)
<A extends Agent>
AaddAgent(Value props, Class<? extends A> agentClass)
<A extends Agent>
AaddAgent(Value props, AgentFactory<A> agentFactory)
FingerTrieSeq<Agent>
agents()
<A extends Agent>
AgetAgent(Class<? extends A> agentClass)
Agent
getAgent(String name)
Agent
getAgent(Value props)
Lane
getLane(Uri laneUri)
Returns theLane
belonging to theAgent
managed by thisAgentContext
that is addressable bylaneUri
, ornull
if no suchLane
exists.Value
getProp(String name)
Returns the value ofname
inprops()
.Value
getProp(Value key)
Returns the value ofkey
inprops()
.Uri
hostUri()
ThehostUri
of theAgent
managed by thisAgentContext
.Lane
lane()
Returns the currently executing lane, or null if not currently executing a lane or link callback.Link
link()
Returns the currently executing link, or null if not currently executing a link callback.Uri
nodeUri()
ThenodeUri
of theAgent
managed by thisAgentContext
.Lane
openLane(Uri laneUri, Lane lane)
Registerslane
withlaneUri
and returnslane
.Value
props()
ARecord
that maps every dynamic property innodeUri()
, as defined byAgentRoute.pattern()
, to its value.void
removeAgent(String name)
void
removeAgent(Value props)
Schedule
schedule()
TheSchedule
that thisAgentContext
is bound to.Stage
stage()
TheStage
that thisAgentContext
is bound to.-
Methods inherited from interface swim.api.downlink.DownlinkFactory
downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs
-
Methods inherited from interface swim.api.lane.LaneFactory
commandLane, demandLane, demandMapLane, geospatialLane, httpLane, joinMapLane, joinValueLane, listLane, mapLane, spatialLane, supplyLane, valueLane, wsLane
-
Methods inherited from interface swim.api.store.Store
geospatialData, geospatialData, listData, listData, mapData, mapData, spatialData, spatialData, valueData, valueData
-
-
-
-
Method Detail
-
hostUri
Uri hostUri()
ThehostUri
of theAgent
managed by thisAgentContext
.
-
nodeUri
Uri nodeUri()
ThenodeUri
of theAgent
managed by thisAgentContext
.
-
props
Value props()
ARecord
that maps every dynamic property innodeUri()
, as defined byAgentRoute.pattern()
, to its value. An empty result indicates thatnodeUri
contains no dynamic components.
-
lane
Lane lane()
Returns the currently executing lane, or null if not currently executing a lane or link callback.
-
link
Link link()
Returns the currently executing link, or null if not currently executing a link callback.
-
getLane
Lane getLane(Uri laneUri)
Returns theLane
belonging to theAgent
managed by thisAgentContext
that is addressable bylaneUri
, ornull
if no suchLane
exists.
-
agents
FingerTrieSeq<Agent> agents()
-
addAgent
<A extends Agent> A addAgent(Value props, AgentFactory<A> agentFactory)
-
addAgent
<A extends Agent> A addAgent(String name, AgentFactory<A> agentFactory)
-
removeAgent
void removeAgent(Value props)
-
removeAgent
void removeAgent(String name)
-
-