Project Wonder 5.0

er.extensions.migration
Class ERXMemoryMigrationLock

java.lang.Object
  extended by er.extensions.migration.ERXMemoryMigrationLock
All Implemented Interfaces:
IERXMigrationLock

public class ERXMemoryMigrationLock
extends java.lang.Object
implements IERXMigrationLock

This stub exists to make memory migrations work.

Author:
mschrag

Constructor Summary
ERXMemoryMigrationLock()
           
 
Method Summary
protected  int initialVersionForModel(com.webobjects.eoaccess.EOModel model)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXMemoryMigrationLock

public ERXMemoryMigrationLock()
Method Detail

setVersionNumber

public void setVersionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
                             com.webobjects.eoaccess.EOModel model,
                             int versionNumber)
Description copied from interface: IERXMigrationLock
Sets the current version number of the named model.

Specified by:
setVersionNumber in interface IERXMigrationLock
Parameters:
channel - the adaptor channel associated with this process
model - the model to set version information on
versionNumber - the new version number

tryLock

public boolean tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel,
                       com.webobjects.eoaccess.EOModel model,
                       java.lang.String lockOwnerName)
Description copied from interface: IERXMigrationLock
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.

Specified by:
tryLock in interface IERXMigrationLock
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

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

Specified by:
unlock in interface IERXMigrationLock
Parameters:
channel - the adaptor channel associated with this process
model - the model to unlock

versionNumber

public int versionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
                         com.webobjects.eoaccess.EOModel model)
Description copied from interface: IERXMigrationLock
Returns the current version number of the named model.

Specified by:
versionNumber in interface IERXMigrationLock
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

initialVersionForModel

protected int initialVersionForModel(com.webobjects.eoaccess.EOModel model)

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

Copyright © 2002 – 2007 Project Wonder.