List of usage examples for java.util.concurrent ScheduledThreadPoolExecutor getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.amazonaws.http.HttpRequestTimer.java
/** * {@link ScheduledThreadPoolExecutor#setRemoveOnCancelPolicy(boolean)} is not available in Java * 6 so we invoke it with reflection to be able to compile against Java 6. * /* w w w .j a v a2s .co m*/ * @param executor */ private static void safeSetRemoveOnCancel(ScheduledThreadPoolExecutor executor) { try { executor.getClass().getMethod("setRemoveOnCancelPolicy", boolean.class).invoke(executor, Boolean.TRUE); } catch (IllegalAccessException e) { throwSetRemoveOnCancelException(e); } catch (IllegalArgumentException e) { throwSetRemoveOnCancelException(e); } catch (InvocationTargetException e) { throwSetRemoveOnCancelException(e.getCause()); } catch (NoSuchMethodException e) { throw new AmazonClientException( "The request timeout feature is only available for Java 1.7 and above."); } catch (SecurityException e) { throw new AmazonClientException("The request timeout feature needs additional permissions to function.", e); } }