Class AgentSpacesA2aLifecycle

java.lang.Object
ai.badmonkey.agentspaces.spring.AgentSpacesA2aLifecycle
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class AgentSpacesA2aLifecycle extends Object implements org.springframework.context.SmartLifecycle
Starts the A2A gateway after the fabric and stops it before (TODO item 7): the same phase discipline as the console lifecycle.
  • Constructor Details

    • AgentSpacesA2aLifecycle

      public AgentSpacesA2aLifecycle(A2aGateway gateway, String bind, int port)
      Creates the lifecycle.
      Parameters:
      gateway - the gateway to start and stop
      bind - the address to listen on
      port - the port; 0 picks a free port
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • boundPort

      public int boundPort()
      The bound port, for tests and logs.
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle