com.ptc.windchill.upgrade.ius
Class UpdateRunner
java.lang.Object
com.ptc.windchill.upgrade.ius.UpdateRunner
- All Implemented Interfaces:
- Runnable
- public final class UpdateRunner
- extends Object
- implements Runnable
Supported API: false
Extendable: false
CLASSNAME
private static final String CLASSNAME
DEBUG
private static final boolean DEBUG
LOG
private static final DebugWriter LOG
INIT_DIRECTIVE_CLASS_METHOD_NAME
private static final String INIT_DIRECTIVE_CLASS_METHOD_NAME
- See Also:
- Constant Field Values
CORE_UPDATE_RESOURCE
private static final String CORE_UPDATE_RESOURCE
ACCESS_CONTROL_PROPERTY_NAME
private static final String ACCESS_CONTROL_PROPERTY_NAME
- See Also:
- Constant Field Values
upgradeContext_
private UpgradeContext upgradeContext_
applicabilityModel_
private ApplicabilitySnapshotModel applicabilityModel_
directiveServices_
private UpdateRunner.DirectiveServicesAdapter directiveServices_
singleThreadLock_
private Object singleThreadLock_
listener_
private transient UpdateRunnerListener listener_
finished_
private boolean finished_
pauseRequested_
private boolean pauseRequested_
isPaused_
private boolean isPaused_
hasEnded_
private boolean hasEnded_
cancellationMonitor_
private CancellationMonitor cancellationMonitor_
numberOfSkippedOrFailedUpdates_
private int numberOfSkippedOrFailedUpdates_
numberOfExecutedUpdates_
private int numberOfExecutedUpdates_
UpdateRunner
public UpdateRunner(ApplicabilitySnapshotModel applicability_model)
throws InvocationTargetException,
IllegalAccessException,
NoSuchMethodException
finalize
protected void finalize()
throws Throwable
- Throws:
Throwable
addUpdateRunnerListener
public void addUpdateRunnerListener(UpdateRunnerListener new_listener)
setCancellationMonitor
public void setCancellationMonitor(CancellationMonitor cancel_monitor)
removeUpdateRunnerListener
public void removeUpdateRunnerListener(UpdateRunnerListener listener_to_remove)
hasEnded
public boolean hasEnded()
- Request that the runner stop prematurely.
This method will return immediately.The caller can determine when
the runner has finally stopped by asking
hasEnded
or
registering as a listener and waiting for the runnerAborted
,
runnerCanceled
, or runnerCompleted
messages.
If the runner has already completed or is done with its work
before the request is received, it will not reply true
to
wasCanceled()
.
run
public void run()
- Specified by:
run
in interface Runnable
initializeInstalledDirectiveClasses
public void initializeInstalledDirectiveClasses()
throws UpdateRunnerException
- Throws:
UpdateRunnerException
executeAllUpdatesIn
private void executeAllUpdatesIn(List update_sequence)
throws SQLException,
RunnerCanceledException
- Throws:
SQLException
RunnerCanceledException
alterNLSDateFormat
private int alterNLSDateFormat(Connection jdbc_connection)
throws Exception
- Throws:
Exception
checkForCancellation
private void checkForCancellation()
throws RunnerCanceledException
- If a cancel was requested, mark the state of the runner as canceled and throw the exception.
- Throws:
CanceledException
- if a cancel was requested
RunnerCanceledException
applyUpdate
private void applyUpdate(IncrementalUpdate update)
throws RunnerCanceledException
- Throws:
CanceledException
- if a cancel was requested and detected prior to the commit of the work.A cancel request that comes after the commit is not detected and handled in this method.It is the responsibility of the caller to decide what to do.
RunnerCanceledException
allDependedUponUpdatesHaveRun
private boolean allDependedUponUpdatesHaveRun(UUID uuid)
throws IUHException
- Confirms that all the incremental updates that this update depends upon have been applied.
- Throws:
IUHException
fireLogMessageIssued
protected void fireLogMessageIssued(UpdateRunnerLogEvent event)
fireRunnerStarted
protected void fireRunnerStarted(UpdateRunnerEvent event)
fireRunnerAborted
protected void fireRunnerAborted(UpdateRunnerEvent event)
fireRunnerCanceled
protected void fireRunnerCanceled(UpdateRunnerEvent event)
fireRunnerCompleted
protected void fireRunnerCompleted(UpdateRunnerEvent event)
fireUpdateProcessingSkippedPredecessorsNotRun
protected void fireUpdateProcessingSkippedPredecessorsNotRun(IncrementalUpdateProcessingEvent event)
fireUpdateProcessingStarted
protected void fireUpdateProcessingStarted(IncrementalUpdateProcessingEvent event)
fireUpdateProcessingSucceeded
protected void fireUpdateProcessingSucceeded(IncrementalUpdateProcessingEvent event)
fireUpdateProcessingFailed
protected void fireUpdateProcessingFailed(IncrementalUpdateProcessingEvent event)
fireUpdateProcessingExecuted
protected void fireUpdateProcessingExecuted(IncrementalUpdateProcessingEvent event)
applicabilityModel
private ApplicabilitySnapshotModel applicabilityModel()
upgradeContext
private UpgradeContext upgradeContext()
getInstallAndUpgradeHistory
private InstallAndUpgradeHistory getInstallAndUpgradeHistory()
directiveServices
private UpdateRunner.DirectiveServicesAdapter directiveServices()
getOutcome
public boolean getOutcome()
- Answer true if a cancel was requested.
When a cancel is requested, the runner will abort the entire run after the completion
of the currently running incremental update.It will not mark the current incremental
as update complete.
- See Also:
#cancel
,
#wasCanceled
numberOfSkippedOrFailedUpdates
public int numberOfSkippedOrFailedUpdates()
numberOfExecutedUpdates
public int numberOfExecutedUpdates()
incrementNumberOfSkippedOrFailedUpdates
private void incrementNumberOfSkippedOrFailedUpdates()
incrementNumberOfExecutedUpdates
private void incrementNumberOfExecutedUpdates()
resetNumberOfSkippedOrFailedUpdates
private void resetNumberOfSkippedOrFailedUpdates()
recompileInvalidObjects
private void recompileInvalidObjects()
throws Exception
- Throws:
Exception
executeSqlUpdate
private void executeSqlUpdate(String sql,
Connection connection)
throws SQLException
- Throws:
SQLException
runPreUpdateHook
private void runPreUpdateHook()
runPostUpdateHook
private void runPostUpdateHook()
runUpdateHook
private void runUpdateHook(String type)