public abstract class ReflectionExecutableChange<LOADED_CHANGE extends AbstractReflectionLoadedChange> extends AbstractExecutableChange<LOADED_CHANGE> implements ExecutableChange
It creates a new instance on demand in every execution(apply and rollback), because it's intended to be applied just once. The only case it will be potentially applied twice is if it fails, and in that case will only happen once(in case of sequential execution) or very few times(in case or parallel execution and happen to fail multiple concurrent changes at the same time),because after that the process will abort.
For this reason it's more optimal to do it on demand, that articulate some synchronisation mechanism.
However, the methods are extracted in advance, so we can spot wrong configuration before starting the process and fail fast.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Method |
executionMethod |
protected java.lang.reflect.Method |
rollbackMethod |
action, loadedChange| Constructor and Description |
|---|
ReflectionExecutableChange(java.lang.String stageName,
LOADED_CHANGE loadedChange,
io.flamingock.internal.common.core.recovery.action.ChangeAction action,
java.lang.reflect.Method executionMethod,
java.lang.reflect.Method rollbackMethod) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getApplyMethodName() |
java.lang.String |
getRollbackMethodName() |
equals, getAction, getAuthor, getId, getLoadedChange, getOrder, getRecovery, getSource, getSourceFile, getStageName, getTargetSystem, getTransactionalFlag, hashCode, isAlreadyApplied, isLegacy, isRunAlways, isSystem, isTransactional, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitapply, getAction, getLoadedChange, getStageName, isAlreadyApplied, isTransactional, rollbackprotected final java.lang.reflect.Method executionMethod
protected final java.lang.reflect.Method rollbackMethod
public ReflectionExecutableChange(java.lang.String stageName,
LOADED_CHANGE loadedChange,
io.flamingock.internal.common.core.recovery.action.ChangeAction action,
java.lang.reflect.Method executionMethod,
java.lang.reflect.Method rollbackMethod)
public java.lang.String getApplyMethodName()
getApplyMethodName in interface ExecutableChangepublic java.lang.String getRollbackMethodName()
getRollbackMethodName in interface ExecutableChange