Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sequencing

pack-priv Class PreallocationHandler

extends Object
implements SequencingLogInOut
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.internal.sequencing.SequencingLogInOut
Imports
java.util.*, java.util.concurrent.*

Handles the storage and allocation of sequence values. This is held by the session (ServerSession) through the SequencingManager.
See Also
SequencingManager

Field Summary

Modifier and TypeField and Description
protected Map<String, Queue<Object>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Queue<Object>
getPreallocated(String sequenceName)

Returns the Queue of sequences from the global sequences for the seqName.

public void
initializePreallocated()

Removes all preallocated objects.

public void
initializePreallocated(String seqName)

Removes all preallocated objects for the specified seqName.

public boolean
isConnected()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.isConnected.

INTERNAL: Indicates whether the object is connected or not.
public void
onConnect()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onConnect.

INTERNAL: Called when the object is connected (logged in).
public void
onDisconnect()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onDisconnect.

INTERNAL: Called when the object is disconnected (logged out).
public void
setPreallocated(String seqName, Vector<?> sequences)

Add the preallocated sequences to the global sequence pool for the sequence name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

preallocatedSequencesback to summary
protected Map<String, Queue<Object>> preallocatedSequences

Constructor Detail

PreallocationHandlerback to summary
public PreallocationHandler()

Method Detail

getPreallocatedback to summary
public Queue<Object> getPreallocated(String sequenceName)

Returns the Queue of sequences from the global sequences for the seqName. If there is not one, a new empty Queue is registered. This queue is thread-safe, and threads can concurrent poll the queue to remove the first element.

initializePreallocatedback to summary
public void initializePreallocated()

Removes all preallocated objects. A dangerous method to use in multithreaded environment method, but so handy for testing.

initializePreallocatedback to summary
public void initializePreallocated(String seqName)

Removes all preallocated objects for the specified seqName. A dangerous method to use in multithreaded environment method, but so handy for testing.

isConnectedback to summary
public boolean isConnected()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.isConnected.

Doc from org.eclipse.persistence.internal.sequencing.SequencingLogInOut.isConnected.

INTERNAL: Indicates whether the object is connected or not.

Annotations
@Override
onConnectback to summary
public void onConnect()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onConnect.

Doc from org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onConnect.

INTERNAL: Called when the object is connected (logged in).

Annotations
@Override
onDisconnectback to summary
public void onDisconnect()

Implements org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onDisconnect.

Doc from org.eclipse.persistence.internal.sequencing.SequencingLogInOut.onDisconnect.

INTERNAL: Called when the object is disconnected (logged out).

Annotations
@Override
setPreallocatedback to summary
public void setPreallocated(String seqName, Vector<?> sequences)

Add the preallocated sequences to the global sequence pool for the sequence name. Although this method is thread-safe, a lock should typically be obtained from the sequence manager before calling this method, to ensure sequential numbers.