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.

Author:
  Jerome Louvel

### Field Summary

### Fields inherited from class org.restlet.routing.Router

`BEST, CUSTOM, FIRST, LAST, MODE_BEST_MATCH, MODE_CUSTOM, MODE_FIRST_MATCH, MODE_LAST_MATCH, MODE_NEXT_MATCH, MODE_RANDOM_MATCH, NEXT, RANDOM`

### Constructor Summary

Constructors
Constructor and Description
`ClientRouter(Component component)` Constructor.

### Method Summary

Methods
`Restlet` `getNext(Request request, Response response)` Returns the next Restlet if available.
`protected void` `logRoute(Route route)` Logs the route selected.
`void` `start()` Starts the Restlet.

### Methods inherited from class org.restlet.routing.Router

`attach, attach, attach, attach, attach, attach, attachDefault, attachDefault, createFinder, createRoute, createRoute, detach, detach, doHandle, getCustom, getDefaultMatchingMode, getDefaultMatchingQuery, getDefaultMatchQuery, getDefaultRoute, getFinderClass, getMatchingMode, getMaxAttempts, getRequiredScore, getRetryDelay, getRoutes, getRoutingMode, handle, setDefaultMatchingMode, setDefaultMatchingQuery, setDefaultMatchQuery, setDefaultRoute, setFinderClass, setMaxAttempts, setRequiredScore, setRetryDelay, setRoutes, setRoutingMode, stop`

### Methods inherited from class org.restlet.Restlet

`finalize, getApplication, getAuthor, getContext, getDescription, getLogger, getName, getOwner, isStarted, isStopped, setAuthor, setContext, setDescription, setName, setOwner`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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: `Router`
Logs the route selected.

Overrides:
  `logRoute` in class `Router`
Parameters:
  `route` - The route selected.

#### getNext

    public Restlet getNext(Request request,
                  Response response)

Description copied from class: `Router`
Returns the next Restlet if available.

Overrides:
  `getNext` in class `Router`
Parameters:
  `request` - The request to handle.
  `response` - The response to update.
Returns:
  The next Restlet if available or null.

#### start

    public void start()
               throws java.lang.Exception

Starts the Restlet.

Overrides:
  `start` in class `Router`
Throws:
  `java.lang.Exception`