public class CodeExecutableChange<LOADED_CHANGE extends AbstractReflectionLoadedChange> extends ReflectionExecutableChange<LOADED_CHANGE>
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.
executionMethod, rollbackMethodaction, loadedChange| Constructor and Description |
|---|
CodeExecutableChange(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 |
|---|---|
void |
apply(ExecutionRuntime executionRuntime) |
protected void |
executeInternal(ExecutionRuntime executionRuntime,
java.lang.reflect.Method method) |
void |
rollback(ExecutionRuntime executionRuntime) |
getApplyMethodName, getRollbackMethodNameequals, getAction, getAuthor, getId, getLoadedChange, getOrder, getRecovery, getSource, getSourceFile, getStageName, getTargetSystem, getTransactionalFlag, hashCode, isAlreadyApplied, isLegacy, isRunAlways, isSystem, isTransactional, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAction, getLoadedChange, getStageName, isAlreadyApplied, isTransactionalpublic CodeExecutableChange(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 void apply(ExecutionRuntime executionRuntime)
public void rollback(ExecutionRuntime executionRuntime)
protected void executeInternal(ExecutionRuntime executionRuntime, java.lang.reflect.Method method)