Class AbstractBackgroundProcessRequest
- java.lang.Object
-
- org.silverpeas.core.backgroundprocess.AbstractBackgroundProcessRequest
-
- All Implemented Interfaces:
AbstractRequestTask.Request<AbstractRequestTask.ProcessContext>
- Direct Known Subclasses:
RunnableBackgroundProcess
public abstract class AbstractBackgroundProcessRequest extends Object implements AbstractRequestTask.Request<AbstractRequestTask.ProcessContext>
Defines a request performed byBackgroundProcessTask
.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBackgroundProcessRequest()
Initializes a unique request.protected
AbstractBackgroundProcessRequest(String uniqueId, BackgroundProcessTask.LOCK_DURATION lockDuration)
Initializes a request by given a unique identifier.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BackgroundProcessTask.LOCK_DURATION
getLockDuration()
Gets the time after then an another process can be performed.String
getUniqueId()
The unique identifier of the request.protected abstract void
process()
The treatment which will be performed.void
process(AbstractRequestTask.ProcessContext context)
Process the request according to the given context.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.thread.task.AbstractRequestTask.Request
getReplacementId
-
-
-
-
Constructor Detail
-
AbstractBackgroundProcessRequest
protected AbstractBackgroundProcessRequest()
Initializes a unique request.
-
AbstractBackgroundProcessRequest
protected AbstractBackgroundProcessRequest(String uniqueId, BackgroundProcessTask.LOCK_DURATION lockDuration)
Initializes a request by given a unique identifier.- Parameters:
uniqueId
- a unique identifier.
-
-
Method Detail
-
process
public void process(AbstractRequestTask.ProcessContext context) throws InterruptedException
Description copied from interface:AbstractRequestTask.Request
Process the request according to the given context.- Specified by:
process
in interfaceAbstractRequestTask.Request<AbstractRequestTask.ProcessContext>
- Parameters:
context
- the context of the process.- Throws:
InterruptedException
- in case of technical error.
-
getUniqueId
public String getUniqueId()
The unique identifier of the request.- Returns:
- a string unique identifier.
-
getLockDuration
public BackgroundProcessTask.LOCK_DURATION getLockDuration()
Gets the time after then an another process can be performed.- Returns:
- the
BackgroundProcessTask.LOCK_DURATION
instance.
-
process
protected abstract void process()
The treatment which will be performed.
-
-