org.restlet.ext.wadl
Class WadlComponent

java.lang.Object
  extended by org.restlet.Restlet
      extended by org.restlet.Component
          extended by org.restlet.ext.wadl.WadlComponent
All Implemented Interfaces:
Uniform

public class WadlComponent
extends Component

Component that can configure itself given a WADL document. First, it creates the server connectors and the virtual hosts if needed, trying to reuse existing ones if available. Then it creates a WadlApplication using this WadlApplication.WadlApplication(Representation) constructor.

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

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(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(String wadlUri)
          Attaches an application created from a WADL description document available at a given URI.
static void main(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, getRealm, getRealms, getServers, getServices, getStatusService, handle, setClients, setContext, setDefaultHost, setHosts, setInternalRouter, setLogService, setRealms, setServers, setStatusService, start, startClients, startHelper, startRealms, startRouters, startServers, startServices, stop, stopClients, stopHelper, stopRealms, stopRouters, stopServers, stopServices, updateHosts
 
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setDescription, setFinderClass, setName, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WadlComponent

public WadlComponent()
Default constructor.


WadlComponent

public WadlComponent(Reference wadlRef)
Constructor loading a WADL description document at a given URI.

The necessary client connectors are automatically created.

Parameters:
wadlRef - The URI reference to the WADL description document.

WadlComponent

public WadlComponent(Representation wadl)
Constructor based on a given WADL description document.

Parameters:
wadl - The WADL description document.

WadlComponent

public WadlComponent(String wadlUri)
Constructor loading a WADL description document at a given URI.

The necessary client connectors are automatically created.

Parameters:
wadlUri - The URI to the WADL description document.
Method Detail

main

public static void main(String[] args)
                 throws Exception
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.

Parameters:
args - List of local WADL document URIs.
Throws:
Exception

attach

public WadlApplication attach(Reference wadlRef)
Attaches an application created from a WADL description document available at a given URI reference.

Parameters:
wadlRef - The URI reference to the WADL description document.
Returns:
The created WADL application.

attach

public WadlApplication attach(Representation wadl)
Attaches an application created from a WADL description document to the component.

Parameters:
wadl - The WADL description document.
Returns:
The created WADL application.

attach

public WadlApplication attach(String wadlUri)
Attaches an application created from a WADL description document available at a given URI.

Parameters:
wadlUri - The URI to the WADL description document.
Returns:
The created WADL application.


Copyright © 2005-2013 Restlet.