jdbm.helper
Class ActionVersioning

java.lang.Object
  extended by jdbm.helper.ActionVersioning

public class ActionVersioning
extends Object

This is a helper class to keep track of versions assigned to actions. As client begin read only and read write actions, they call into this class and get the version they can use. As the clients end their actions, minimum read version any action is using is advanced and piggybacked to the client This class assumes that there is one readWrite action at a time.

Author:
Apache Directory Project

Nested Class Summary
static class ActionVersioning.Version
           
 
Constructor Summary
ActionVersioning()
           
 
Method Summary
 ActionVersioning.Version beginReadAction()
          Returns a version that can be used by the read only action
 ActionVersioning.Version beginWriteAction()
          Returns back the new version to be used with the read/write action.
 ActionVersioning.Version endReadAction(ActionVersioning.Version version)
          Called when the read action with the given action is ended.
 ActionVersioning.Version endWriteAction()
          Called when the read/write action completes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionVersioning

public ActionVersioning()
Method Detail

beginWriteAction

public ActionVersioning.Version beginWriteAction()
Returns back the new version to be used with the read/write action. Assume one read/write action at a time.

Returns:
new version for the action system

endWriteAction

public ActionVersioning.Version endWriteAction()
Called when the read/write action completes. Advances the version of action subsystem and publishes a new version for the readers. Assume one read/write action at a time.

Returns:
minimum read version for the action subsystem

beginReadAction

public ActionVersioning.Version beginReadAction()
Returns a version that can be used by the read only action

Returns:
version to be used by the action

endReadAction

public ActionVersioning.Version endReadAction(ActionVersioning.Version version)
Called when the read action with the given action is ended. Checks whether the minimum read version advanced

Parameters:
version - version of the read only action
Returns:
returns the miminum read version. Might return null if read version did not advance for sure.


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.