本文整理汇总了Java中org.jruby.RubyInstanceConfig.DEBUG_LOAD_SERVICE属性的典型用法代码示例。如果您正苦于以下问题:Java RubyInstanceConfig.DEBUG_LOAD_SERVICE属性的具体用法?Java RubyInstanceConfig.DEBUG_LOAD_SERVICE怎么用?Java RubyInstanceConfig.DEBUG_LOAD_SERVICE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jruby.RubyInstanceConfig
的用法示例。
在下文中一共展示了RubyInstanceConfig.DEBUG_LOAD_SERVICE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: debugLogFound
protected void debugLogFound( LoadServiceResource resource ) {
if (RubyInstanceConfig.DEBUG_LOAD_SERVICE) {
String resourceUrl;
try {
resourceUrl = resource.getURL().toString();
} catch (IOException e) {
resourceUrl = e.getMessage();
}
LOG.info( "found: " + resourceUrl );
}
}
示例2: tryResourceFromLoadPath
protected LoadServiceResource tryResourceFromLoadPath( String namePlusSuffix,String loadPathEntry) throws RaiseException {
LoadServiceResource foundResource = null;
try {
if (!Ruby.isSecurityRestricted()) {
String reportedPath = loadPathEntry + "/" + namePlusSuffix;
boolean absolute = true;
// we check length == 0 for 'load', which does not use load path
if (!new File(reportedPath).isAbsolute()) {
absolute = false;
// prepend ./ if . is not already there, since we're loading based on CWD
if (reportedPath.charAt(0) != '.') {
reportedPath = "./" + reportedPath;
}
loadPathEntry = JRubyFile.create(runtime.getCurrentDirectory(), loadPathEntry).getAbsolutePath();
}
JRubyFile actualPath = JRubyFile.create(loadPathEntry, RubyFile.expandUserPath(runtime.getCurrentContext(), namePlusSuffix));
if (RubyInstanceConfig.DEBUG_LOAD_SERVICE) {
debugLogTry("resourceFromLoadPath", "'" + actualPath.toString() + "' " + actualPath.isFile() + " " + actualPath.canRead());
}
if (actualPath.canRead()) {
foundResource = new LoadServiceResource(actualPath, reportedPath, absolute);
debugLogFound(foundResource);
}
}
} catch (SecurityException secEx) {
}
return foundResource;
}
示例3: debugLogTry
protected void debugLogTry(String what, String msg) {
if (RubyInstanceConfig.DEBUG_LOAD_SERVICE) {
LOG.info( "trying " + what + ": " + msg );
}
}