Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change value modifier to make StandardLockService extendable for future extension #2785

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
import static java.util.ResourceBundle.getBundle;

public class StandardLockService implements LockService {
private static ResourceBundle coreBundle = getBundle("liquibase/i18n/liquibase-core");
protected static final ResourceBundle coreBundle = getBundle("liquibase/i18n/liquibase-core");

protected Database database;

protected boolean hasChangeLogLock;

private Long changeLogLockPollRate;
private Long changeLogLockRecheckTime;
protected Long changeLogLockPollRate;
protected Long changeLogLockRecheckTime;

private Boolean hasDatabaseChangeLogLockTable;
private boolean isDatabaseChangeLogLockTableInitialized;
private ObjectQuotingStrategy quotingStrategy;
private final SecureRandom random = new SecureRandom();
protected Boolean hasDatabaseChangeLogLockTable;
protected boolean isDatabaseChangeLogLockTableInitialized;
protected ObjectQuotingStrategy quotingStrategy;
protected final SecureRandom random = new SecureRandom();


public StandardLockService() {
Expand All @@ -70,7 +70,7 @@ public void setDatabase(Database database) {
this.database = database;
}

public Long getChangeLogLockWaitTime() {
protected Long getChangeLogLockWaitTime() {
if (changeLogLockPollRate != null) {
return changeLogLockPollRate;
}
Expand All @@ -82,7 +82,7 @@ public void setChangeLogLockWaitTime(long changeLogLockWaitTime) {
this.changeLogLockPollRate = changeLogLockWaitTime;
}

public Long getChangeLogLockRecheckTime() {
protected Long getChangeLogLockRecheckTime() {
if (changeLogLockRecheckTime != null) {
return changeLogLockRecheckTime;
}
Expand Down Expand Up @@ -187,7 +187,7 @@ public boolean isDatabaseChangeLogLockTableInitialized(final boolean tableJustCr
* Determine whether the databasechangeloglock table has been initialized.
* @param forceRecheck if true, do not use any cached information, and recheck the actual database
*/
private boolean isDatabaseChangeLogLockTableInitialized(final boolean tableJustCreated, final boolean forceRecheck) {
protected boolean isDatabaseChangeLogLockTableInitialized(final boolean tableJustCreated, final boolean forceRecheck) {
if (!isDatabaseChangeLogLockTableInitialized || forceRecheck) {
Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database);

Expand Down Expand Up @@ -222,7 +222,7 @@ public boolean hasChangeLogLock() {
* Check whether the databasechangeloglock table exists in the database.
* @param forceRecheck if true, do not use any cached information and check the actual database
*/
private boolean hasDatabaseChangeLogLockTable(boolean forceRecheck) {
protected boolean hasDatabaseChangeLogLockTable(boolean forceRecheck) {
if (forceRecheck || hasDatabaseChangeLogLockTable == null) {
try {
hasDatabaseChangeLogLockTable = SnapshotGeneratorFactory.getInstance()
Expand All @@ -234,7 +234,7 @@ private boolean hasDatabaseChangeLogLockTable(boolean forceRecheck) {
return hasDatabaseChangeLogLockTable;
}

public boolean hasDatabaseChangeLogLockTable() throws DatabaseException {
protected boolean hasDatabaseChangeLogLockTable() throws DatabaseException {
return hasDatabaseChangeLogLockTable(false);
}

Expand Down Expand Up @@ -331,6 +331,7 @@ public boolean acquireLock() throws LockException {
try {
database.rollback();
} catch (DatabaseException e) {

}
}

Expand Down