01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.l2.state;
05:
06: import com.tc.l2.ha.WeightGeneratorFactory;
07: import com.tc.net.groups.NodeID;
08:
09: public class EnrollmentFactory {
10:
11: public static Enrollment createEnrollment(NodeID nodeID,
12: boolean isNew, WeightGeneratorFactory weightFactory) {
13: long[] weights = weightFactory.generateWeightSequence();
14: Enrollment e = new Enrollment(nodeID, isNew, weights);
15: return e;
16: }
17:
18: public static Enrollment createTrumpEnrollment(NodeID myNodeId,
19: WeightGeneratorFactory weightFactory) {
20: long[] weights = weightFactory.generateMaxWeightSequence();
21: Enrollment e = new Enrollment(myNodeId, false, weights);
22: return e;
23: }
24:
25: }
|