Package com.xpn.xwiki.util
Class AbstractXWikiRunnable
- java.lang.Object
-
- com.xpn.xwiki.util.AbstractXWikiRunnable
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
XWikiStatsStoreService
public abstract class AbstractXWikiRunnable extends Object implements Runnable
Base class for any XWiki daemon class. It provide tools to initialize execution context.- Since:
- 1.8.4, 1.9RC1, 2.0M1
- Version:
- $Id: 2c888779077d6c739cd7581a00238738bf912915 $
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractXWikiRunnable()
protected
AbstractXWikiRunnable(String propertyName, Object propertyValue)
protected
AbstractXWikiRunnable(Map<String,Object> properties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
cleanupExecutionContext()
protected void
declareProperties(org.xwiki.context.ExecutionContext executionContext)
Lets subclasses declare execution context properties.protected org.xwiki.context.ExecutionContext
initExecutionContext()
Initialize execution context for the current thread.void
run()
protected abstract void
runInternal()
-
-
-
Constructor Detail
-
AbstractXWikiRunnable
protected AbstractXWikiRunnable()
-
AbstractXWikiRunnable
protected AbstractXWikiRunnable(String propertyName, Object propertyValue)
- Parameters:
propertyName
- the name of the property to put in the initialized contextpropertyValue
- the value of the property to put in the initialized context
-
-
Method Detail
-
declareProperties
protected void declareProperties(org.xwiki.context.ExecutionContext executionContext)
Lets subclasses declare execution context properties.- Parameters:
executionContext
- the execution context.
-
initExecutionContext
protected org.xwiki.context.ExecutionContext initExecutionContext() throws org.xwiki.context.ExecutionContextException
Initialize execution context for the current thread.- Returns:
- the new execution context
- Throws:
org.xwiki.context.ExecutionContextException
- error when try to initialize execution context
-
cleanupExecutionContext
protected void cleanupExecutionContext()
-
runInternal
protected abstract void runInternal() throws InterruptedException
- Throws:
InterruptedException
-
-