| java.lang.Object org.restlet.Uniform org.restlet.Restlet
All known Subclasses: org.restlet.Component, org.restlet.Connector, org.restlet.Application, org.restlet.Finder, org.restlet.Filter, org.restlet.Redirector, org.restlet.Router,
Restlet | public class Restlet extends Uniform (Code) | | Uniform class that provides a context and life cycle support. It has many
subclasses that focus on specific ways to process calls. The context property
is typically provided by a parent Component as a way to encapsulate access to
shared features such as logging and client connectors.
author: Jerome Louvel (contact@noelios.com) |
Method Summary | |
public Context | getContext() Returns the context. | public Logger | getLogger() Returns the context's logger. | public void | handle(Request request, Response response) Handles a call. | protected synchronized void | init(Request request, Response response) Initialize the Restlet by attempting to start it, unless it was already
started. | public synchronized boolean | isStarted() Indicates if the Restlet is started. | public synchronized boolean | isStopped() Indicates if the Restlet is stopped. | public void | setContext(Context context) Sets the context. | public synchronized void | start() Starts the Restlet. | public synchronized void | stop() Stops the Restlet. |
Restlet | public Restlet()(Code) | | Constructor. Note that usage of this constructor is not recommended as
the Restlet won't have a proper context set. In general you will prefer
to use the other constructor and pass it the parent application's context
or eventually the parent component's context if you don't use
applications.
|
Restlet | public Restlet(Context context)(Code) | | Constructor.
Parameters: context - The context. |
getContext | public Context getContext()(Code) | | Returns the context.
The context. |
getLogger | public Logger getLogger()(Code) | | Returns the context's logger.
The context's logger. |
handle | public void handle(Request request, Response response)(Code) | | Handles a call.
Parameters: request - The request to handle. Parameters: response - The response to update. |
init | protected synchronized void init(Request request, Response response)(Code) | | Initialize the Restlet by attempting to start it, unless it was already
started. If an exception is thrown during the start action, then the
response status is set to
Status.SERVER_ERROR_INTERNAL .
Parameters: request - The request to handle. Parameters: response - The response to update. |
isStarted | public synchronized boolean isStarted()(Code) | | Indicates if the Restlet is started.
True if the Restlet is started. |
isStopped | public synchronized boolean isStopped()(Code) | | Indicates if the Restlet is stopped.
True if the Restlet is stopped. |
setContext | public void setContext(Context context)(Code) | | Sets the context.
Parameters: context - The context. |
start | public synchronized void start() throws Exception(Code) | | Starts the Restlet.
|
stop | public synchronized void stop() throws Exception(Code) | | Stops the Restlet.
|
|
|