|
Oracle Fusion Middleware Oracle WebLogic Server API Reference 11g Release 1 (10.3.3) Part Number E13941-03 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkContextMap
WorkContextMap
provides users with 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 WorkContext s in
existance in the map. |
boolean |
isPropagationModePresent(int PropagationMode)
Given a PropagationMode PropagationMode , this method will iterate
over the map and return true if the propagation mode is present. |
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.
PropagationMode
s 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.PropagationMode
WorkContext 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.boolean isPropagationModePresent(int PropagationMode)
PropagationMode
, this method will iterate
over the map and return true if the propagation mode is present. The method
should return true if there exists at least one entry in the map which has
at least one propagation mode specified by propMode
PropagationMode
- PropagationMode
value
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()
WorkContext
s 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.
|
Copyright 1996, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Oracle WebLogic Server 10.3.3 API Reference 11g Release 1 (10.3.3) Part Number E13941-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |