当前位置: 首页>>代码示例>>Java>>正文


Java Restlet.getContext方法代码示例

本文整理汇总了Java中org.restlet.Restlet.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java Restlet.getContext方法的具体用法?Java Restlet.getContext怎么用?Java Restlet.getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.restlet.Restlet的用法示例。


在下文中一共展示了Restlet.getContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setNext

import org.restlet.Restlet; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:24,代码来源:ClientResource.java

示例2: attach

import org.restlet.Restlet; //导入方法依赖的package包/类
@Override
public TemplateRoute attach(Restlet target) {
    if (target.getContext() == null) {
        target.setContext(getContext().createChildContext());
    }

    return super.attach(target);
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:9,代码来源:InternalRouter.java

示例3: attachDefault

import org.restlet.Restlet; //导入方法依赖的package包/类
@Override
public TemplateRoute attachDefault(Restlet defaultTarget) {
    if (defaultTarget.getContext() == null) {
        defaultTarget.setContext(getContext().createChildContext());
    }

    return super.attachDefault(defaultTarget);
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:9,代码来源:InternalRouter.java

示例4: setNext

import org.restlet.Restlet; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:17,代码来源:Filter.java

示例5: checkContext

import org.restlet.Restlet; //导入方法依赖的package包/类
/**
 * 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());
    }
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:12,代码来源:VirtualHost.java

示例6: Route

import org.restlet.Restlet; //导入方法依赖的package包/类
/**
 * Constructor.
 * 
 * @param router
 *            The parent router.
 * @param next
 *            The next Restlet.
 */
public Route(Router router, Restlet next) {
    super((router != null) ? router.getContext() : (next != null) ? next
            .getContext() : null, next);
    this.router = router;
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:14,代码来源:Route.java


注:本文中的org.restlet.Restlet.getContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。