-
- All Superinterfaces:
DataFactory,DownlinkFactory,LaneFactory,swim.util.Log,SwimRef
public interface AgentContext extends SwimRef, LaneFactory, DataFactory, 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 <A extends Agent>
AaddTrait(String name, Class<A> agentClass)<A extends Agent>
AaddTrait(String name, AgentFactory<A> agentFactory)<A extends Agent>
AaddTrait(swim.structure.Value props, Class<A> agentClass)<A extends Agent>
AaddTrait(swim.structure.Value props, AgentFactory<A> agentFactory)AgentType<?>agentType()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().<A extends Agent>
AgetTrait(Class<A> agentClass)<A extends Agent>
AgetTrait(String name)<A extends Agent>
AgetTrait(swim.structure.Value props)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.LaneopenLane(swim.uri.Uri laneUri, Lane lane)RegisterslanewithlaneUriand returnslane.swim.structure.Valueprops()ARecordthat maps every dynamic property innodeUri(), as defined by{@code agentType().route()}, to its value.voidremoveTrait(String name)voidremoveTrait(swim.structure.Value props)swim.concurrent.Scheduleschedule()TheSchedulethat thisAgentContextis bound to.swim.concurrent.Stagestage()TheStagethat thisAgentContextis bound to.swim.collections.FingerTrieSeq<Agent>traits()-
Methods inherited from interface swim.api.data.DataFactory
geospatialData, geospatialData, listData, listData, mapData, mapData, spatialData, spatialData, valueData, valueData
-
Methods inherited from interface swim.api.downlink.DownlinkFactory
downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue
-
Methods inherited from interface swim.api.lane.LaneFactory
commandLane, demandLane, demandMapLane, geospatialLane, joinMapLane, joinValueLane, listLane, mapLane, spatialLane, supplyLane, valueLane
-
-
-
-
Method Detail
-
hostUri
swim.uri.Uri hostUri()
ThehostUriof theAgentmanaged by thisAgentContext.
-
nodeUri
swim.uri.Uri nodeUri()
ThenodeUriof theAgentmanaged by thisAgentContext.
-
agentType
AgentType<?> agentType()
-
props
swim.structure.Value props()
ARecordthat maps every dynamic property innodeUri(), as defined by{@code agentType().route()}, 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()
TheStagethat thisAgentContextis bound to.
-
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.
-
traits
swim.collections.FingerTrieSeq<Agent> traits()
-
getTrait
<A extends Agent> A getTrait(swim.structure.Value props)
-
addTrait
<A extends Agent> A addTrait(swim.structure.Value props, AgentFactory<A> agentFactory)
-
addTrait
<A extends Agent> A addTrait(String name, AgentFactory<A> agentFactory)
-
removeTrait
void removeTrait(swim.structure.Value props)
-
removeTrait
void removeTrait(String name)
-
getLane
Lane getLane(swim.uri.Uri laneUri)
Returns theLanebelonging to theAgentmanaged by thisAgentContextthat is addressable bylaneUri, ornullif no suchLaneexists.
-
-