public Object removeControlledObject ( Authorizable object ) { Object removed = null ; for ( Iterator iter = controlledObjects . iterator ( ) ; iter . hasNext ( ) ; ) { WeakReference ref = ( WeakReference ) iter . next ( ) ; Authorizable controlledObject = ( Authorizable ) ref . get ( ) ; if ( controlledObject == null ) { // Has been GCed, remove from our list iter . remove ( ) ; } else if ( controlledObject . equals ( object ) ) { removed = controlledObject ; iter . remove ( ) ; } } return removed ; }
Remove an object from our controlled set .