-
- All Superinterfaces:
DownlinkFactory,LaneFactory,swim.util.Log,Store,WarpRef
public interface AgentContext extends WarpRef, LaneFactory, Store, swim.util.Log
Internal context that enables URI-based addressability, contextualLaneandStorecreation mechanisms, logging, and scheduling to someAgent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description swim.structure.ValueagentId()swim.collections.FingerTrieSeq<Agent>agents()swim.concurrent.StageasyncStage()The multi-threaded executionStageon which thisAgentContextcan run asynchronous operations.voidcloseAgent(String name)voidcloseAgent(swim.structure.Value id)<A extends Agent>
AgetAgent(Class<? extends A> agentClass)AgentgetAgent(String name)AgentgetAgent(swim.structure.Value id)LanegetLane(swim.uri.Uri laneUri)Returns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.swim.structure.ValuegetProp(String name)Returns the value ofnameinprops().swim.structure.ValuegetProp(swim.structure.Value key)Returns the value ofkeyinprops().swim.uri.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.swim.uri.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(swim.structure.Value id, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(swim.structure.Value id, AgentFactory<A> agentFactory)<A extends Agent>
AopenAgent(swim.structure.Value id, swim.structure.Value props, Class<? extends A> agentClass)<A extends Agent>
AopenAgent(swim.structure.Value id, swim.structure.Value props, AgentFactory<A> agentFactory)LaneopenLane(swim.uri.Uri laneUri, Lane lane)RegisterslanewithlaneUriand returnslane.swim.structure.Valueprops()ARecordthat maps every dynamic property innodeUri(), as defined byAgentRoute.pattern(), to its value.swim.concurrent.Scheduleschedule()TheSchedulethat thisAgentContextis bound to.swim.concurrent.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
swim.uri.Uri hostUri()
ThehostUriof theAgentmanaged by thisAgentContext.
-
nodeUri
swim.uri.Uri nodeUri()
ThenodeUriof theAgentmanaged by thisAgentContext.
-
agentId
swim.structure.Value agentId()
-
props
swim.structure.Value props()
ARecordthat maps every dynamic property innodeUri(), as defined byAgentRoute.pattern(), to its value. An empty result indicates thatnodeUricontains no dynamic components.
-
getProp
swim.structure.Value getProp(swim.structure.Value key)
Returns the value ofkeyinprops().
-
schedule
swim.concurrent.Schedule schedule()
TheSchedulethat thisAgentContextis bound to.
-
stage
swim.concurrent.Stage stage()
The single-threaded executionStageon which thisAgentContextruns its application logic.
-
asyncStage
swim.concurrent.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(swim.uri.Uri laneUri)
Returns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.
-
openLane
Lane openLane(swim.uri.Uri laneUri, Lane lane)
RegisterslanewithlaneUriand returnslane.
-
agents
swim.collections.FingerTrieSeq<Agent> agents()
-
getAgent
Agent getAgent(swim.structure.Value id)
-
openAgent
<A extends Agent> A openAgent(swim.structure.Value id, swim.structure.Value props, AgentFactory<A> agentFactory)
-
openAgent
<A extends Agent> A openAgent(swim.structure.Value id, AgentFactory<A> agentFactory)
-
openAgent
<A extends Agent> A openAgent(String name, AgentFactory<A> agentFactory)
-
openAgent
<A extends Agent> A openAgent(swim.structure.Value id, swim.structure.Value props, Class<? extends A> agentClass)
-
closeAgent
void closeAgent(swim.structure.Value id)
-
closeAgent
void closeAgent(String name)
-
-