Project Wonder 5.0

er.extensions.migration
Interface IERXMigrationLock

All Known Implementing Classes:
ERXJDBCMigrationLock, ERXMemoryMigrationLock

public interface IERXMigrationLock

Because you might be running with multiple instances, there needs to be a locking mechanism that is higher level than just a db context lock. IERXMigrationLock is a simple interface for accessing and locking information about the migration process.

Author:
mschrag

Method Summary
 void setVersionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model, int versionNumber)
          Sets the current version number of the named model.
 boolean tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model, java.lang.String lockOwnerName)
          Attempts to retrieve a lock on the migration process for the named model.
 void unlock(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model)
          Unlocks the given model.
 int versionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model)
          Returns the current version number of the named model.
 

Method Detail

versionNumber

int versionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
                  com.webobjects.eoaccess.EOModel model)
Returns the current version number of the named model.

Parameters:
channel - the adaptor channel associated with this process
model - the model to lookup version information on
Returns:
the current version number of the named model

setVersionNumber

void setVersionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
                      com.webobjects.eoaccess.EOModel model,
                      int versionNumber)
Sets the current version number of the named model.

Parameters:
channel - the adaptor channel associated with this process
model - the model to set version information on
versionNumber - the new version number

tryLock

boolean tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel,
                com.webobjects.eoaccess.EOModel model,
                java.lang.String lockOwnerName)
Attempts to retrieve a lock on the migration process for the named model. A lockOwnerName is provided that provides a simple mechanism to recover from a stale lock. If the lock owner name passed in matches the current lock owner name, then the lock is acquired.

Parameters:
channel - the adaptor channel associated with this process
model - the model to try to lock
lockOwnerName - the name of the lock owner
Returns:
true if the lock was acquired, false if it was not

unlock

void unlock(com.webobjects.eoaccess.EOAdaptorChannel channel,
            com.webobjects.eoaccess.EOModel model)
Unlocks the given model. This should only be called if you acquired a lock with tryLock(..).

Parameters:
channel - the adaptor channel associated with this process
model - the model to unlock

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.