-
- 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, contextualLaneandStorecreation mechanisms, logging, and scheduling to someAgent.
-
-
Method Summary
Modifier and Type Method Description ValueagentId()FingerTrieSeq<Agent>agents()StageasyncStage()The multi-threaded executionStageon which thisAgentContextcan run asynchronous operations.voidcloseAgent(String name)voidcloseAgent(Value id)<A extends Agent>
AgetAgent(Class<? extends A> agentClass)AgentgetAgent(String name)AgentgetAgent(Value id)LanegetLane(Uri laneUri)Returns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.ValuegetProp(String name)Returns the value ofnameinprops().ValuegetProp(Value key)Returns the value ofkeyinprops().UrihostUri()ThehostUriof theAgentmanaged by thisAgentContext.Lanelane()Returns the currently executing lane, or null if not currently executing a lane or link callback.Linklink()Returns the currently executing link, or null if not currently executing a link callback.UrinodeUri()ThenodeUriof theAgentmanaged by thisAgentContext.<A extends Agent>
AopenAgent(String name, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(String name, AgentFactory<A> agentFactory)<A extends Agent>
AopenAgent(Value id, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(Value id, AgentFactory<A> agentFactory)<A extends Agent>
AopenAgent(Value id, Value props, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(Value id, Value props, AgentFactory<A> agentFactory)LaneopenLane(Uri laneUri, Lane lane)RegisterslanewithlaneUriand returnslane.Valueprops()ARecordthat maps every dynamic property innodeUri(), as defined byAgentRoute.pattern(), to its value.Scheduleschedule()TheSchedulethat thisAgentContextis bound to.Stagestage()The single-threaded executionStageon which thisAgentContextruns its application logic.-
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()
ThehostUriof theAgentmanaged by thisAgentContext.
-
nodeUri
Uri nodeUri()
ThenodeUriof theAgentmanaged by thisAgentContext.
-
agentId
Value agentId()
-
props
Value props()
ARecordthat maps every dynamic property innodeUri(), as defined byAgentRoute.pattern(), to its value. An empty result indicates thatnodeUricontains no dynamic components.
-
stage
Stage stage()
The single-threaded executionStageon which thisAgentContextruns its application logic.
-
asyncStage
Stage asyncStage()
The multi-threaded executionStageon which thisAgentContextcan run asynchronous operations.
-
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 theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.
-
agents
FingerTrieSeq<Agent> agents()
-
openAgent
<A extends Agent> A openAgent(Value id, Value props, AgentFactory<A> agentFactory)
-
openAgent
<A extends Agent> A openAgent(Value id, AgentFactory<A> agentFactory)
-
openAgent
<A extends Agent> A openAgent(String name, AgentFactory<A> agentFactory)
-
closeAgent
void closeAgent(Value id)
-
closeAgent
void closeAgent(String name)
-
-