@ SuppressWarnings ( "static-method" ) public boolean canKillAgent ( Agent agent ) { try { final AgentContext ac = BuiltinCapacityUtil . getContextIn ( agent ) ; if ( ac != null ) { final SynchronizedSet < UUID > participants = ac . getDefaultSpace ( ) . getParticipants ( ) ; if ( participants != null ) { synchronized ( participants . mutex ( ) ) { if ( participants . size ( ) > 1 || ( participants . size ( ) == 1 && ! participants . contains ( agent . getID ( ) ) ) ) { return false ; } } } } return true ; } catch ( Throwable exception ) { return false ; } }
Replies if the given agent can be killed .