コード例 #1
0
 protected void logDebugSequencingConnected() {
   Vector[] sequenceVectors = new Vector[NUMBER_OF_STATES];
   Iterator itConnectedSequences = connectedSequences.iterator();
   while (itConnectedSequences.hasNext()) {
     Sequence sequence = (Sequence) itConnectedSequences.next();
     int stateId = getStateId(sequence.shouldUsePreallocation(), sequence.shouldUseTransaction());
     Vector v = sequenceVectors[stateId];
     if (v == null) {
       v = new Vector();
       sequenceVectors[stateId] = v;
     }
     v.addElement(sequence);
   }
   for (int i = 0; i < NUMBER_OF_STATES; i++) {
     Vector v = sequenceVectors[i];
     if (v != null) {
       getOwnerSession()
           .log(SessionLog.FINEST, SessionLog.SEQUENCING, "sequencing_connected", states[i]);
       for (int j = 0; j < v.size(); j++) {
         Sequence sequence = (Sequence) v.elementAt(j);
         Object[] args = {
           sequence.getName(),
           Integer.toString(sequence.getPreallocationSize()),
           Integer.toString(sequence.getInitialValue())
         };
         getOwnerSession()
             .log(SessionLog.FINEST, SessionLog.SEQUENCING, "sequence_without_state", args);
       }
     }
   }
 }
コード例 #2
0
  protected void initializeStates() {
    states = new State[NUMBER_OF_STATES];

    Iterator itConnectedSequences = connectedSequences.iterator();
    while (itConnectedSequences.hasNext()) {
      Sequence sequence = (Sequence) itConnectedSequences.next();
      State state = getState(sequence.shouldUsePreallocation(), sequence.shouldUseTransaction());
      if (state == null) {
        createState(sequence.shouldUsePreallocation(), sequence.shouldUseTransaction());
      }
    }
  }