|
BEA Systems, Inc. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
public interface WorkContextMap
WorkContextMap provides internal users and layered products
mechanisms for tagging certain requests (whether remote or local)
and propagating that information based on certain policy
constraints.
WorkContextMap is part of a client or
application's JNDI environment and can be access through JNDI:
WorkContextMap rc = (WorkContextMap)
new InitialContext().lookup("java:comp/WorkContextMap");
| Method Summary | |
|---|---|
WorkContext |
get(String key)
Get the current WorkContextMap's context data for key. |
int |
getPropagationMode(String key)
Get the current WorkContextMap's
PropagationMode value for key. |
boolean |
isEmpty()
Tests to see whether there are any WorkContexts in
existance in the map. |
Iterator |
iterator()
Return a iterator for all of the current WorkContext
entries. |
Iterator |
keys()
Return a iterator for all of the current WorkContext
keys. |
WorkContext |
put(String key,
WorkContext ctx)
Adds context data with key key to the current
WorkContextMap and associates it with the current thread. |
WorkContext |
put(String key,
WorkContext ctx,
int propagationMode)
Adds context data with key key to the current
WorkContextMap and associates it with the current thread. |
WorkContext |
remove(String key)
Remove the context data for key from the current WorkContextMap. |
| Method Detail |
|---|
WorkContext put(String key,
WorkContext ctx)
throws PropertyReadOnlyException
key to the current
WorkContextMap and associates it with the current thread. The context
data is propagated according to the default
PropagationMode. The
defaults are PropagationMode.DEFAULT.
key - a unique String that is used to obtain a
reference to a particular WorkContext. Keys are
encoded as DataOutput.writeUTF(java.lang.String). In order to protect
the key namespace a good convention is to use package names as a
prefix. For example com.you.SomeKey}.ctx - The WorkContext to put in the map.
- Returns:
- the previous WorkContext for key
- Throws:
PropertyReadOnlyException - if the property already
exists and is read-only.
NullPointerException - if the property or context is null.
WorkContext put(String key,
WorkContext ctx,
int propagationMode)
throws PropertyReadOnlyException
key to the current
WorkContextMap and associates it with the current thread. This context
data is propagated according to the provided mode
propagationMode. Any existing value for key will be
changed as per the property mode
propertyModeType. It is legal for multiple context
data items to be propagated as long as their keys differ.
Properties that are set in the WorkContextMap are propagated
based on propagation policies assigned to the property. By
default a property is not propagated out of the current
thread. Applying PropagationMode.WORK allows a
property to be propagated to Work instances. Applying
PropagationMode.RMI allows a property to be
propagated in RMI calls. Applying
PropagationMode.TRANSACTION allows a property to be
propagated between different global transactions. Applying
PropagationMode.JMS_QUEUE allows a property to be
propagated to JMS consumers. Applying
PropagationMode.JMS_TOPIC allows a property to be
propagated from JMS producers. Applying
PropagationMode.SOAP allows a property to be
propagated across SOAP messages. Applying
PropagationMode.MIME_HEADER allows a property to be
propagated from mail messages or cookies.
PropagationModes are additive and can be used
together. PropagationMode.GLOBAL is an alias for
PropagationMode.RMI, PropagationMode.SOAP,
PropagationMode.JMS_QUEUE and
PropagationMode.MIME_HEADERS
key - a unique String that is used to obtain a
reference to a particular WorkContext. Keys are
encoded as DataOutput.writeUTF(java.lang.String). In order to protect
the key namespace a good convention is to use package names as a
prefix. For example com.you.SomeKey.ctx - The WorkContext to put in the map.
specifies how the WorkContext entry can be modified.propagationMode - a bitwise-OR of
PropagationMode values prescribing how the
WorkContext entry should be propagated.
PropertyReadOnlyException - if the property already
exists and is read-only.
NullPointerException - if the property or context is null.PropagationModeWorkContext get(String key)
key - a unique String that is used to obtain a
reference to a particular WorkContext
WorkContext value or null if there is
none.int getPropagationMode(String key)
WorkContextMap's
PropagationMode value for key. If the current
WorkContextMap has no value for key then
PropagationMode.LOCAL is returned.
key - a unique String that is used to obtain a
reference to a particular WorkContext
PropagationMode values
prescribing how the WorkContext entry should be
propagated.
WorkContext remove(String key)
throws NoWorkContextException,
PropertyReadOnlyException
PropertyReadOnlyException if the
permissions on the key do not allow deletion.
key - a unique String that is used to obtain a
reference to a particular WorkContext
NoWorkContextException - if there is no mapping for
key
PropertyReadOnlyException - if a mapping exists but is
read-only.boolean isEmpty()
WorkContexts in
existance in the map. Returns true if there are no elements in
the map, false otherwise.
boolean valueIterator iterator()
WorkContext
entries. If there are no entries then null is returned.
Iterator representing the current entries.Iterator keys()
WorkContext
keys. If there are no entries then null is returned.
Iterator representing the current keys.
|
Because this information documents a Tech Preview of a BEA product, it may be incomplete and is subject to change. Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/essex/TechPreview Copyright 2007 BEA Systems Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||