本文整理了Java中xapi.util.X_Runtime
类的一些代码示例,展示了X_Runtime
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X_Runtime
类的具体详情如下:
包路径:xapi.util.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
@Override
public boolean select(Object ... context) {
return X_Runtime.isDebug();
}
}
代码示例来源:origin: net.wetheinter/xapi-core-collect
public Builder() {
concurrent = X_Runtime.isMultithreaded();
}
代码示例来源:origin: net.wetheinter/xapi-jre-inject
if (X_Runtime.isDebug()) {
X_Log.info("Multithreaded? ", X_Runtime.isMultithreaded());
X_Log.info("Prepped: ", X_Time.difference(start, prepped));
X_Log.info("Scanned: ", X_Time.difference(prepped, scanned));
代码示例来源:origin: net.wetheinter/xapi-core-api
public static Throwable unwrap(Throwable e) {
if (X_Runtime.isDebug()) {
e.printStackTrace();// Avoid losing information in debug mode.
}
//don't use instanceof because we don't want to treat subclasses of RuntimeException as wrappers...
while (e.getClass().equals(RuntimeException.class) || e.getClass().equals(ExecutionException.class)) {
if (e.getCause() == null) {
return e;
}
e = e.getCause();
}
return e;
}
代码示例来源:origin: net.wetheinter/xapi-core-process
public boolean isMultiThreaded() {
return X_Runtime.isMultithreaded();
}
代码示例来源:origin: net.wetheinter/xapi-dev-maven
@Override
protected ClassLoader initialValue() {
if (X_Runtime.isDebug()) {
X_Log.info("Maven compile scope: "+X_String.joinObjects(urls));
}
return new URLClassLoader(urls, X_Maven.class.getClassLoader());
};
};
代码示例来源:origin: net.wetheinter/xapi-core-collect
protected boolean isMultithreaded() {
return X_Runtime.isMultithreaded();
}
代码示例来源:origin: net.wetheinter/xapi-core-io
} catch (final Throwable e) {
callback.onError(e);
if (X_Runtime.isDebug()) {
X_Log.warn("IO Error", e);
代码示例来源:origin: net.wetheinter/xapi-core-collect
protected <K, V> Map<K,V> newMap(final CollectionOptions opts) {
if (opts.insertionOrdered()) {
if (opts.concurrent()) {
// TODO: something with better performance...
// Perhaps supersource ConcurrentSkipListMap,
// and remove all the contention-worries that plague its implementation
return synchronizedMap(new LinkedHashMap<K, V>());
} else {
return new LinkedHashMap<K, V>();
}
}
if (X_Runtime.isMultithreaded()) {
return new ConcurrentHashMap<K,V>();
} else {
return new HashMap<K,V>();
}
}
代码示例来源:origin: net.wetheinter/xapi-core-io
} catch (final Throwable e) {
callback.onError(e);
if (X_Runtime.isDebug()) {
X_Log.warn("IO Error", e);
代码示例来源:origin: net.wetheinter/xapi-gwt-io
} catch (final Throwable e) {
callback.onError(e);
if (X_Runtime.isDebug()) {
X_Log.error(getClass(), "Error sending request",url,e);
代码示例来源:origin: net.wetheinter/xapi-gwt-io
@Override
public IORequest<String> get(final String uri, final StringDictionary<String> headers, final IOCallback<IOMessage<String>> callback) {
final String url = normalize(uri);
if (callback.isCancelled()) {
return cancelled;
}
try {
final RequestBuilder request = newRequest(RequestBuilder.GET, url);
normalizeHeaders(headers).forKeys(new ReceivesValue<String>() {
@Override
public void set(final String key) {
final String value = headers.getValue(key);
request.setHeader(key, value);
}
});
applySettings(request, IOConstants.METHOD_GET);
final IORequestGwt req = createRequest();
sendRequest(request, req, callback, url, headers, IOConstants.METHOD_GET, null);
return req;
} catch (final Throwable e) {
callback.onError(e);
if (X_Runtime.isDebug()) {
X_Log.warn("IO Error", e);
}
return cancelled;
}
}
代码示例来源:origin: net.wetheinter/xapi-gwt-io
} catch (final Throwable e) {
callback.onError(e);
if (X_Runtime.isDebug()) {
X_Log.warn("IO Error", e);
代码示例来源:origin: net.wetheinter/xapi-gwt-inject
if (X_Runtime.isDebug()) {
logger.log(Type.INFO, "Dumping javascript injector (trace level logging)");
if (logger.isLoggable(Type.TRACE))
代码示例来源:origin: net.wetheinter/xapi-core-io
@Override
public void onSuccess(final IOMessage<String> t) {
if (cancel) {
if (X_Runtime.isDebug()) {
X_Log.trace("Ignoring cancelled message", t.url(), t.body());
}
return;
}
request.pending = false;
request.statusCode = t.statusCode();
request.statusText = t.statusMessage();
if (deserializer == null) {
assert X_String.isEmpty(t.body()) : "Non-null response without a " +
"deserializer instance for "+url+"\n Response: "+t.body();
} else {
result.set(deserializer.convert(t.body()));
}
if (handler != null) {
handler.onSuccess(result.get());
}
}
代码示例来源:origin: net.wetheinter/xapi-gwt-reflect
"No array reflection support for \"+ c.getName() + \"; " +
"ensure this class is annotated with @KeepArrays."+
(X_Runtime.isDebug()?" This annotation allows you to add support for " +
"any class with the alsoKeep() method, that allows you to keep " +
"array support for types without directly annotating them (like java.lang classes).":"")+
if (X_Runtime.isDebug()) {
logger.log(Type.INFO, "Generated reflection support for "+needMagicClass.size()+" classes.");
logger.log(Type.WARN, sw.toString());
内容来源于网络,如有侵权,请联系作者删除!