public void add ( K key , V item ) throws InterruptedException { if ( ! item . isOpen ( ) ) throw new IllegalArgumentException ( "All passed in items should be in open state" ) ; checkOpenFilesLimit ( ) ; final OClosableEntry < K , V > closableEntry = new OClosableEntry < K , V > ( item ) ; final OClosableEntry < K , V > oldEntry = data . putIfAbsent ( key , closableEntry ) ; if ( oldEntry != null ) { throw new IllegalStateException ( "Item with key " + key + " already exists" ) ; } logAdd ( closableEntry ) ; }
Adds item to the container . Item should be in open state .