當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。