1 22 package org.jboss.ejb3.test.stateful; 23 24 import javax.ejb.Stateful ; 25 import org.jboss.annotation.ejb.cache.simple.CacheConfig; 26 27 33 @Stateful 34 @CacheConfig(maxSize = 1000, idleTimeoutSeconds = 1) 35 public class SmallCacheStatefulBean implements SmallCacheStateful 36 { 37 private int count; 38 private int id; 39 40 41 public void setId(int id) 42 { 43 this.id = id; 44 } 45 46 47 public int doit(int passedId) 48 { 49 if (passedId != id) throw new RuntimeException (); 50 try 51 { 52 Thread.sleep(3000); 53 } 54 catch (InterruptedException e) 55 { 56 57 } 58 return count++; 59 } 60 } 61 | Popular Tags |