1 25 26 package org.objectweb.easybeans.jca.workmanager; 27 28 import javax.resource.spi.work.ExecutionContext ; 29 import javax.resource.spi.work.Work ; 30 import javax.resource.spi.work.WorkListener ; 31 32 import org.objectweb.easybeans.log.JLog; 33 import org.objectweb.easybeans.log.JLogFactory; 34 35 41 public class ResourceWork { 42 43 46 private static JLog logger = JLogFactory.getLog(ResourceWorkThread.class); 47 48 51 private Work work; 52 53 56 private long timeout; 57 58 61 private ExecutionContext executionContext; 62 63 67 private WorkListener workListener; 68 69 72 private long creationTime; 73 74 77 private boolean started = false; 78 79 86 @SuppressWarnings ("boxing") 87 public ResourceWork(final Work work, final long timeout, final ExecutionContext executionContext, 88 final WorkListener workListener) { 89 this.work = work; 90 this.timeout = timeout; 91 this.executionContext = executionContext; 92 this.workListener = workListener; 93 creationTime = System.currentTimeMillis(); 94 if (logger.isDebugEnabled()) { 95 logger.debug("Timeout value is {0}", timeout); 96 } 97 } 98 99 102 public Work getWork() { 103 return work; 104 } 105 106 109 public long getTimeout() { 110 return timeout; 111 } 112 113 116 public ExecutionContext getExecutionContext() { 117 return executionContext; 118 } 119 120 123 public WorkListener getWorkListener() { 124 return workListener; 125 } 126 127 130 public long getCreationTime() { 131 return creationTime; 132 } 133 134 137 public boolean isStarted() { 138 return started; 139 } 140 141 144 public void setStarted() { 145 started = true; 146 } 147 } 148 | Popular Tags |