@ SuppressWarnings ( value = "unchecked" ) < T , K extends SharedResourceKey > SharedResourceFactoryResponse < T > getScopedFromCache ( final SharedResourceFactory < T , K , S > factory , @ Nonnull final K key , @ Nonnull final ScopeWrapper < S > scope , final SharedResourcesBrokerImpl < S > broker ) throws ExecutionException { RawJobBrokerKey fullKey = new RawJobBrokerKey ( scope , factory . getName ( ) , key ) ; Object obj = this . sharedResourceCache . get ( fullKey , new Callable < Object > ( ) { @ Override public Object call ( ) throws Exception { return factory . createResource ( broker . getScopedView ( scope . getType ( ) ) , broker . getConfigView ( scope . getType ( ) , key , factory . getName ( ) ) ) ; } } ) ; return ( SharedResourceFactoryResponse < T > ) obj ; }
Get a scoped object from the cache .