1 23 package com.sun.enterprise.resource; 24 25 28 public class ResourceState { 29 private boolean enlisted; 30 private boolean busy; 31 private long timestamp; 32 33 36 private boolean isNew = true; 38 39 40 public boolean isEnlisted() { 41 return enlisted; 42 } 43 44 public boolean isUnenlisted() { 45 return !enlisted; 46 } 47 48 public boolean isFree() { 49 return !busy; 50 } 51 52 public void setEnlisted(boolean enlisted) { 53 this.enlisted = enlisted; 54 } 55 56 public boolean isBusy() { 57 return busy; 58 } 59 60 public void setBusy(boolean busy) { 61 this.busy = busy; 62 } 63 64 public long getTimestamp() { 65 return timestamp; 66 } 67 68 public void touchTimestamp() { 69 timestamp = System.currentTimeMillis(); 70 } 71 72 public ResourceState() { 73 touchTimestamp(); 74 } 75 76 public boolean isNew() { 77 return isNew; 78 } 79 80 public void setNotNew() { 83 isNew = false; 84 } 85 86 public String toString() { 87 return "Enlisted :" + enlisted + " Busy :" + busy; 88 } 89 } 90 | Popular Tags |