FileDocCategorySizeDatePackage
PreallocationHandler.javaAPI DocGlassfish v2 API3834Tue May 22 16:54:42 BST 2007oracle.toplink.essentials.internal.sequencing

PreallocationHandler

public class PreallocationHandler extends Object implements SequencingLogInOut

Fields Summary
protected Hashtable
preallocatedSequences
Constructors Summary
public PreallocationHandler()

        super();
    
Methods Summary
public java.util.VectorgetPreallocated(java.lang.String seqName)

        return getPreallocatedSequences(seqName);
    
protected java.util.VectorgetPreallocatedSequences(java.lang.String seqName)
PROTECTED: return a vector from the global sequences based on seqName. If there is not one, put it there.

        Vector sequencesForName;
        synchronized (preallocatedSequences) {
            sequencesForName = (Vector)preallocatedSequences.get(seqName);
            if (sequencesForName == null) {
                sequencesForName = new Vector();
                preallocatedSequences.put(seqName, sequencesForName);
            }
        }
        return sequencesForName;
    
public voidinitializePreallocated()

        preallocatedSequences = new Hashtable(20);
    
public voidinitializePreallocated(java.lang.String seqName)

        preallocatedSequences.remove(seqName);
    
public booleanisConnected()

        return preallocatedSequences != null;
    
public voidonConnect()

        initializePreallocated();
    
public voidonDisconnect()

        preallocatedSequences = null;
    
public voidsetPreallocated(java.lang.String seqName, java.util.Vector sequences)

        getPreallocatedSequences(seqName).addAll(sequences);