com.noelios.restlet.component
Class ChildContext

java.lang.Object
  extended by org.restlet.Context
      extended by com.noelios.restlet.component.ChildContext

public class ChildContext
extends Context

Context based on a parent component's context but dedicated to a child Restlet, typically to an application.

Author:
Jerome Louvel

Constructor Summary
ChildContext(Context parentContext)
          Constructor.
 
Method Summary
 Context createChildContext()
           
static java.lang.String getBestClassName(java.lang.Class<?> clazz)
          Return the best class name.
 Restlet getChild()
          Returns the child.
 ChildClientDispatcher getClientDispatcher()
           
static java.lang.String getLoggerName(java.lang.String baseName, java.lang.Object owner)
          Returns a non-null logger name.
protected  Context getParentContext()
          Returns the parent context.
 Uniform getServerDispatcher()
           
 void setChild(Restlet child)
          Sets the child.
 
Methods inherited from class org.restlet.Context
getAttributes, getCurrent, getCurrentLogger, getDispatcher, getLogger, getParameters, setAttributes, setCurrent, setLogger, setLogger, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildContext

public ChildContext(Context parentContext)
Constructor.

Parameters:
parentContext - The parent context.
Method Detail

getLoggerName

public static java.lang.String getLoggerName(java.lang.String baseName,
                                             java.lang.Object owner)
Returns a non-null logger name. It is composed by the canonical class name of the owner object suffixed by the owner's hash code.

Parameters:
baseName - The base logger name to prepend, without a trailing dot.
owner - The context owner.
Returns:
The logger name.

getBestClassName

public static java.lang.String getBestClassName(java.lang.Class<?> clazz)
Return the best class name. If the class is anonymous, then it returns the super class name.

Parameters:
clazz - The class to name.
Returns:
The class name.

createChildContext

public Context createChildContext()
Overrides:
createChildContext in class Context

getChild

public Restlet getChild()
Returns the child.

Returns:
the child.

getClientDispatcher

public ChildClientDispatcher getClientDispatcher()
Overrides:
getClientDispatcher in class Context

getParentContext

protected Context getParentContext()
Returns the parent context.

Returns:
The parent context.

getServerDispatcher

public Uniform getServerDispatcher()
Overrides:
getServerDispatcher in class Context

setChild

public void setChild(Restlet child)
Sets the child.

Parameters:
child - The child.


Copyright © 2005-2008 Noelios Technologies.