javax.json.bind.Jsonb.close()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中javax.json.bind.Jsonb.close()方法的一些代码示例,展示了Jsonb.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jsonb.close()方法的具体详情如下:
包路径:javax.json.bind.Jsonb
类名称:Jsonb
方法名:close

Jsonb.close介绍

暂无

代码示例

代码示例来源:origin: org.apache.johnzon/johnzon-jsonb

@Override
  public void close() throws Exception {
    instance.close();
  }
}

代码示例来源:origin: org.apache.geronimo/geronimo-opentracing-common

public void destroy() {
  try {
    jsonb.close();
  } catch (final Exception e) {
    // no-op
  }
}

代码示例来源:origin: org.talend.sdk.component/component-form-core

@Override
  public void close() throws Exception {
    if (closeJsonb) {
      jsonb.close();
    }
  }
}

代码示例来源:origin: apache/johnzon

@Override
  public void close() throws Exception {
    instance.close();
  }
}

代码示例来源:origin: org.talend.sdk.component/component-server

@PreDestroy
private void destroy() {
  try {
    defaultMapper.close();
  } catch (final Exception e) {
    log.error(e.getMessage(), e);
  }
}

代码示例来源:origin: org.apache.tomee/mp-jwt

public void close(@Disposes final Jsonb jsonb) {
    try {
      jsonb.close();

    } catch (final Exception e) {
      log.log(Level.WARNING, e.getMessage(), e);
    }
  }
}

代码示例来源:origin: org.talend.sdk.component/component-runtime-junit

@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;
}

代码示例来源:origin: org.talend.sdk.component/component-starter-server

public void close(@Disposes final Jsonb jsonb) {
    try {
      jsonb.close();
    } catch (final Exception e) {
      log.warn(e.getMessage(), e);
    }
  }
}

代码示例来源:origin: org.talend.sdk.component/component-server-proxy

void disposes(@Disposes @UiSpecProxy final Jsonb jsonb) {
    try {
      jsonb.close();
    } catch (final Exception e) {
      log.error(e.getMessage(), e);
    }
  }
}

代码示例来源:origin: org.talend.sdk.component/component-runtime-junit

@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();
    }
  }
};

代码示例来源:origin: org.talend.sdk.component/component-runtime-manager

@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);
        }
      });
}

相关文章