org.jdtaus.core.container
Interface Context


public interface Context

Object context.

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

Version:
$Id: Context.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
ContextFactory

Method Summary
 Object getObject(String key)
          Gets an object from the context.
 Collection getObjectKeys()
          Gets a collection containing all object keys from the context.
 Object removeObject(String key)
          Removes an object from the context.
 Object setObject(String key, Object o)
          Sets an object in the context.
 

Method Detail

getObject

Object getObject(String key)
Gets an object from the context.

Parameters:
key - Key of the object to return.
Returns:
The object with key key or null if no such object is held by the context. Returning null may also indicate that the context associated null with the specified key if the implementation supports null values.
Throws:
NullPointerException - if key is null.

getObjectKeys

Collection getObjectKeys()
Gets a collection containing all object keys from the context.

Returns:
A collection containing all object keys from the context.

removeObject

Object removeObject(String key)
Removes an object from the context.

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

setObject

Object setObject(String key,
                 Object o)
Sets an object in the context.

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


Copyright © 2005-2009 jDTAUS. All Rights Reserved.