1 8 package ersatz.resourceadapter; 9 10 import javax.resource.spi.work.WorkEvent; 11 import javax.resource.spi.work.WorkAdapter; 12 import javax.resource.spi.work.WorkException; 13 14 24 public class WorkAdapterImpl extends WorkAdapter 25 { 26 String cName = "WorkAdapterImpl"; 27 WorkImpl wi; 28 WorkException wex; 29 37 38 public void workStarted(WorkEvent e) 39 { 40 wex=e.getException(); 41 if (wex==null) { 42 wi=(WorkImpl)e.getWork(); 44 Utility.log(cName+".workStarted for WorkEvent Work content=" 45 +wi.getWorkType()+", "+e.getType()); 46 } else { 47 Utility.log(cName+".workStarted WorkException="+wex); 48 } 49 } 50 public void workAccepted(WorkEvent e) 51 { 52 wex=e.getException(); 53 if (wex==null) { 54 wi=(WorkImpl)e.getWork(); 56 Utility.log(cName+".workAccepted for WorkEvent Work content=" 57 +wi.getWorkType()+", "+e.getType()); 58 } else { 59 Utility.log(cName+".workAccepted WorkException="+wex); 60 } 61 } 62 public void workRejected(WorkEvent e) 63 { 64 wex=e.getException(); 65 if (wex==null) { 66 wi=(WorkImpl)e.getWork(); 68 Utility.log(cName+".workRejected for WorkEvent Work content=" 69 +wi.getWorkType()+", "+e.getType()); 70 } else { 71 Utility.log(cName+".workRejected WorkException="+wex); 72 } 73 } 74 public void workCompleted(WorkEvent e) 75 { 76 wex=e.getException(); 77 if (wex==null) { 78 wi=(WorkImpl)e.getWork(); 80 Utility.log(cName+".workCompleted for WorkEvent Work content=" 81 +wi.getWorkType()+", "+e.getType()); 82 } else { 83 Utility.log(cName+".workCompleted WorkException="+wex); 84 } 85 } 86 } | Popular Tags |