org.restlet.resource.Directory.getContext()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(157)

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

Directory.getContext介绍

暂无

代码示例

代码示例来源:origin: com.whizzosoftware.hobson.hub/hobson-hub-setup

public Context getContext() {
    // Get the context from the parent
    Context context = super.getContext();

    // Wrapper the context's client dispatcher in an object that will force it to use the OSGi bundle classloader
    // rather than the classloader that created the dispatcher. Also, the same Context object may run through
    // this many times so we have to make sure we don't wrapper multiple times -- otherwise evil hilarity will ensue
    // (i.e stack overflows)
    if (!(context.getClientDispatcher() instanceof CLAPCustomClassLoaderDispatcher)) {
      context.setClientDispatcher(new CLAPCustomClassLoaderDispatcher(context.getClientDispatcher(), bundleClassloader));
    }

    return context;
  }
}

代码示例来源:origin: org.restlet.osgi/org.restlet

public void doInit() throws ResourceException {
  this.directory = (Directory) getRequestAttributes().get("org.restlet.directory");
  this.directoryClientDispatcher = getDirectory().getContext() != null ?
      getDirectory().getContext().getClientDispatcher() :
      null;
  if (getClientDispatcher() == null) {

相关文章