org.restlet.Restlet.setContext()方法的使用及代码示例

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

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

Restlet.setContext介绍

[英]Sets the context.
[中]设置上下文。

代码示例

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

@Override
public void setContext(Context context) {
  wrappedRestlet.setContext(context);
}

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

@Override
public void setContext(Context context) {
  wrappedRestlet.setContext(context);
}

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

@Override
public void setContext(Context context) {
  super.setContext(context);
  getServices().setContext(context);
}

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

/**
 * Sets the outbound root Restlet.
 * 
 * @param outboundRoot
 *            The outbound root Restlet.
 */
public synchronized void setOutboundRoot(Restlet outboundRoot) {
  this.outboundRoot = outboundRoot;
  if ((outboundRoot != null) && (outboundRoot.getContext() == null)) {
    outboundRoot.setContext(getContext());
  }
}

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

/**
 * Sets the inbound root Restlet.
 * 
 * @param inboundRoot
 *            The inbound root Restlet.
 */
public synchronized void setInboundRoot(Restlet inboundRoot) {
  this.inboundRoot = inboundRoot;
  if ((inboundRoot != null) && (inboundRoot.getContext() == null)) {
    inboundRoot.setContext(getContext());
  }
}

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

/**
 * Checks the context and sets it if necessary.
 * 
 * @param target
 *            The target Restlet.
 */
protected void checkContext(Restlet target) {
  if ((target.getContext() == null) && (this.parentContext != null)) {
    target.setContext(this.parentContext.createChildContext());
  }
}

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

/**
 * Sets the next Restlet.
 * 
 * In addition, this method will set the context of the next Restlet if it
 * is null by passing a reference to its own context.
 * 
 * @param next
 *            The next Restlet.
 */
public void setNext(Restlet next) {
  if ((next != null) && (next.getContext() == null)) {
    next.setContext(getContext());
  }
  this.next = next;
}

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

/**
 * Sets the next Restlet.
 * 
 * In addition, this method will set the context of the next Restlet if it
 * is null by passing a reference to its own context.
 * 
 * @param next
 *            The next Restlet.
 */
public void setNext(Restlet next) {
  if ((next != null) && (next.getContext() == null)) {
    next.setContext(getContext());
  }
  this.next = next;
}

代码示例来源:origin: bioinformatics-ua/dicoogle

@Override
public void init() throws ServletException {
  super.init();
  this.adapter = new ServletAdapter(getServletContext());
  this.restlet.setContext(this.adapter.getContext());
  this.adapter.setNext(this.restlet);
}

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

/**
 * Sets the next handler such as a Restlet or a Filter.
 * 
 * In addition, this method will set the context of the next Restlet if it
 * is null by passing a reference to its own context.
 * 
 * @param next
 *            The next handler.
 */
public void setNext(org.restlet.Uniform next) {
  if (next instanceof Restlet) {
    Restlet nextRestlet = (Restlet) next;
    if (nextRestlet.getContext() == null) {
      nextRestlet.setContext(getContext());
    }
  }
  this.next = next;
  // If true, it must be updated after calling this method
  this.nextCreated = false;
}

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

@Override
public void setContext(Context context) {
  super.setContext(context);
  getHelper().setContext(context);
  getServices().setContext(context);
}

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

/**
 * Attaches a Restlet to this router as the default target to invoke when no
 * route matches. It actually sets a default route that scores all calls to
 * 1.0.
 * 
 * In addition to super class behavior, this method will set the context of
 * the target if it is empty by creating a protected context via the
 * {@link Context#createChildContext()} method.
 * 
 * @param defaultTarget
 *            The Restlet to use as the default target.
 * @return The created route.
 */
@Override
public Route attachDefault(Restlet defaultTarget) {
  if ((defaultTarget.getContext() == null)
      && (this.parentContext != null)) {
    defaultTarget.setContext(this.parentContext.createChildContext());
  }
  return super.attachDefault(defaultTarget);
}

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

/**
 * Attaches a target Restlet to this router with an empty URI pattern. A new
 * route will be added routing to the target when any call is received.
 * 
 * In addition to super class behavior, this method will set the context of
 * the target if it is empty by creating a protected context via the
 * {@link Context#createChildContext()} method.
 * 
 * @param target
 *            The target Restlet to attach.
 * @return The created route.
 */
@Override
public Route attach(Restlet target) {
  if ((target.getContext() == null) && (this.parentContext != null)) {
    target.setContext(this.parentContext.createChildContext());
  }
  return super.attach(target);
}

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

@Override
public Route attach(String uriPattern, Restlet target) {
  if (target.getContext() == null) {
    target
        .setContext(getContext()
            .createChildContext());
  }
  return super.attach(uriPattern, target);
}

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

@Override
public TemplateRoute attach(Restlet target) {
  if (target.getContext() == null) {
    target.setContext(getContext().createChildContext());
  }
  return super.attach(target);
}

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

@Override
public TemplateRoute attachDefault(Restlet defaultTarget) {
  if (defaultTarget.getContext() == null) {
    defaultTarget.setContext(getContext().createChildContext());
  }
  return super.attachDefault(defaultTarget);
}

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

@Override
public Route attach(Restlet target) {
  if (target.getContext() == null) {
    target
        .setContext(getContext()
            .createChildContext());
  }
  return super.attach(target);
}

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

@Override
public Route attachDefault(Restlet defaultTarget) {
  if (defaultTarget.getContext() == null) {
    defaultTarget.setContext(getContext()
        .createChildContext());
  }
  return super.attachDefault(defaultTarget);
}

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

@Override
public TemplateRoute attach(String uriPattern, Restlet target) {
  if (target.getContext() == null) {
    target.setContext(getContext().createChildContext());
  }
  return super.attach(uriPattern, target);
}

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

/**
 * Attaches a target Restlet to this router based on a given URI pattern. A
 * new route will be added routing to the target when calls with a URI
 * matching the pattern will be received.
 * 
 * In addition to super class behavior, this method will set the context of
 * the target if it is empty by creating a protected context via the
 * {@link Context#createChildContext()} method.
 * 
 * @param uriPattern
 *            The URI pattern that must match the relative part of the
 *            resource URI.
 * @param target
 *            The target Restlet to attach.
 * @return The created route.
 */
@Override
public Route attach(String uriPattern, Restlet target) {
  if ((target.getContext() == null) && (this.parentContext != null)) {
    target.setContext(this.parentContext.createChildContext());
  }
  return super.attach(uriPattern, target);
}

相关文章