KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > tx > WaitInvocationFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.tx;
5
6 import com.tc.util.Assert;
7
8 public class WaitInvocationFactory {
9   public WaitInvocation newWaitInvocation(int waitArgCount, long millis, int nanos) {
10     switch (waitArgCount) {
11       case 2: {
12         return new WaitInvocation(millis, nanos);
13       }
14       case 1: {
15         return new WaitInvocation(millis);
16       }
17       case 0: {
18         return new WaitInvocation();
19       }
20       default: {
21         throw Assert.failure("Invalid wait argument count: " + waitArgCount);
22       }
23     }
24   }
25 }
Popular Tags