MODE_BEST_MATCH, MODE_CUSTOM, MODE_FIRST_MATCH, MODE_LAST_MATCH, MODE_NEXT_MATCH, MODE_RANDOM_MATCH
Constructor and Description |
---|
InternalRouter(Context context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TemplateRoute |
attach(Restlet target)
Attaches a target Restlet to this router with an empty URI pattern.
|
TemplateRoute |
attach(java.lang.String uriPattern,
Restlet target)
Attaches a target Restlet to this router based on a given URI pattern.
|
TemplateRoute |
attachDefault(Restlet defaultTarget)
Attaches a Restlet to this router as the default target to invoke when no
route matches.
|
Finder |
createFinder(java.lang.Class<? extends ServerResource> targetClass)
Creates a new finder instance based on the "targetClass" property.
|
protected TemplateRoute |
createRoute(java.lang.String uriPattern,
Restlet target,
int matchingMode)
Creates a new route for the given URI pattern, target and matching mode.
|
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
finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public InternalRouter(Context context)
context
- protected TemplateRoute createRoute(java.lang.String uriPattern, Restlet target, int matchingMode)
org.restlet.routing.Router
Router.getDefaultMatchingQuery()
.createRoute
in class Router
uriPattern
- The URI pattern that must match the relative part of the
resource URI.target
- The target Restlet to attach.matchingMode
- The matching mode.public TemplateRoute attach(Restlet target)
org.restlet.routing.Router
Router.getMatchingMode(Restlet)
will be added routing to the target
when any call is received.public TemplateRoute attach(java.lang.String uriPattern, Restlet target)
org.restlet.routing.Router
Router.getMatchingMode(Restlet)
will be added routing to the target
when calls with a URI matching the pattern will be received.public TemplateRoute attachDefault(Restlet defaultTarget)
org.restlet.routing.Router
attachDefault
in class Router
defaultTarget
- The Restlet to use as the default target.public Finder createFinder(java.lang.Class<? extends ServerResource> targetClass)
org.restlet.Restlet
Restlet.createFinder(Class)
method is
invoked if available, otherwise the
Finder.createFinder(Class, Class, Context, Logger)
method is called with the Finder
class as
parameter.createFinder
in class Restlet
targetClass
- The target ServerResource
class
to find.Finder.createFinder(Class, Class, Context,
Logger)
Copyright © 2005-2020 Restlet.