@Override protected void afterRun() { try { idQ.offer(id); } catch (Throwable ignored) { ignore(ignored); } } }
private static URL asURL(final String path) { try { return new URL(path); } catch (MalformedURLException ignored) { ignore(ignored); } return null; }
private static URL asURL(final String path) { try { return new URL(path); } catch (MalformedURLException ignored) { ignore(ignored); } return null; }
private void sleepInterval(long nowNanos) { try { TimeUnit.NANOSECONDS.sleep(ONE_SECOND_IN_NANOS - (System.nanoTime() - nowNanos)); } catch (Exception ignored) { ignore(ignored); } }
private void sleepInterval(long nowNanos) { try { TimeUnit.NANOSECONDS.sleep(ONE_SECOND_IN_NANOS - (System.nanoTime() - nowNanos)); } catch (Exception ignored) { ignore(ignored); } }
private static URL asFile(final String path) { File file = new File(path); if (file.exists()) { try { return file.toURI().toURL(); } catch (MalformedURLException ignored) { ignore(ignored); } } return null; }
private static URL asFile(final String path) { File file = new File(path); if (file.exists()) { try { return file.toURI().toURL(); } catch (MalformedURLException ignored) { ignore(ignored); } } return null; }
private static void tryShutdown(HazelcastClientInstanceImpl client) { try { client.doShutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
private static <T> T getOrInstantiate(T instance, ClassLoader classLoader, String className) { if (instance != null) { return instance; } try { return ClassLoaderUtil.newInstance(classLoader, className); } catch (Exception ignored) { ignore(ignored); } return null; }
public static LoginModuleUsage get(String v) { try { return LoginModuleUsage.valueOf(v.toUpperCase(StringUtil.LOCALE_INTERNAL)); } catch (Exception ignore) { ignore(ignore); } return REQUIRED; } }
private static void closeSockets(HazelcastInstanceImpl factory) { if (factory.node.connectionManager != null) { try { factory.node.connectionManager.shutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
@Override public void close(EventRegistration eventRegistration) { Registration registration = (Registration) eventRegistration; Object listener = registration.getListener(); if (!(listener instanceof Closeable)) { return; } try { ((Closeable) listener).close(); } catch (IOException e) { ignore(e); } }
private static void tryShutdown(HazelcastClientInstanceImpl client) { try { client.doShutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
@Override public final V get() throws InterruptedException, ExecutionException { for (; ; ) { try { return get(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (TimeoutException ignored) { // A timeout here can only be a spurious artifact. // It should never happen and even if it does, we must retry. ignore(ignored); } } }
private static void closeSockets(HazelcastInstanceImpl factory) { if (factory.node.connectionManager != null) { try { factory.node.connectionManager.shutdown(); } catch (Throwable ignored) { ignore(ignored); } } }
private DistributedObject extractDistributedObject(DistributedObjectFuture future) { try { return future.get(); } catch (Throwable ex) { EmptyStatement.ignore(ex); } return null; }
@Override public final V get() throws InterruptedException, ExecutionException { for (; ; ) { try { return get(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (TimeoutException ignored) { // A timeout here can only be a spurious artifact. // It should never happen and even if it does, we must retry. ignore(ignored); } } }
/** * Ensures that the file described by the supplied parameter does not exist * after the method returns. If the file didn't exist, returns silently. * If the file could not be deleted, returns silently. * If the file is a directory, its children are recursively deleted. */ public static void deleteQuietly(File f) { try { delete(f); } catch (Exception e) { ignore(e); } }
private void deregisterLifecycleListener() { LifecycleService lifecycleService = hazelcastInstance.getLifecycleService(); try { lifecycleService.removeLifecycleListener(lifecycleListenerRegistrationId); } catch (HazelcastInstanceNotActiveException e) { // if hazelcastInstance is already terminated, // `lifecycleService.removeLifecycleListener()` will throw a // HazelcastInstanceNotActiveException, which we can safely ignore // (see TerminatedLifecycleService) ignore(e); } }
public void refreshPartitions() { try { // use internal execution service for all partition refresh process (do not use the user executor thread) clientExecutionService.execute(new RefreshTask()); } catch (RejectedExecutionException ignored) { ignore(ignored); } }