Package org.restlet.engine.component
Class ClientRouter
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Router
-
- org.restlet.engine.component.ClientRouter
-
- All Implemented Interfaces:
Uniform
public class ClientRouter extends Router
Router that collects calls from all applications and dispatches them to the appropriate client connectors. Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.
-
-
Field Summary
Fields Modifier and Type Field Description private ComponentcomponentThe parent component.-
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 ClientRouter(Component component)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ComponentgetComponent()Returns the parent component.RestletgetNext(Request request, Response response)Returns the next Restlet if available.protected voidlogRoute(Route route)Logs the route selected.voidstart()Starts the Restlet.-
Methods inherited from class org.restlet.routing.Router
attach, attach, attach, attach, attach, attach, attachDefault, attachDefault, createRoute, createRoute, detach, detach, doHandle, getCustom, getDefaultMatchingMode, getDefaultMatchingQuery, getDefaultRoute, getMatchingMode, getMaxAttempts, getRequiredScore, getRetryDelay, getRoutes, getRoutingMode, handle, redirectPermanent, redirectSeeOther, redirectTemporary, setDefaultMatchingMode, setDefaultMatchingQuery, setDefaultRoute, setMaxAttempts, setRequiredScore, setRetryDelay, setRoutes, setRoutingMode, stop
-
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
-
-
-
-
Field Detail
-
component
private volatile Component component
The parent component.
-
-
Constructor Detail
-
ClientRouter
public ClientRouter(Component component)
Constructor.- Parameters:
component- The parent component.
-
-
Method Detail
-
logRoute
protected void logRoute(Route route)
Description copied from class:RouterLogs the route selected.
-
getNext
public Restlet getNext(Request request, Response response)
Description copied from class:RouterReturns the next Restlet if available.
-
getComponent
private Component getComponent()
Returns the parent component.- Returns:
- The parent component.
-
-