public class SpringRouter extends Router
<bean class="org.restlet.ext.spring.SpringRouter">
<constructor-arg ref="application" />
<property name="attachments">
<map>
<entry key="/users/{user}" value="org.restlet.example.tutorial.UserResource" />
<entry key="/users/{user}/orders" value="org.restlet.example.tutorial.OrdersResource" />
<entry key="/users/{user}/orders/{order}" value="org.restlet.example.tutorial.OrderResource" />
</map>
</property>
</bean>
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.MODE_BEST_MATCH, MODE_CUSTOM, MODE_FIRST_MATCH, MODE_LAST_MATCH, MODE_NEXT_MATCH, MODE_RANDOM_MATCH| Constructor and Description |
|---|
SpringRouter()
Constructor.
|
SpringRouter(Context context)
Constructor with a parent context.
|
SpringRouter(Restlet parent)
Constructor with a parent Restlet.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
setAttachment(Router router,
java.lang.String path,
java.lang.Object route)
Attach a single route.
|
void |
setAttachments(java.util.Map<java.lang.String,java.lang.Object> routes)
Sets the map of routes to attach.
|
static void |
setAttachments(Router router,
java.util.Map<java.lang.String,java.lang.Object> routes)
Sets the map of routes to attach.
|
void |
setDefaultAttachment(java.lang.Object route)
Sets the default route to attach.
|
attach, attach, attach, attach, attach, attach, attachDefault, attachDefault, createRoute, 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, stopcreateFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwnerpublic SpringRouter()
public SpringRouter(Context context)
context - The parent context.public SpringRouter(Restlet parent)
parent - The parent Restlet.public static void setAttachment(Router router, java.lang.String path, java.lang.Object route)
router - The router to attach to.path - The attachment URI path.route - The route object to attach.public static void setAttachments(Router router, java.util.Map<java.lang.String,java.lang.Object> routes)
router - The router to attach to.routes - The map of routes to attachpublic void setAttachments(java.util.Map<java.lang.String,java.lang.Object> routes)
ServerResource
subclasses (as Class instances or as qualified class names).routes - The map of routes to attach.public void setDefaultAttachment(java.lang.Object route)
ServerResource subclasses (as Class instances
or as qualified class names).route - The default route to attach.Copyright © 2005-2024 Restlet.