01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.tx;
05:
06: import com.tc.util.Assert;
07:
08: public class WaitInvocationFactory {
09: public WaitInvocation newWaitInvocation(int waitArgCount,
10: long millis, int nanos) {
11: switch (waitArgCount) {
12: case 2: {
13: return new WaitInvocation(millis, nanos);
14: }
15: case 1: {
16: return new WaitInvocation(millis);
17: }
18: case 0: {
19: return new WaitInvocation();
20: }
21: default: {
22: throw Assert.failure("Invalid wait argument count: "
23: + waitArgCount);
24: }
25: }
26: }
27: }
|