Package org.infinispan.tasks
Class TaskContext
java.lang.Object
org.infinispan.tasks.TaskContext
TaskContext. Defines the execution context of a task by specifying parameters, cache and marshaller
- Since:
- 8.1
- Author:
- Tristan Tarrant
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddOptionalParameter(String name, Object value) Adds a named parameter to the task context only if it is non-nulladdParameter(String name, Object value) Adds a named parameter to the task contextThe cache against which this task will be executed.cacheManager(EmbeddedCacheManager cacheManager) The cache manager with which this task should be executedgetCache()The default cache.CacheManager for this task executionMarshaller for this task executionGets a map of named parameters for the taskThe optionalSubjectwhich is executing this taskbooleanWhether executing this task will generate an event in the event loglogEvent(boolean logEvent) Whether execution will generate an event in the event logmarshaller(Marshaller marshaller) The marshaller with which this task should be executedparameters(Map<String, ?> parameters) A map of named parameters that will be passed to the task.subject()The subject to impersonate when running this task.toString()
- 
Constructor Details- 
TaskContextpublic TaskContext()
- 
TaskContext
 
- 
- 
Method Details- 
cacheManagerThe cache manager with which this task should be executed
- 
marshallerThe marshaller with which this task should be executed
- 
cacheThe cache against which this task will be executed. This will be the task's default cache, but other caches can be obtained from the cache manager
- 
parametersA map of named parameters that will be passed to the task. Invoking this method overwrites any previously set parameters
- 
subjectThe subject to impersonate when running this task. If unspecified, the Subject (if any) will be retrieved viaSecurity.getSubject()
- 
addParameterAdds a named parameter to the task context
- 
addOptionalParameterAdds a named parameter to the task context only if it is non-null
- 
logEventWhether execution will generate an event in the event log
- 
getCacheManagerCacheManager for this task execution- Returns:
- the cache manager
 
- 
getMarshallerMarshaller for this task execution- Returns:
- optional marshaller
 
- 
getCacheThe default cache. Other caches can be obtained from cache manager (Cache.getCacheManager())- Returns:
- optional cache
 
- 
getParametersGets a map of named parameters for the task- Returns:
- optional map of named parameters for the task
 
- 
getSubjectThe optionalSubjectwhich is executing this task- Returns:
- the Subject
 
- 
isLogEventpublic boolean isLogEvent()Whether executing this task will generate an event in the event log- Returns:
- true if an event will be logged, false otherwise
 
- 
toString
- 
subject
 
-