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

x33g5p2x  于2022-01-28 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(200)

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

Router.getContext介绍

暂无

代码示例

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

/**
 * 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;
}

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

/**
 * Called by OSGi DS to un-inject the directory provider service
 * 
 * @param directoryProvider
 *            the directory provider
 */
public void unbindDirectoryProvider(DirectoryProvider directoryProvider) {
  if (directoryProviders.remove(directoryProvider)) {
    if (router != null)
      router.detach(directoryProvider.getInboundRoot(router
          .getContext()));
  }
}

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

/**
   * Called by OSGi DS to un-inject the resource provider service
   * 
   * @param resourceProvider
   *            the resource provider
   */
  public void unbindResourceProvider(ResourceProvider resourceProvider) {
    if (resourceProviders.remove(resourceProvider)) {
      if (router != null)
        router.detach(resourceProvider.getInboundRoot(router
            .getContext()));
    }
  }
}

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

/**
 * Called by OSGi DS to un-inject the default router provider service
 * 
 * @param routerProvider
 *            the default router provider
 */
public void unbindDefaultRouterProvider(RouterProvider routerProvider) {
  if (defaultRestletProvider == routerProvider) {
    defaultRestletProvider = routerProvider;
    if (router != null)
      router.detach(routerProvider.getInboundRoot(router.getContext()));
  }
}

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

/**
 * Called by OSGi DS to inject the default resource provider service
 * 
 * @param resourceProvider
 *            the default resource provider
 */
public void bindDefaultResourceProvider(ResourceProvider resourceProvider) {
  defaultRestletProvider = resourceProvider;
  if (router != null)
    router.attachDefault(resourceProvider.getInboundRoot(router
        .getContext()));
}

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

/**
 * Called by OSGi DS to inject the default router provider service
 * 
 * @param routerProvider
 *            the default router provider
 */
public void bindDefaultRouterProvider(RouterProvider routerProvider) {
  defaultRestletProvider = routerProvider;
  if (router != null)
    router.attachDefault(routerProvider.getInboundRoot(router
        .getContext()));
}

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

/**
 * Attaches a temporary redirection to this router based on a given URI
 * pattern. The client is expected to reuse the same method for the new
 * request.
 * 
 * @param pathTemplate
 *            The URI path template that must match the relative part of the
 *            resource URI.
 * @param targetUri
 *            The target URI.
 * @return The created route.
 */
public TemplateRoute redirectTemporary(String pathTemplate, String targetUri) {
  return attach(pathTemplate, new Redirector(getContext(), targetUri,
      Redirector.MODE_CLIENT_TEMPORARY));
}

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

/**
 * Called by OSGi DS to un-inject the default resource provider service
 * 
 * @param resourceProvider
 *            the default resource provider
 */
public void unbindDefaultResourceProvider(ResourceProvider resourceProvider) {
  if (defaultRestletProvider == resourceProvider) {
    defaultRestletProvider = null;
    if (router != null)
      router.detach(resourceProvider.getInboundRoot(router
          .getContext()));
  }
}

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

/**
 * Attaches a permanent redirection to this router based on a given URI
 * pattern. The client is expected to reuse the same method for the new
 * request.
 * 
 * @param pathTemplate
 *            The URI path template that must match the relative part of the
 *            resource URI.
 * @param targetUri
 *            The target URI.
 * @return The created route.
 */
public TemplateRoute redirectPermanent(String pathTemplate, String targetUri) {
  return attach(pathTemplate, new Redirector(getContext(), targetUri,
      Redirector.MODE_CLIENT_PERMANENT));
}

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

/**
 * Attaches a redirection to this router based on a given URI pattern. It
 * redirects the client to a different URI that SHOULD be retrieved using a
 * GET method on that resource. This method exists primarily to allow the
 * output of a POST-activated script to redirect the user agent to a
 * selected resource. The new URI is not a substitute reference for the
 * originally requested resource.
 * 
 * @param pathTemplate
 *            The URI path template that must match the relative part of the
 *            resource URI.
 * @param targetUri
 *            The target URI.
 * @return The created route.
 */
public TemplateRoute redirectSeeOther(String pathTemplate, String targetUri) {
  return attach(pathTemplate, new Redirector(getContext(), targetUri,
      Redirector.MODE_CLIENT_SEE_OTHER));
}

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

private void attachDirectory(DirectoryProvider directoryProvider) {
  router.attach(directoryProvider.getPath(),
      directoryProvider.getInboundRoot(router.getContext()));
}

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

private void attachResource(ResourceProvider resourceProvider) {
  for (String path : resourceProvider.getPaths()) {
    TemplateRoute templateRoute = router.attach(path,
        resourceProvider.getInboundRoot(router.getContext()));
    templateRoute.setMatchingMode(resourceProvider.getMatchingMode());
  }
}

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

router.getContext().getParameters().add(p);

代码示例来源:origin: locationtech/geowave

(ServletContext) router.getContext().getAttributes().get(
  "org.restlet.ext.servlet.ServletContext");

相关文章