public class Context
extends java.lang.Object
Constructor and Description |
---|
Context()
Constructor.
|
Context(java.util.logging.Logger logger)
Constructor.
|
Context(java.lang.String loggerName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Context |
createChildContext()
Creates a protected child context.
|
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> |
getAttributes()
Returns a modifiable attributes map that can be used by developers to
save information relative to the context.
|
Restlet |
getClientDispatcher()
Returns a request dispatcher to available client connectors.
|
static Context |
getCurrent()
Returns the context associated to the current
Restlet . |
static java.util.logging.Logger |
getCurrentLogger()
Returns the current context's logger.
|
java.util.logging.Logger |
getLogger()
Returns the logger.
|
Series<Parameter> |
getParameters()
Returns the modifiable series of parameters.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Sets the modifiable map of attributes.
|
void |
setClientDispatcher(Restlet clientDispatcher)
Sets the client dispatcher.
|
void |
setLogger(java.util.logging.Logger logger)
Sets the logger.
|
void |
setLogger(java.lang.String loggerName)
Sets the logger.
|
void |
setParameters(Series<Parameter> parameters)
Sets the modifiable series of parameters.
|
public Context()
public Context(java.util.logging.Logger logger)
logger
- The logger instance of use.public Context(java.lang.String loggerName)
loggerName
- The name of the logger to use.public static Context getCurrent()
Restlet
. The
context can be the one of a Component
, an Application
, a
org.restlet.client.routing.Filter
or any other Restlet
subclass.Restlet.getContext()
or
Resource.getContext()
.Restlet
via the
Restlet.handle(org.restlet.client.Request, org.restlet.client.Response)
method.public static java.util.logging.Logger getCurrentLogger()
public Context createChildContext()
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getAttributes()
Attribute name | Class name | Description |
---|---|---|
org.restlet.client.application | org.restlet.client.Application | The parent application providing this context, if any. |
public Restlet getClientDispatcher()
public java.util.logging.Logger getLogger()
public Series<Parameter> getParameters()
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
attributes
- A map of attributes.public void setClientDispatcher(Restlet clientDispatcher)
clientDispatcher
- The new client dispatcher.public void setLogger(java.util.logging.Logger logger)
logger
- The logger.public void setLogger(java.lang.String loggerName)
loggerName
- The name of the logger to use.Copyright © 2005-2024 Restlet.