protected void agentCreated ( ClientObject client , int agentId ) { FoundAgent found = resolve ( client , agentId , "agentCreated" ) ; if ( found == null ) { return ; } log . info ( "Agent creation confirmed" , "agent" , found . agent . which ( ) ) ; if ( found . state == AgentState . STARTED ) { found . bureau . agentStates . put ( found . agent , AgentState . RUNNING ) ; found . agent . setClientOid ( client . getOid ( ) ) ; } else if ( found . state == AgentState . STILL_BORN ) { // TODO: have a timeout for this in case the client is misbehaving or hung BureauSender . destroyAgent ( found . bureau . clientObj , agentId ) ; found . bureau . agentStates . put ( found . agent , AgentState . DESTROYED ) ; } else if ( found . state == AgentState . PENDING || found . state == AgentState . RUNNING || found . state == AgentState . DESTROYED ) { log . warning ( "Ignoring confirmation of creation of an agent in an unexpected state" , "state" , found . state , "agent" , found . agent . which ( ) ) ; } found . bureau . summarize ( ) ; }
Callback for when the bureau client acknowledges the creation of an agent .