Package org.restlet.engine.component
Class InternalRouter
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Router
-
- org.restlet.engine.component.InternalRouter
-
-
Field Summary
-
Fields inherited from class org.restlet.routing.Router
MODE_BEST_MATCH, MODE_CUSTOM, MODE_FIRST_MATCH, MODE_LAST_MATCH, MODE_NEXT_MATCH, MODE_RANDOM_MATCH
-
-
Constructor Summary
Constructors Constructor Description InternalRouter(Context context)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateRouteattach(java.lang.String uriPattern, Restlet target)Attaches a target Restlet to this router based on a given URI pattern.TemplateRouteattach(Restlet target)Attaches a target Restlet to this router with an empty URI pattern.TemplateRouteattachDefault(Restlet defaultTarget)Attaches a Restlet to this router as the default target to invoke when no route matches.FindercreateFinder(java.lang.Class<? extends ServerResource> targetClass)Creates a new finder instance based on the "targetClass" property.protected TemplateRoutecreateRoute(java.lang.String uriPattern, Restlet target, int matchingMode)Creates a new route for the given URI pattern, target and matching mode.-
Methods inherited from class org.restlet.routing.Router
attach, attach, attach, attach, attachDefault, createRoute, detach, detach, doHandle, getCustom, getDefaultMatchingMode, getDefaultMatchingQuery, getDefaultRoute, getMatchingMode, getMaxAttempts, getNext, getRequiredScore, getRetryDelay, getRoutes, getRoutingMode, handle, logRoute, redirectPermanent, redirectSeeOther, redirectTemporary, setDefaultMatchingMode, setDefaultMatchingQuery, setDefaultRoute, setMaxAttempts, setRequiredScore, setRetryDelay, setRoutes, setRoutingMode, start, stop
-
Methods inherited from class org.restlet.Restlet
finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
-
-
-
-
Constructor Detail
-
InternalRouter
public InternalRouter(Context context)
Constructor.- Parameters:
context-
-
-
Method Detail
-
createRoute
protected TemplateRoute createRoute(java.lang.String uriPattern, Restlet target, int matchingMode)
Description copied from class:RouterCreates a new route for the given URI pattern, target and matching mode. The route will match the URI query string depending on the result ofRouter.getDefaultMatchingQuery().- Overrides:
createRoutein classRouter- Parameters:
uriPattern- The URI pattern that must match the relative part of the resource URI.target- The target Restlet to attach.matchingMode- The matching mode.- Returns:
- The created route.
-
attach
public TemplateRoute attach(Restlet target)
Description copied from class:RouterAttaches a target Restlet to this router with an empty URI pattern. A new route using the matching mode returned byRouter.getMatchingMode(Restlet)will be added routing to the target when any call is received.
-
attach
public TemplateRoute attach(java.lang.String uriPattern, Restlet target)
Description copied from class:RouterAttaches a target Restlet to this router based on a given URI pattern. A new route using the matching mode returned byRouter.getMatchingMode(Restlet)will be added routing to the target when calls with a URI matching the pattern will be received.
-
attachDefault
public TemplateRoute attachDefault(Restlet defaultTarget)
Description copied from class:RouterAttaches 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.- Overrides:
attachDefaultin classRouter- Parameters:
defaultTarget- The Restlet to use as the default target.- Returns:
- The created route.
-
createFinder
public Finder createFinder(java.lang.Class<? extends ServerResource> targetClass)
Description copied from class:RestletCreates a new finder instance based on the "targetClass" property. If none is define, theRestlet.createFinder(Class)method is invoked if available, otherwise theFinder.createFinder(Class, Class, Context, Logger)method is called with theFinderclass as parameter.- Overrides:
createFinderin classRestlet- Parameters:
targetClass- The targetServerResourceclass to find.- Returns:
- The new finder instance.
- See Also:
Finder.createFinder(Class, Class, Context, Logger)
-
-