org.restlet.util
Class WrapperRestlet

java.lang.Object
  extended by org.restlet.Restlet
      extended by org.restlet.util.WrapperRestlet
All Implemented Interfaces:
Uniform

public class WrapperRestlet
extends Restlet

Restlet wrapper. Useful for application developer who need to wrap a Restlet instance.

Author:
Thierry Boileau
See Also:
The decorator (aka wrapper) pattern

Constructor Summary
WrapperRestlet(Restlet wrappedRestlet)
          Constructor.
 
Method Summary
 Application getApplication()
          Returns the parent application if it exists, or null.
 String getAuthor()
          Returns the author(s).
 Context getContext()
          Returns the context.
 String getDescription()
          Returns the description.
 Logger getLogger()
          Returns the context's logger.
 String getName()
          Returns the display name.
 String getOwner()
          Returns the owner(s).
 void handle(Request request, Response response)
          Handles a call.
 boolean isStarted()
          Indicates if the Restlet is started.
 boolean isStopped()
          Indicates if the Restlet is stopped.
 void setAuthor(String author)
          Sets the author(s).
 void setContext(Context context)
          Sets the context.
 void setDescription(String description)
          Sets the description.
 void setName(String name)
          Sets the display name.
 void setOwner(String owner)
          Sets the owner(s).
 void start()
          Starts the Restlet.
 void stop()
          Stops the Restlet.
 
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getFinderClass, handle, handle, handle, setFinderClass
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperRestlet

public WrapperRestlet(Restlet wrappedRestlet)
Constructor.

Parameters:
wrappedRestlet - The wrapped Restlet instance.
Method Detail

getApplication

public Application getApplication()
Description copied from class: Restlet
Returns the parent application if it exists, or null.

Overrides:
getApplication in class Restlet
Returns:
The parent application if it exists, or null.

getAuthor

public String getAuthor()
Description copied from class: Restlet
Returns the author(s).

Overrides:
getAuthor in class Restlet
Returns:
The author(s).

getContext

public Context getContext()
Description copied from class: Restlet
Returns the context.

Overrides:
getContext in class Restlet
Returns:
The context.

getDescription

public String getDescription()
Description copied from class: Restlet
Returns the description.

Overrides:
getDescription in class Restlet
Returns:
The description

getLogger

public Logger getLogger()
Description copied from class: Restlet
Returns the context's logger.

Overrides:
getLogger in class Restlet
Returns:
The context's logger.

getName

public String getName()
Description copied from class: Restlet
Returns the display name.

Overrides:
getName in class Restlet
Returns:
The display name.

getOwner

public String getOwner()
Description copied from class: Restlet
Returns the owner(s).

Overrides:
getOwner in class Restlet
Returns:
The owner(s).

handle

public void handle(Request request,
                   Response response)
Description copied from class: Restlet
Handles a call. The default behavior is to initialize the Restlet by setting the current context using the Context.setCurrent(Context) method and 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.

Subclasses overriding this method should make sure that they call super.handle(request, response) before adding their own logic.

Specified by:
handle in interface Uniform
Overrides:
handle in class Restlet
Parameters:
request - The request to handle.
response - The response to update.

isStarted

public boolean isStarted()
Description copied from class: Restlet
Indicates if the Restlet is started.

Overrides:
isStarted in class Restlet
Returns:
True if the Restlet is started.

isStopped

public boolean isStopped()
Description copied from class: Restlet
Indicates if the Restlet is stopped.

Overrides:
isStopped in class Restlet
Returns:
True if the Restlet is stopped.

setAuthor

public void setAuthor(String author)
Description copied from class: Restlet
Sets the author(s).

Overrides:
setAuthor in class Restlet
Parameters:
author - The author(s).

setContext

public void setContext(Context context)
Description copied from class: Restlet
Sets the context.

Overrides:
setContext in class Restlet
Parameters:
context - The context.

setDescription

public void setDescription(String description)
Description copied from class: Restlet
Sets the description.

Overrides:
setDescription in class Restlet
Parameters:
description - The description.

setName

public void setName(String name)
Description copied from class: Restlet
Sets the display name.

Overrides:
setName in class Restlet
Parameters:
name - The display name.

setOwner

public void setOwner(String owner)
Description copied from class: Restlet
Sets the owner(s).

Overrides:
setOwner in class Restlet
Parameters:
owner - The owner(s).

start

public void start()
           throws Exception
Description copied from class: Restlet
Starts the Restlet.

Overrides:
start in class Restlet
Throws:
Exception

stop

public void stop()
          throws Exception
Description copied from class: Restlet
Stops the Restlet.

Overrides:
stop in class Restlet
Throws:
Exception


Copyright © 2005-2013 Restlet.