|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Uniform
org.restlet.Restlet
org.restlet.Component
org.restlet.ext.wadl.WadlComponent
public class WadlComponent
Component that can automatically configure itself given a list of WADL
documents. First, it creates the server connectors and the virtual hosts if
needed, trying to reuse existing ones if available.
Then it creates a Restlet Application with a router as root. For each
resource found in the WADL document, it tries to attach a Restlet Resource
class to the router using the WADL path. It looks up the qualified name of
the Resource class using the WADL "id" attribute of the "resource" elements.
This is the only Restlet specific constraint on the WADL document.
Finally, it attaches the Restlet Application to the virtual host using the
"base" attribute of the WADL "resources" element.
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.
Constructor Summary | |
---|---|
WadlComponent()
Default constructor. |
|
WadlComponent(Reference wadlRef)
Constructor loading a WADL description document at a given URI. The necessary client connectors are automatically created. |
|
WadlComponent(Representation wadl)
Constructor based on a given WADL description document. |
|
WadlComponent(java.lang.String wadlUri)
Constructor loading a WADL description document at a given URI. The necessary client connectors are automatically created. |
Method Summary | |
---|---|
WadlApplication |
attach(Reference wadlRef)
Attaches an application created from a WADL description document available at a given URI reference. |
WadlApplication |
attach(Representation wadl)
Attaches an application created from a WADL description document to the component. |
WadlApplication |
attach(java.lang.String wadlUri)
Attaches an application created from a WADL description document available at a given URI. |
static void |
main(java.lang.String[] args)
Main method capable of configuring and starting a whole Restlet Component based on a list of local WADL documents URIs, for example "file:///C:/YahooSearch.wadl". The necessary client connectors are automatically created. |
Methods inherited from class org.restlet.Component |
---|
getClients, getDefaultHost, getHosts, getInternalRouter, getLogService, getServers, getStatusService, handle, setClients, setDefaultHost, setHosts, setInternalRouter, setLogService, setServers, setStatusService, start, startClients, startHelper, startServers, startServices, stop, stopClients, stopHelper, stopServers, stopServices, updateHosts |
Methods inherited from class org.restlet.Restlet |
---|
getApplication, getContext, getLogger, init, isStarted, isStopped, setContext |
Methods inherited from class org.restlet.Uniform |
---|
delete, delete, get, get, handle, head, head, options, options, post, post, put, put |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WadlComponent()
public WadlComponent(Reference wadlRef)
wadlRef
- The URI reference to the WADL description document.public WadlComponent(Representation wadl)
wadl
- The WADL description document.public WadlComponent(java.lang.String wadlUri)
wadlUri
- The URI to the WADL description document.Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- List of local WADL document URIs.
java.lang.Exception
public WadlApplication attach(Reference wadlRef)
wadlRef
- The URI reference to the WADL description document.
public WadlApplication attach(Representation wadl)
wadl
- The WADL description document.
public WadlApplication attach(java.lang.String wadlUri)
wadlUri
- The URI to the WADL description document.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |