Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.descriptors
Class TimestampLockingPolicy

java.lang.Object
  extended byoracle.toplink.descriptors.VersionLockingPolicy
      extended byoracle.toplink.descriptors.TimestampLockingPolicy

All Implemented Interfaces:
java.lang.Cloneable, oracle.toplink.internal.descriptors.OptimisticLockingPolicy, java.io.Serializable

public class TimestampLockingPolicy
extends VersionLockingPolicy

Purpose: Used to allow a single version timestamp to be used for optimistic locking.

Since:
TOPLink/Java 2.0
See Also:
Serialized Form

Field Summary
static int LOCAL_TIME
static int SERVER_TIME

Fields inherited from class oracle.toplink.descriptors.VersionLockingPolicy
IN_CACHE, IN_OBJECT

Constructor Summary
TimestampLockingPolicy()
PUBLIC: Create a new TimestampLockingPolicy.
TimestampLockingPolicy(java.lang.String fieldName)
PUBLIC: Create a new TimestampLockingPolicy.

Method Summary
void setUsesServerTime(boolean usesServerTime)
PUBLIC: Set if policy uses server time.
void useLocalTime()
PUBLIC: set this policy to get the time from the local machine.
void useServerTime()
PUBLIC: set this policy to get the time from the server.
boolean usesLocalTime()
PUBLIC: Return true if policy uses local time.
boolean usesServerTime()
PUBLIC: Return true if policy uses server time.

Methods inherited from class oracle.toplink.descriptors.VersionLockingPolicy
getWriteLockFieldName, isStoredInCache, isStoredInObject, setIsStoredInCache, setWriteLockFieldName, storeInCache, storeInObject

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

SERVER_TIME

public static final int SERVER_TIME
See Also:
Constant Field Values

LOCAL_TIME

public static final int LOCAL_TIME
See Also:
Constant Field Values

Constructor Detail

TimestampLockingPolicy

public TimestampLockingPolicy()
PUBLIC: Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.

TimestampLockingPolicy

public TimestampLockingPolicy(java.lang.String fieldName)
PUBLIC: Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.
Parameters:
fieldName - the field where the write lock value will be stored.

Method Detail

setUsesServerTime

public void setUsesServerTime(boolean usesServerTime)
PUBLIC: Set if policy uses server time.

useLocalTime

public void useLocalTime()
PUBLIC: set this policy to get the time from the local machine.

useServerTime

public void useServerTime()
PUBLIC: set this policy to get the time from the server.

usesLocalTime

public boolean usesLocalTime()
PUBLIC: Return true if policy uses local time.

usesServerTime

public boolean usesServerTime()
PUBLIC: Return true if policy uses server time.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.