public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, new ValueLoadedCallback.NoOpCallback<T>()); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
protected Supplier<Set<? extends Image>> supplyImageCache(AtomicReference<AuthorizationException> authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final Supplier<Set<? extends Image>> imageSupplier) { return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, imageSupplier, seconds, TimeUnit.SECONDS); }
MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier(AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { this.delegate = delegate; this.duration = duration; this.unit = unit; this.cache = CacheBuilder.newBuilder().expireAfterWrite(duration, unit) .build(new SetAndThrowAuthorizationExceptionSupplierBackedLoader<T>(delegate, authException)); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, new ValueLoadedCallback.NoOpCallback<T>()); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier(AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { this.delegate = delegate; this.duration = duration; this.unit = unit; this.cache = CacheBuilder.newBuilder().expireAfterWrite(duration, unit) .build(new SetAndThrowAuthorizationExceptionSupplierBackedLoader<T>(delegate, authException)); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, new ValueLoadedCallback.NoOpCallback<T>()); }
public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
/** * Creates a memoized supplier that calls the given callback each time values are loaded. */ public static <T> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T> create( AtomicReference<AuthorizationException> authException, Supplier<T> delegate, long duration, TimeUnit unit, ValueLoadedCallback<T> valueLoadedCallback) { return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier<T>(authException, delegate, duration, unit, valueLoadedCallback); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }
@Override public Image load(final RegionAndName key) throws Exception { // raw lookup of an image Supplier<Image> rawSupplier = new Supplier<Image>() { @Override public Image get() { try { return delegate.load(key); } catch (ExecutionException e) { throw Throwables.propagate(e); } } }; return new SetAndThrowAuthorizationExceptionSupplier<Image>(rawSupplier, authException).get(); }