org.nuxeo.ecm.automation
Class OperationContext
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.nuxeo.ecm.automation.OperationContext
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>
- Direct Known Subclasses:
- RestOperationContext
public class OperationContext
- extends HashMap<String,Object>
An operation context. Holds context objects, a context parameters map and a
list of operations to run.
Context objects are:
- The Operation Chain Input - optional. It will be used as the input for
the first operation in the chain. If input is null then only VOID methods in
the first operation will be matched.
- A Core Session - which is optional and should be provided by the caller.
(either at creation time as a constructor argument, either using the
setCoreSession(CoreSession)
method. When running the operation chain
in asynchronous mode another session will be created by preserving the
current session credentials.
Each entry in the operation list contains the ID of the operation to be run
and a map of operation parameters to use when initializing the operation.
The context parameters map can be filled with contextual information by the
caller. Each operation will be able to access the contextual data at runtime
and to update it if needed.
- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
OperationContext
public OperationContext()
OperationContext
public OperationContext(CoreSession session)
setCoreSession
public void setCoreSession(CoreSession session)
setCommit
public void setCommit(boolean commit)
isCommit
public boolean isCommit()
getCoreSession
public CoreSession getCoreSession()
getLoginStack
public LoginStack getLoginStack()
getPrincipal
public Principal getPrincipal()
setInput
public void setInput(Object input)
getInput
public Object getInput()
peek
public Object peek(String type)
push
public void push(String type,
Object obj)
pop
public Object pop(String type)
pull
public Object pull(String type)
getAdapter
public <T> T getAdapter(Class<T> type)
addTrace
public void addTrace(String trace)
getTrace
public List<String> getTrace()
getFormattedTrace
public String getFormattedTrace()
addCleanupHandler
public void addCleanupHandler(CleanupHandler handler)
removeCleanupHandler
public void removeCleanupHandler(CleanupHandler handler)
dispose
public void dispose()
throws OperationException
- Throws:
OperationException
setRollback
public void setRollback()
- Set the rollback mark on the current tx. This will cause the transaction to rollback.
Also this is setting the session commit flag on false
Copyright © 2011 Nuxeo SAS. All Rights Reserved.