Package fr.becpg.repo.formulation
Class FormulationChain<T extends FormulatedEntity>
java.lang.Object
fr.becpg.repo.formulation.FormulationChain<T>
Chain of responsibility executor.
Any type passed as context information.
- Version:
- $Id: $Id
- Author:
- matthieu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate FormulationService<T>private List<FormulationHandler<T>>private final org.apache.commons.logging.Logprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteChain(T context) executeChain.Getter for the fieldchainId.Getter for the fieldhandlers.voidinit()init.voidonError.private voidvoidsetChainId(String chainId) Setter for the fieldchainId.voidsetContextClass(Class<T> contextClass) Setter for the fieldcontextClass.voidsetFormulationService(FormulationService<T> formulationService) Setter for the fieldformulationService.voidsetHandlers(List<FormulationHandler<T>> handlers) Sets handler list.voidsetUpdateFormulatedDate(boolean updateFormulatedDate) Setter for the fieldupdateFormulatedDate.booleanshouldUpdateFormulatedDate.
-
Field Details
-
logger
private final org.apache.commons.logging.Log logger -
contextClass
-
formulationService
-
handlers
-
chainId
-
updateFormulatedDate
private boolean updateFormulatedDate
-
-
Constructor Details
-
FormulationChain
public FormulationChain()
-
-
Method Details
-
setUpdateFormulatedDate
public void setUpdateFormulatedDate(boolean updateFormulatedDate) Setter for the field
updateFormulatedDate.- Parameters:
updateFormulatedDate- a boolean.
-
setChainId
Setter for the field
chainId.- Parameters:
chainId- aStringobject.
-
getChainId
Getter for the field
chainId.- Returns:
- a
Stringobject.
-
setFormulationService
Setter for the field
formulationService.- Parameters:
formulationService- aFormulationServiceobject.
-
setContextClass
Setter for the field
contextClass.- Parameters:
contextClass- aClassobject.
-
init
public void init()init.
-
executeChain
executeChain.
- Parameters:
context- a T object.- Throws:
FormulateException- if any.
-
setHandlers
Sets handler list. Intended to be injected.- Parameters:
handlers- Handler list.
-
getHandlers
Getter for the field
handlers.- Returns:
- a
Listobject.
-
prepareHandlerChain
private void prepareHandlerChain() -
shouldUpdateFormulatedDate
public boolean shouldUpdateFormulatedDate()shouldUpdateFormulatedDate.
- Returns:
- a boolean.
-
onError
onError.
- Parameters:
repositoryEntity- a T object
-