1 17 18 package org.apache.geronimo.connector; 19 20 import javax.resource.spi.work.ExecutionContext ; 21 import javax.resource.spi.work.Work ; 22 import javax.resource.spi.work.WorkException ; 23 import javax.resource.spi.work.WorkListener ; 24 import javax.resource.spi.work.WorkManager ; 25 26 31 public class MockWorkManager 32 implements WorkManager { 33 34 private String id = null; 35 36 37 public MockWorkManager(String id) { 38 this.id = id; 39 } 40 41 public void doWork(Work work) throws WorkException { 42 } 43 44 public void doWork(Work work, 45 long startTimeout, 46 ExecutionContext execContext, 47 WorkListener workListener) 48 throws WorkException { 49 } 50 51 public void scheduleWork(Work work) throws WorkException { 52 } 53 54 public void scheduleWork(Work work, 55 long startTimeout, 56 ExecutionContext execContext, 57 WorkListener workListener) 58 throws WorkException { 59 } 60 61 public long startWork(Work work) throws WorkException { 62 return -1; 63 } 64 65 public long startWork(Work work, 66 long startTimeout, 67 ExecutionContext execContext, 68 WorkListener workListener) 69 throws WorkException { 70 return -1; 71 } 72 73 public String getId() { 74 return id; 75 } 76 77 public boolean equals(WorkManager wm) { 78 if (!(wm instanceof MockWorkManager)) { 79 return false; 80 } 81 82 return ((MockWorkManager) wm).getId() != null && 83 ((MockWorkManager) wm).getId().equals(getId()); 84 } 85 86 } 87 | Popular Tags |