@ Override public Collection < GroovyRunner > values ( ) { List < GroovyRunner > values = cachedValues ; if ( values == null ) { Map < String , GroovyRunner > map = getMap ( ) ; // racy, multiple threads may set cachedValues but rather have that than take a write lock readLock . lock ( ) ; try { if ( ( values = cachedValues ) == null ) { cachedValues = values = Collections . unmodifiableList ( new ArrayList <> ( map . values ( ) ) ) ; } } finally { readLock . unlock ( ) ; } } return values ; }
Returns a collection of all registered runners . This is a snapshot of the registry and any subsequent registry changes will not be reflected in the collection .