|
||||||||||
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.Application
public class Application
Restlet that can be attached to one or more VirtualHosts. Applications are
guaranteed to receive calls with their base reference set relatively to the
VirtualHost that served them. This class is both a descriptor able to create
the root Restlet and the actual Restlet that can be attached to one or more
VirtualHost instances.
Applications also have many useful Services associated. They are available as
properties that can be eventually overriden:
Constructor Summary | |
---|---|
Application()
Constructor. |
|
Application(Context context)
Constructor. |
Method Summary | |
---|---|
Restlet |
createRoot()
Creates a root Restlet that will receive all incoming calls. |
java.lang.String |
getAuthor()
Returns the author(s). |
ConnectorService |
getConnectorService()
Returns the connector service. |
ConverterService |
getConverterService()
Deprecated. Since 1.1 with no replacement as it doesn't fit well with content negotiation. Most users prefer to handle those conversion in Resource subclasses. |
static Application |
getCurrent()
This variable is stored internally as a thread local variable and updated each time a call enters an application. |
DecoderService |
getDecoderService()
Returns the decoder service. |
java.lang.String |
getDescription()
Returns the description. |
MetadataService |
getMetadataService()
Returns the metadata service. |
java.lang.String |
getName()
Returns the display name. |
java.lang.String |
getOwner()
Returns the owner(s). |
RangeService |
getRangeService()
Returns the range service. |
Restlet |
getRoot()
Returns the root Restlet. |
StatusService |
getStatusService()
Returns the status service. |
TaskService |
getTaskService()
Returns a task service to run concurrent tasks. |
TunnelService |
getTunnelService()
Returns the tunnel service. |
void |
handle(Request request,
Response response)
Handles a call. |
void |
setAuthor(java.lang.String author)
Sets the author(s). |
void |
setConnectorService(ConnectorService connectorService)
Sets the connector service. |
void |
setConverterService(ConverterService converterService)
Deprecated. Since 1.1 with no replacement as it doesn't fit well with content negotiation. Most users prefer to handle those conversion in Resource subclasses. |
static void |
setCurrent(Application application)
Sets the context to associated with the current thread. |
void |
setDecoderService(DecoderService decoderService)
Sets the decoder service. |
void |
setDescription(java.lang.String description)
Sets the description. |
void |
setMetadataService(MetadataService metadataService)
Sets the metadata service. |
void |
setName(java.lang.String name)
Sets the display name. |
void |
setOwner(java.lang.String owner)
Sets the owner(s). |
void |
setRangeService(RangeService rangeService)
Sets the range service. |
void |
setRoot(Restlet root)
Sets the root Restlet. |
void |
setStatusService(StatusService statusService)
Sets the status service. |
void |
setTaskService(TaskService taskService)
Sets the task service. |
void |
setTunnelService(TunnelService tunnelService)
Sets the tunnel service. |
void |
start()
Starts the application then all the enabled associated services. |
void |
stop()
Stops all the enabled associated services the the application itself. |
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 Application()
Application(Context)
. Therefore
the context will initially be null. It's only when you attach the
application to a virtual host via one of its attach*() methods that a
proper context will be set.
public Application(Context context)
context
- The context to use based on parent component context. This
context should be created using the
Context.createChildContext()
method to ensure a proper
isolation with the other applications.Method Detail |
---|
public static Application getCurrent()
Handler.getApplication()
public static void setCurrent(Application application)
application
- The thread's context.public Restlet createRoot()
public java.lang.String getAuthor()
public ConnectorService getConnectorService()
@Deprecated public ConverterService getConverterService()
public DecoderService getDecoderService()
public java.lang.String getDescription()
public MetadataService getMetadataService()
public java.lang.String getName()
public java.lang.String getOwner()
public RangeService getRangeService()
public Restlet getRoot()
public StatusService getStatusService()
public TaskService getTaskService()
public TunnelService getTunnelService()
public void handle(Request request, Response response)
Restlet
Restlet.init(Request, Response)
method. In next version,
Restlet.init(Request, Response)
will be removed and its logic directly
added to this method instead.
Subclasses overriding this method should make sure that they call super.handle(request, response) before adding their own logic.
handle
in class Restlet
request
- The request to handle.response
- The response to update.public void setAuthor(java.lang.String author)
author
- The author(s).public void setConnectorService(ConnectorService connectorService)
connectorService
- The connector service.@Deprecated public void setConverterService(ConverterService converterService)
converterService
- The converter service.public void setDecoderService(DecoderService decoderService)
decoderService
- The decoder service.public void setDescription(java.lang.String description)
description
- The description.public void setMetadataService(MetadataService metadataService)
metadataService
- The metadata service.public void setName(java.lang.String name)
name
- The display name.public void setOwner(java.lang.String owner)
owner
- The owner(s).public void setRangeService(RangeService rangeService)
rangeService
- The range service.public void setRoot(Restlet root)
root
- The root Restlet.public void setStatusService(StatusService statusService)
statusService
- The status service.public void setTaskService(TaskService taskService)
taskService
- The task service.public void setTunnelService(TunnelService tunnelService)
tunnelService
- The tunnel service.public void start() throws java.lang.Exception
start
in class Restlet
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class Restlet
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |