org.jdtaus.core.container
Interface Context


public interface Context

Implementation context.

The context stores key-value pairs bound to a client. For every method invocation identical clients get identical contexts.

Version:
$Id: Context.java 1914 2007-03-01 02:20:44Z schulte2005 $
Author:
Christian Schulte
See Also:
ContextFactory

Method Summary
 Object getAttribute(String key)
          Gets an attribute from the context.
 Object removeAttribute(String key)
          Removes an attribute from the context.
 Object setAttribute(String key, Serializable o)
          Sets an attribute in the context.
 

Method Detail

getAttribute

public Object getAttribute(String key)
Gets an attribute from the context.

Parameters:
key - Key of the attribute to return.
Returns:
The attribute with key or if no such attribute is held by the context.
Throws:
NullPointerException - if is .

removeAttribute

public Object removeAttribute(String key)
Removes an attribute from the context.

Parameters:
key - Key of the attribute to remove.
Returns:
previous value associated with , or if there was no attribute for . Returning may also indicate that the context previously associated with the specified key, if the implementation supports values.
Throws:
NullPointerException - if is .

setAttribute

public Object setAttribute(String key,
                           Serializable o)
Sets an attribute in the context.

Parameters:
key - Key of the attribute to store with.
o - Object to store with key .
Returns:
previous value associated with , or if there was no attribute for . Returning may also indicate that the context previously associated with the specified key, if the implementation supports values.
Throws:
NullPointerException - if is .


Copyright © 2005-2007 jDTAUS. All Rights Reserved.