1 23 24 package com.sun.enterprise.connectors.work; 25 26 import javax.resource.spi.work.ExecutionContext ; 27 import javax.resource.spi.work.Work ; 28 import javax.resource.spi.work.WorkListener ; 29 import java.util.logging.*; 30 import com.sun.logging.LogDomains; 31 32 37 public class OneWork implements com.sun.corba.ee.spi.orbutil.threadpool.Work { 38 39 private Work work; 40 private WorkCoordinator coordinator; 41 private long nqTime; 42 private static Logger logger = 43 LogDomains.getLogger(LogDomains.RSR_LOGGER); 44 45 51 OneWork (Work work, WorkCoordinator coordinator) { 52 this.work = work; 53 this.coordinator = coordinator; 54 } 55 56 59 public void doWork() { 60 coordinator.preInvoke(); 61 if (coordinator.proceed()) { 62 try { 63 work.run(); 64 } catch (Throwable t) { 65 coordinator.setException(t); 66 } 67 } 68 coordinator.postInvoke(); 69 } 70 71 76 public void setEnqueueTime(long tme) { 77 this.nqTime = tme; 78 } 79 80 85 public long getEnqueueTime() { 86 return nqTime; 87 } 88 89 94 public String getName() { 95 return "Resource adapter work"; 96 } 97 98 103 public String toString () { 104 return (work.toString()); 105 } 106 } 107 | Popular Tags |