@java.lang.SuppressWarnings("unused") public interface ExecutionContext
Interface definition for object used throughout the Moqui Framework to manage contextual execution information and tool interfaces. One instance of this object will exist for each thread running code and will be applicable for that thread only.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
destroy() This should be called when the ExecutionContext won't be used any more. |
|
public ArtifactExecutionFacade |
getArtifactExecution() For information about artifacts as they are being executed. |
|
public CacheFacade |
getCache() For managing and accessing caches. |
|
public ContextStack |
getContext() Returns a Map that represents the current local variable space (context) in whatever is being run. |
|
public ContextBinding |
getContextBinding() |
|
public java.util.Map<java.lang.String, java.lang.Object> |
getContextRoot() Returns a Map that represents the global/root variable space (context), ie the bottom of the context stack. |
|
public ElasticFacade |
getElastic() For interactions with ElasticSearch using the built in HTTP REST client. |
|
public EntityFacade |
getEntity() For interactions with a relational database. |
|
public ExecutionContextFactory |
getFactory() Get the ExecutionContextFactory this came from. |
|
public L10nFacade |
getL10n() For localization (l10n) functionality, like localizing messages. |
|
public LoggerFacade |
getLogger() For trace, error, etc logging to the console, files, etc. |
|
public MessageFacade |
getMessage() For user messages including general feedback, errors, and field-specific validation errors. |
|
public java.util.List<NotificationMessage> |
getNotificationMessages(java.lang.String topic) |
|
public ResourceFacade |
getResource() For accessing resources by location string (http://, jar://, component://, content://, classpath://, etc). |
|
public ScreenFacade |
getScreen() For rendering screens for general use (mostly for things other than web pages or web page snippets). |
|
public ServiceFacade |
getService() For calling services (local or remote, sync or async or scheduled). |
<V> |
public V |
getTool(java.lang.String toolName, java.lang.Class<V> instanceClass, java.lang.Object parameters) Get an instance object from the named ToolFactory instance (loaded by configuration). |
|
public TransactionFacade |
getTransaction() For transaction operations use this facade instead of the JTA UserTransaction and TransactionManager. |
|
public UserFacade |
getUser() For information about the user and user preferences (including locale, time zone, currency, etc). |
|
public WebFacade |
getWeb() If running through a web (HTTP servlet) request offers access to the various web objects/information. |
|
public void |
initWebFacade(java.lang.String webappMoquiName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) This should be called by a filter or servlet at the beginning of an HTTP request to initialize a web facade for the current thread. |
|
public NotificationMessage |
makeNotificationMessage() |
|
public java.util.concurrent.Future |
runAsync(groovy.lang.Closure closure) A lightweight asynchronous executor. |
This should be called when the ExecutionContext won't be used any more. Implementations should make sure any active transactions, database connections, etc are closed.
For information about artifacts as they are being executed.
For managing and accessing caches.
Returns a Map that represents the current local variable space (context) in whatever is being run.
Returns a Map that represents the global/root variable space (context), ie the bottom of the context stack.
For interactions with ElasticSearch using the built in HTTP REST client.
For interactions with a relational database.
Get the ExecutionContextFactory this came from.
For localization (l10n) functionality, like localizing messages.
For trace, error, etc logging to the console, files, etc.
For user messages including general feedback, errors, and field-specific validation errors.
For accessing resources by location string (http://, jar://, component://, content://, classpath://, etc).
For rendering screens for general use (mostly for things other than web pages or web page snippets).
For calling services (local or remote, sync or async or scheduled).
Get an instance object from the named ToolFactory instance (loaded by configuration). Some tools return a singleton instance, others a new instance each time it is used and that instance is saved with this ExecutionContext to be reused. The instanceClass may be null in scripts or other contexts where static typing is not needed
For transaction operations use this facade instead of the JTA UserTransaction and TransactionManager. See javadoc comments there for examples of code usage.
For information about the user and user preferences (including locale, time zone, currency, etc).
If running through a web (HTTP servlet) request offers access to the various web objects/information. If not running in a web context will return null.
This should be called by a filter or servlet at the beginning of an HTTP request to initialize a web facade for the current thread.
A lightweight asynchronous executor. ExecutionContext aware and uses a new ExecutionContext in the separate thread based on the current (retaining user, disable authz, etc and may be improved over time to copy more).