org.restlet.gwt
Class Restlet

java.lang.Object
  extended by org.restlet.gwt.Uniform
      extended by org.restlet.gwt.Restlet
Direct Known Subclasses:
Connector

public class Restlet
extends Uniform

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

Constructor Summary
Restlet()
          Constructor.
Restlet(Context context)
          Constructor.
 
Method Summary
 Context getContext()
          Returns the context.
 void handle(Request request, Response response, Callback callback)
          Handles a call.
 boolean isStarted()
          Indicates if the Restlet is started.
 boolean isStopped()
          Indicates if the Restlet is stopped.
 void setContext(Context context)
          Sets the context.
 void start()
          Starts the Restlet.
 void stop()
          Stops the Restlet.
 
Methods inherited from class org.restlet.gwt.Uniform
delete, delete, get, get, handle, head, head, options, options, post, post, post, put, put, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Restlet

public Restlet()
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)
Constructor.

Parameters:
context - The context.
Method Detail

getContext

public Context getContext()
Returns the context.

Returns:
The context.

handle

public void handle(Request request,
                   Response response,
                   Callback callback)
Handles a call. Subclasses overriding this method should make sure that they call super.handle(request, response) before adding their own logic.

Specified by:
handle in class Uniform
Parameters:
request - The request to handle.
response - The response to update.
callback - The callback invoked upon request completion.

isStarted

public boolean isStarted()
Indicates if the Restlet is started.

Returns:
True if the Restlet is started.

isStopped

public boolean isStopped()
Indicates if the Restlet is stopped.

Returns:
True if the Restlet is stopped.

setContext

public void setContext(Context context)
Sets the context.

Parameters:
context - The context.

start

public void start()
           throws java.lang.Exception
Starts the Restlet.

Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Stops the Restlet.

Throws:
java.lang.Exception


Copyright © 2005-2008 Noelios Technologies.