本文整理了Java中org.restlet.routing.Router.getDefaultRoute
方法的一些代码示例,展示了Router.getDefaultRoute
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Router.getDefaultRoute
方法的具体详情如下:
包路径:org.restlet.routing.Router
类名称:Router
方法名:getDefaultRoute
[英]Returns the default route to test if no other one was available after retrying the maximum number of attempts.
[中]如果在重试最大尝试次数后没有其他可用路由,则返回要测试的默认路由。
代码示例来源:origin: org.restlet.jee/org.restlet.ext.apispark
/**
* Completes the list of ResourceInfo instances for the given Router
* instance.
*
*
* @param router
* The router to document.
* @param introspectionHelper
*/
private static void collectForRouter(CollectInfo collectInfo,
String basePath, Router router, ChallengeScheme scheme,
List<? extends IntrospectionHelper> introspectionHelper) {
for (Route route : router.getRoutes()) {
collectForRoute(collectInfo, basePath, route, scheme,
introspectionHelper);
}
if (router.getDefaultRoute() != null) {
collectForRoute(collectInfo, basePath, router.getDefaultRoute(),
scheme, introspectionHelper);
}
}
}
代码示例来源:origin: org.restlet.jse/org.restlet.ext.platform
/**
* Completes the list of ResourceInfo instances for the given Router
* instance.
*
*
* @param router
* The router to document.
* @param introspectionHelper
*/
private static void collectForRouter(CollectInfo collectInfo,
String basePath, Router router, ChallengeScheme scheme,
List<? extends IntrospectionHelper> introspectionHelper) {
for (Route route : router.getRoutes()) {
collectForRoute(collectInfo, basePath, route, scheme,
introspectionHelper);
}
if (router.getDefaultRoute() != null) {
collectForRoute(collectInfo, basePath, router.getDefaultRoute(),
scheme, introspectionHelper);
}
}
}
代码示例来源:origin: org.restlet.gae/org.restlet.ext.platform
/**
* Completes the list of ResourceInfo instances for the given Router
* instance.
*
*
* @param router
* The router to document.
* @param introspectionHelper
*/
private static void collectForRouter(CollectInfo collectInfo,
String basePath, Router router, ChallengeScheme scheme,
List<? extends IntrospectionHelper> introspectionHelper) {
for (Route route : router.getRoutes()) {
collectForRoute(collectInfo, basePath, route, scheme,
introspectionHelper);
}
if (router.getDefaultRoute() != null) {
collectForRoute(collectInfo, basePath, router.getDefaultRoute(),
scheme, introspectionHelper);
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Logs the route selected.
*
* @param route
* The route selected.
*/
protected void logRoute(Route route) {
if (getLogger().isLoggable(Level.FINE)) {
if (getDefaultRoute() == route) {
getLogger().fine("The default route was selected");
} else {
getLogger().fine("Selected route: " + route);
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Detaches the target from this router. All routes routing to this target
* Restlet are removed from the list of routes and the default route is set
* to null.
*
* @param target
* The target Restlet to detach.
*/
public void detach(Restlet target) {
getRoutes().removeAll(target);
if ((getDefaultRoute() != null)
&& (getDefaultRoute().getNext() == target)) {
setDefaultRoute(null);
}
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.platform
/**
* Completes the list of ResourceInfo instances for the given Router
* instance.
*
*
* @param router
* The router to document.
* @param introspectionHelper
*/
private static void collectForRouter(CollectInfo collectInfo,
String basePath, Router router, ChallengeScheme scheme,
List<? extends IntrospectionHelper> introspectionHelper) {
for (Route route : router.getRoutes()) {
collectForRoute(collectInfo, basePath, route, scheme,
introspectionHelper);
}
if (router.getDefaultRoute() != null) {
collectForRoute(collectInfo, basePath, router.getDefaultRoute(),
scheme, introspectionHelper);
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.platform
/**
* Completes the list of ResourceInfo instances for the given Router
* instance.
*
*
* @param router
* The router to document.
* @param introspectionHelper
*/
private static void collectForRouter(CollectInfo collectInfo,
String basePath, Router router, ChallengeScheme scheme,
List<? extends IntrospectionHelper> introspectionHelper) {
for (Route route : router.getRoutes()) {
collectForRoute(collectInfo, basePath, route, scheme,
introspectionHelper);
}
if (router.getDefaultRoute() != null) {
collectForRoute(collectInfo, basePath, router.getDefaultRoute(),
scheme, introspectionHelper);
}
}
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl
if (router.getDefaultRoute() != null) {
ResourceInfo resourceInfo = getResourceInfo(applicationInfo,
router.getDefaultRoute(), "/", request, response);
if (resourceInfo != null) {
result.add(resourceInfo);
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Stops the filter and the attached routes.
*/
@Override
public synchronized void stop() throws Exception {
if (isStarted()) {
// Must be invoked as a first step
super.stop();
if (getDefaultRoute() != null) {
getDefaultRoute().stop();
}
for (Route route : getRoutes()) {
route.stop();
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Starts the filter and the attached routes.
*/
@Override
public synchronized void start() throws Exception {
if (isStopped()) {
for (Route route : getRoutes()) {
route.start();
}
if (getDefaultRoute() != null) {
getDefaultRoute().start();
}
// Must be invoked as a last step
super.start();
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Detaches the target from this router. All routes routing to this target
* Restlet are removed from the list of routes and the default route is set
* to null.
*
* @param targetClass
* The target class to detach.
*/
public void detach(Class<?> targetClass) {
for (int i = getRoutes().size() - 1; i >= 0; i--) {
Restlet target = getRoutes().get(i).getNext();
if (target != null
&& Finder.class.isAssignableFrom(target.getClass())) {
Finder finder = (Finder) target;
if (finder.getTargetClass().equals(targetClass)) {
getRoutes().remove(i);
}
}
}
if (getDefaultRoute() != null) {
Restlet target = getDefaultRoute().getNext();
if (target != null
&& Finder.class.isAssignableFrom(target.getClass())) {
Finder finder = (Finder) target;
if (finder.getTargetClass().equals(targetClass)) {
setDefaultRoute(null);
}
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
if ((getDefaultRoute() != null)
&& (getDefaultRoute().score(request, response) >= getRequiredScore())) {
result = getDefaultRoute();
} else {
内容来源于网络,如有侵权,请联系作者删除!