org.restlet.engine.component
Class ChildContext

java.lang.Object
  extended by org.restlet.Context
      extended by org.restlet.engine.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 void fireContextChanged(Restlet restlet, Context context)
          Indicates that a Restlet's context has changed.
static String getBestClassName(Class<?> clazz)
          Return the best class name.
 Restlet getChild()
          Returns the child.
static String getLoggerName(String baseName, Object owner)
          Returns a non-null logger name.
protected  Context getParentContext()
          Returns the parent context.
 void setChild(Restlet child)
          Sets the child.
 
Methods inherited from class org.restlet.Context
getAttributes, getClientDispatcher, getCurrent, getCurrentLogger, getDefaultEnroler, getDefaultVerifier, getLogger, getParameters, getServerDispatcher, setAttributes, setClientDispatcher, setCurrent, setDefaultEnroler, setDefaultVerifier, setLogger, setLogger, setParameters, setServerDispatcher
 
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

fireContextChanged

public static void fireContextChanged(Restlet restlet,
                                      Context context)
Indicates that a Restlet's context has changed.

Parameters:
restlet - The Restlet with a changed context.
context - The new context.

getBestClassName

public static String getBestClassName(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.

getLoggerName

public static String getLoggerName(String baseName,
                                   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.

createChildContext

public Context createChildContext()
Overrides:
createChildContext in class Context

getChild

public Restlet getChild()
Returns the child.

Returns:
the child.

getParentContext

protected Context getParentContext()
Returns the parent context.

Returns:
The parent context.

setChild

public void setChild(Restlet child)
Sets the child.

Parameters:
child - The child.


Copyright © 2005-2011 Noelios Technologies.