xapi.util.X_Runtime类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(139)

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

X_Runtime介绍

[英]This class is magic; there are four copies of this class; do not add anything to them unless you download all xapi source, and do a full text search on "X_Runtime\s+{" This is the public class exposed to a jre. Each method compiles down to a runtime constant, or as close a possible, to encourage compiler inlining. Then, we super-source a copy for normal gwt builds, which reports false for isRuntimeInjection, and GWT.isScript() for isGwtProd(). For gwt users who inherit xapi.X_Inject, we use magic method injection to replace the super-sourced copy of #isRuntimeInjection() to return true or false, depending on the configuration present in gwt module xml. Finally, our xapi-debug module will override X_Runtime in the classloader, to return true for isDebug().
[中]

代码示例

代码示例来源:origin: net.wetheinter/xapi-core-api

  1. @Override
  2. public boolean select(Object ... context) {
  3. return X_Runtime.isDebug();
  4. }
  5. }

代码示例来源:origin: net.wetheinter/xapi-core-collect

  1. public Builder() {
  2. concurrent = X_Runtime.isMultithreaded();
  3. }

代码示例来源:origin: net.wetheinter/xapi-jre-inject

  1. if (X_Runtime.isDebug()) {
  2. X_Log.info("Multithreaded? ", X_Runtime.isMultithreaded());
  3. X_Log.info("Prepped: ", X_Time.difference(start, prepped));
  4. X_Log.info("Scanned: ", X_Time.difference(prepped, scanned));

代码示例来源:origin: net.wetheinter/xapi-core-api

  1. public static Throwable unwrap(Throwable e) {
  2. if (X_Runtime.isDebug()) {
  3. e.printStackTrace();// Avoid losing information in debug mode.
  4. }
  5. //don't use instanceof because we don't want to treat subclasses of RuntimeException as wrappers...
  6. while (e.getClass().equals(RuntimeException.class) || e.getClass().equals(ExecutionException.class)) {
  7. if (e.getCause() == null) {
  8. return e;
  9. }
  10. e = e.getCause();
  11. }
  12. return e;
  13. }

代码示例来源:origin: net.wetheinter/xapi-core-process

  1. public boolean isMultiThreaded() {
  2. return X_Runtime.isMultithreaded();
  3. }

代码示例来源:origin: net.wetheinter/xapi-dev-maven

  1. @Override
  2. protected ClassLoader initialValue() {
  3. if (X_Runtime.isDebug()) {
  4. X_Log.info("Maven compile scope: "+X_String.joinObjects(urls));
  5. }
  6. return new URLClassLoader(urls, X_Maven.class.getClassLoader());
  7. };
  8. };

代码示例来源:origin: net.wetheinter/xapi-core-collect

  1. protected boolean isMultithreaded() {
  2. return X_Runtime.isMultithreaded();
  3. }

代码示例来源:origin: net.wetheinter/xapi-core-io

  1. } catch (final Throwable e) {
  2. callback.onError(e);
  3. if (X_Runtime.isDebug()) {
  4. X_Log.warn("IO Error", e);

代码示例来源:origin: net.wetheinter/xapi-core-collect

  1. protected <K, V> Map<K,V> newMap(final CollectionOptions opts) {
  2. if (opts.insertionOrdered()) {
  3. if (opts.concurrent()) {
  4. // TODO: something with better performance...
  5. // Perhaps supersource ConcurrentSkipListMap,
  6. // and remove all the contention-worries that plague its implementation
  7. return synchronizedMap(new LinkedHashMap<K, V>());
  8. } else {
  9. return new LinkedHashMap<K, V>();
  10. }
  11. }
  12. if (X_Runtime.isMultithreaded()) {
  13. return new ConcurrentHashMap<K,V>();
  14. } else {
  15. return new HashMap<K,V>();
  16. }
  17. }

代码示例来源:origin: net.wetheinter/xapi-core-io

  1. } catch (final Throwable e) {
  2. callback.onError(e);
  3. if (X_Runtime.isDebug()) {
  4. X_Log.warn("IO Error", e);

代码示例来源:origin: net.wetheinter/xapi-gwt-io

  1. } catch (final Throwable e) {
  2. callback.onError(e);
  3. if (X_Runtime.isDebug()) {
  4. X_Log.error(getClass(), "Error sending request",url,e);

代码示例来源:origin: net.wetheinter/xapi-gwt-io

  1. @Override
  2. public IORequest<String> get(final String uri, final StringDictionary<String> headers, final IOCallback<IOMessage<String>> callback) {
  3. final String url = normalize(uri);
  4. if (callback.isCancelled()) {
  5. return cancelled;
  6. }
  7. try {
  8. final RequestBuilder request = newRequest(RequestBuilder.GET, url);
  9. normalizeHeaders(headers).forKeys(new ReceivesValue<String>() {
  10. @Override
  11. public void set(final String key) {
  12. final String value = headers.getValue(key);
  13. request.setHeader(key, value);
  14. }
  15. });
  16. applySettings(request, IOConstants.METHOD_GET);
  17. final IORequestGwt req = createRequest();
  18. sendRequest(request, req, callback, url, headers, IOConstants.METHOD_GET, null);
  19. return req;
  20. } catch (final Throwable e) {
  21. callback.onError(e);
  22. if (X_Runtime.isDebug()) {
  23. X_Log.warn("IO Error", e);
  24. }
  25. return cancelled;
  26. }
  27. }

代码示例来源:origin: net.wetheinter/xapi-gwt-io

  1. } catch (final Throwable e) {
  2. callback.onError(e);
  3. if (X_Runtime.isDebug()) {
  4. X_Log.warn("IO Error", e);

代码示例来源:origin: net.wetheinter/xapi-gwt-inject

  1. if (X_Runtime.isDebug()) {
  2. logger.log(Type.INFO, "Dumping javascript injector (trace level logging)");
  3. if (logger.isLoggable(Type.TRACE))

代码示例来源:origin: net.wetheinter/xapi-core-io

  1. @Override
  2. public void onSuccess(final IOMessage<String> t) {
  3. if (cancel) {
  4. if (X_Runtime.isDebug()) {
  5. X_Log.trace("Ignoring cancelled message", t.url(), t.body());
  6. }
  7. return;
  8. }
  9. request.pending = false;
  10. request.statusCode = t.statusCode();
  11. request.statusText = t.statusMessage();
  12. if (deserializer == null) {
  13. assert X_String.isEmpty(t.body()) : "Non-null response without a " +
  14. "deserializer instance for "+url+"\n Response: "+t.body();
  15. } else {
  16. result.set(deserializer.convert(t.body()));
  17. }
  18. if (handler != null) {
  19. handler.onSuccess(result.get());
  20. }
  21. }

代码示例来源:origin: net.wetheinter/xapi-gwt-reflect

  1. "No array reflection support for \"+ c.getName() + \"; " +
  2. "ensure this class is annotated with @KeepArrays."+
  3. (X_Runtime.isDebug()?" This annotation allows you to add support for " +
  4. "any class with the alsoKeep() method, that allows you to keep " +
  5. "array support for types without directly annotating them (like java.lang classes).":"")+
  6. if (X_Runtime.isDebug()) {
  7. logger.log(Type.INFO, "Generated reflection support for "+needMagicClass.size()+" classes.");
  8. logger.log(Type.WARN, sw.toString());

相关文章