@Override public void close() throws Exception { instance.close(); } }
public void destroy() { try { jsonb.close(); } catch (final Exception e) { // no-op } }
@Override public void close() throws Exception { if (closeJsonb) { jsonb.close(); } } }
@Override public void close() throws Exception { instance.close(); } }
@PreDestroy private void destroy() { try { defaultMapper.close(); } catch (final Exception e) { log.error(e.getMessage(), e); } }
public void close(@Disposes final Jsonb jsonb) { try { jsonb.close(); } catch (final Exception e) { log.log(Level.WARNING, e.getMessage(), e); } } }
@Override public boolean hasMoreData() { final boolean hasMore = !data.isEmpty() && data.entrySet().stream().allMatch(e -> e.getValue().hasNext()); if (!hasMore && jsonb != null) { synchronized (this) { if (jsonb != null) { try { jsonb.close(); } catch (final Exception e) { // no-op: not important here } } } } return hasMore; }
public void close(@Disposes final Jsonb jsonb) { try { jsonb.close(); } catch (final Exception e) { log.warn(e.getMessage(), e); } } }
void disposes(@Disposes @UiSpecProxy final Jsonb jsonb) { try { jsonb.close(); } catch (final Exception e) { log.error(e.getMessage(), e); } } }
@Override public void close() { try { final State state = STATE.get(); if (state.jsonb != null) { try { state.jsonb.close(); } catch (final Exception e) { // no-op: not important } } STATE.remove(); initState.remove(); } finally { super.close(); } } };
@Override public void onClose(final Container container) { // ensure we don't keep any data/ref after the classloader of the container is // released ofNullable(container.get(ContainerComponentRegistry.class)).ifPresent(r -> { final ContainerComponentRegistry registry = container.remove(ContainerComponentRegistry.class); registry.getComponents().clear(); registry .getServices() .stream() .filter(i -> !Proxy.isProxyClass(i.getInstance().getClass())) .forEach(s -> doInvoke(container.getId(), s.getInstance(), PreDestroy.class)); registry.getServices().clear(); }); ofNullable(container.get(AllServices.class)) .map(s -> s.getServices().get(Jsonb.class)) .map(Jsonb.class::cast) .ifPresent(jsonb -> { try { jsonb.close(); } catch (final Exception e) { log.warn(e.getMessage(), e); } }); }