public interface UserWorkArea
extends java.io.Serializable
UserWorkArea
provides end-users, ISVs and other
mechanisms for tagging certain requests (whether remote or local)
and propagating that information based on certain policy
constraints. UserWorkArea
is part of a client or
applications JNDI environment and can be access through JNDI:
UserWorkArea rc = (UserWorkArea) new InitialContext().lookup("java:comp/UserWorkArea");
Internal consumers of this service can also access the current
UserWorkArea
through a helper:
UserWorkArea rc = WorkAreaHelper. getWorkAreaHelper().getWorkArea();
Modifier and Type | Method and Description |
---|---|
void |
begin(java.lang.String name)
Begin a new WorkArea, with remote propagation only, and associate
it with the current thread.
|
void |
begin(java.lang.String name,
int propagationMode)
Begin a new WorkArea, with propagation mode set to
defaultPropertyMode, and associate it with the current thread.
|
void |
complete()
Complete the current, active WorkArea.
|
void |
complete(java.lang.String name)
Complete the active WorkArea named name.
|
java.lang.String[] |
getKeys()
Returns an array of all of the keys associated with the stack of
WorkArea's for the current thread.
|
int |
getMode(java.lang.String key)
Get the current WorkArea's PropertyModeType value for key.
|
java.lang.String |
getName()
Returns the current WorkArea's name.
|
WorkContext |
getProperty(java.lang.String key)
Get the current WorkArea's value for key.
|
void |
removeProperty(java.lang.String key)
Remove the property for key from the current WorkArea.
|
void |
setProperty(java.lang.String key,
WorkContext ctx)
Adds context data to the current WorkArea.
|
void |
setProperty(java.lang.String key,
WorkContext ctx,
int propertyModeType)
Adds context data to the current WorkArea.
|
void begin(java.lang.String name)
void begin(java.lang.String name, int propagationMode)
PropagationMode.THREAD
allows a context to be
propagated to Work instances. Applying
PropagationMode.REMOTE
allows a context to be
propagated in RMI calls. Applying
PropagationMode.TRANSACTION
allows a context to be
propagated between different global transactions. Applying
PropagationMode.JMS_CONSUMER
allows a context to be
propagated to JMS consumers. Applying
PropagationMode.JMS_PRODUCER
allows a context to be
propagated from JMS producers. Applying
PropagationMode.SOAP
allows a context to be
propagated across SOAP messages. PropagationMode
s
are additive and can be used together.PropagationMode
void complete() throws NoWorkContextException
NoWorkContextException
void complete(java.lang.String name) throws NoWorkContextException
It is generally preferrable to end named work areas to avoid conflicts with other code using the WorkArea service.
NoWorkContextException
java.lang.String getName()
java.lang.String[] getKeys()
void setProperty(java.lang.String key, WorkContext ctx) throws NoWorkContextException, PropertyReadOnlyException
void setProperty(java.lang.String key, WorkContext ctx, int propertyModeType) throws NoWorkContextException, PropertyReadOnlyException
WorkContext getProperty(java.lang.String key)
int getMode(java.lang.String key)
void removeProperty(java.lang.String key) throws NoWorkContextException
NoWorkContextException