| java.lang.Object org.restlet.Context
All known Subclasses: com.noelios.restlet.application.ApplicationContext, com.noelios.restlet.component.ComponentContext,
Context | public class Context (Code) | | Contextual data and services provided to a Restlet. The context is the means
by which a Restlet may access the software environment within the framework.
It is typically provided by the immediate parent Restlet (Component and
Application are the most common cases).
author: Jerome Louvel (contact@noelios.com) |
Context | public Context()(Code) | | Constructor. Writes log messages to "org.restlet".
|
Context | public Context(Logger logger)(Code) | | Constructor.
Parameters: logger - The logger instance of use. |
Context | public Context(String loggerName)(Code) | | Constructor.
Parameters: loggerName - The name of the logger to use. |
getAttributes | public Map<String, Object> getAttributes()(Code) | | Returns a modifiable attributes map that can be used by developers to
save information relative to the context. This is a convenient mean to
provide common objects to all the Restlets and Resources composing an
Application.
In addition, this map is a shared space between the developer and the
Restlet implementation. For this purpose, all attribute names starting
with "org.restlet" are reserved. Currently the following attributes are
used:
Attribute name |
Class name |
Description |
org.restlet.application |
org.restlet.Application |
The parent application providing this context, if any. |
|
The modifiable attributes map.
getDispatcher | public Uniform getDispatcher()(Code) | | Returns a request dispatcher to available client connectors. When you ask
the dispatcher to handle a request, it will automatically select the best
client connector for your request, based on the request.protocol property
or on the resource URI's scheme. This call is blocking and will return an
updated response object.
A request dispatcher to available client connectors. |
getLogger | public Logger getLogger()(Code) | | Returns the logger.
The logger. |
getParameters | public Series<Parameter> getParameters()(Code) | | Returns the modifiable series of parameters. A parameter is a pair
composed of a name and a value and is typically used for configuration
purpose, like Java properties. Note that multiple parameters with the
same name can be declared and accessed.
The modifiable series of parameters. |
setLogger | public void setLogger(Logger logger)(Code) | | Sets the logger.
Parameters: logger - The logger. |
|
|