Module swim.api

Interface AgentContext

    • Method Detail

      • hostUri

        swim.uri.Uri hostUri()
        The hostUri of the Agent managed by this AgentContext.
      • nodeUri

        swim.uri.Uri nodeUri()
        The nodeUri of the Agent managed by this AgentContext.
      • agentType

        AgentType<?> agentType()
        The AgentType corresponding to the Java class of the Agent that this AgentContext manages.
      • props

        swim.structure.Value props()
        A Record that maps every dynamic property in nodeUri(), as defined by {@code agentType().route()}, to its value. An empty result indicates that nodeUri contains no dynamic components.
      • getProp

        swim.structure.Value getProp​(swim.structure.Value key)
        Returns the value of key in props().
      • getProp

        swim.structure.Value getProp​(String name)
        Returns the value of name in props().
      • schedule

        swim.concurrent.Schedule schedule()
        The Schedule that this AgentContext is bound to.
      • stage

        swim.concurrent.Stage stage()
        The Stage that this AgentContext is 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)
      • getTrait

        <A extends Agent> A getTrait​(String name)
      • getTrait

        <A extends Agent> A getTrait​(Class<A> agentClass)
      • addTrait

        <A extends Agent> A addTrait​(swim.structure.Value props,
                                     AgentFactory<A> agentFactory)
      • addTrait

        <A extends Agent> A addTrait​(swim.structure.Value props,
                                     Class<A> agentClass)
      • addTrait

        <A extends Agent> A addTrait​(String name,
                                     Class<A> agentClass)
      • removeTrait

        void removeTrait​(swim.structure.Value props)
      • removeTrait

        void removeTrait​(String name)
      • getLane

        Lane getLane​(swim.uri.Uri laneUri)
        Returns the Lane belonging to the Agent managed by this AgentContext that is addressable by laneUri, or null if no such Lane exists.
      • openLane

        Lane openLane​(swim.uri.Uri laneUri,
                      Lane lane)
        Registers lane with laneUri and returns lane.