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.
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionAgentSpacesA2aLifecycle(A2aGateway gateway, String bind, int port) Creates the lifecycle. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup, stop
-
Constructor Details
-
AgentSpacesA2aLifecycle
Creates the lifecycle.- Parameters:
gateway- the gateway to start and stopbind- the address to listen onport- the port; 0 picks a free port
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
boundPort
public int boundPort()The bound port, for tests and logs. -
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-