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.
      • agentId

        swim.structure.Value agentId()
      • props

        swim.structure.Value props()
        A Record that maps every dynamic property in nodeUri(), as defined by AgentRoute.pattern(), 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 single-threaded execution Stage on which this AgentContext runs its application logic.
      • asyncStage

        swim.concurrent.Stage asyncStage()
        The multi-threaded execution Stage on which this AgentContext can 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 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.
      • agents

        swim.collections.FingerTrieSeq<Agent> agents()
      • getAgent

        Agent getAgent​(swim.structure.Value id)
      • getAgent

        <A extends Agent> A getAgent​(Class<? extends A> agentClass)
      • 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​(swim.structure.Value id,
                                      swim.structure.Value props,
                                      Class<? extends A> agentClass)
      • openAgent

        <A extends Agent> A openAgent​(swim.structure.Value id,
                                      Class<? extends A> agentClass)
      • openAgent

        <A extends Agent> A openAgent​(String name,
                                      Class<? extends A> agentClass)
      • closeAgent

        void closeAgent​(swim.structure.Value id)
      • closeAgent

        void closeAgent​(String name)