org.jruby.Ruby.getProfile()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(104)

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

Ruby.getProfile介绍

[英]Get the list of method holders for methods being profiled.
[中]获取要分析的方法的方法持有者列表。

代码示例

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
    if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
    if (library == null) {
      library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
      if (library == null) {
        throw runtime.newLoadError("no such file to load -- " + file, file);
      }
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad(file, startTime);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
    if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
    if (library == null) {
      library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
      if (library == null) {
        throw runtime.newLoadError("no such file to load -- " + file, file);
      }
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad(file, startTime);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

if (!runtime.getProfile().allowRequire(requireName)) {
  throw runtime.newLoadError("no such file to load -- " + requireName, requireName);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

if (!runtime.getProfile().allowRequire(requireName)) {
  throw runtime.newLoadError("no such file to load -- " + requireName, requireName);

代码示例来源:origin: org.jruby/jruby-core

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  int currentLine = runtime.getCurrentLine();
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findLibraryBySearchState(state);
    // load() will do a last chance look in current working directory for the file (see load.c:rb_f_load()).
    if (library == null) {
      FileResource fileResource = JRubyFile.createResourceAsFile(runtime, file);
      if (!fileResource.exists()) throw runtime.newLoadError("no such file to load -- " + file, file);
      library = LibrarySearcher.ResourceLibrary.create(file, file, fileResource);
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      debugLoadException(runtime, e);
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    runtime.setCurrentLine(currentLine);
    loadTimer.endLoad(file, startTime);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  int currentLine = runtime.getCurrentLine();
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findLibraryBySearchState(state);
    // load() will do a last chance look in current working directory for the file (see load.c:rb_f_load()).
    if (library == null) {
      FileResource fileResource = JRubyFile.createResourceAsFile(runtime, file);
      if (!fileResource.exists()) throw runtime.newLoadError("no such file to load -- " + file, file);
      library = LibrarySearcher.ResourceLibrary.create(file, file, fileResource);
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      debugLoadException(runtime, e);
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    runtime.setCurrentLine(currentLine);
    loadTimer.endLoad(file, startTime);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

if (!runtime.getProfile().allowRequire(file)) {
  throw runtime.newLoadError("no such file to load -- " + file, file);

代码示例来源:origin: org.jruby/jruby-core

if (!runtime.getProfile().allowRequire(file)) {
  throw runtime.newLoadError("no such file to load -- " + file, file);

相关文章

微信公众号

最新文章

更多

Ruby类方法