Package org.restlet.ext.spring
Class SpringHost
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Router
-
- org.restlet.routing.VirtualHost
-
- org.restlet.ext.spring.SpringHost
-
- All Implemented Interfaces:
org.restlet.Uniform
public class SpringHost extends org.restlet.routing.VirtualHost
Virtual host that is easily configurable with Spring. Here is a usage example:<bean id="virtualHost" class="org.restlet.ext.spring.SpringHost"> <constructor-arg ref="component" /> <property name="hostDomain" value="mydomain.com|www.mydomain.com" /> <property name="attachments"> <map> <entry key="/"> <ref bean="application" /> </entry> </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.- Author:
- Jerome Louvel
- See Also:
- Spring home page
-
-
Constructor Summary
Constructors Constructor Description SpringHost(org.restlet.Component component)
Constructor.SpringHost(org.restlet.Context context)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setAttachment(java.lang.String path, java.lang.Object route)
Sets a route to attach.void
setAttachments(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.-
Methods inherited from class org.restlet.routing.VirtualHost
attach, attach, attachDefault, checkContext, createFinder, createRoute, getCurrent, getHostDomain, getHostPort, getHostScheme, getIpAddress, getLocalHostAddress, getLocalHostName, getResourceDomain, getResourcePort, getResourceScheme, getServerAddress, getServerPort, setContext, setCurrent, setHostDomain, setHostPort, setHostScheme, setResourceDomain, setResourcePort, setResourceScheme, setServerAddress, setServerPort
-
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
-
-
-
-
Method Detail
-
setAttachment
public void setAttachment(java.lang.String path, java.lang.Object route)
Sets a route to attach. The keys is the URI template and the value can be either Restlet instance,ServerResource
subclasse (asClass
instances or as qualified class names).- Parameters:
path
- The attachment URI path.route
- The route object to attach.
-
setAttachments
public void setAttachments(java.util.Map<java.lang.String,java.lang.Object> routes)
Sets the map of routes to attach. The map keys are the URI templates and the values can be either Restlet instances,ServerResource
subclasses (asClass
instances or as qualified class names).- Parameters:
routes
- The map of routes to attach.
-
setDefaultAttachment
public void setDefaultAttachment(java.lang.Object route)
Sets the default route to attach. The route can be either Restlet instances,ServerResource
subclasses (asClass
instances or as qualified class names).- Parameters:
route
- The default route to attach.
-
-