1 23 24 package javax.resource.spi; 25 26 import javax.resource.ResourceException ; 27 import java.util.EventObject ; 28 29 57 58 public class ConnectionEvent extends java.util.EventObject { 59 60 63 public static final int CONNECTION_CLOSED = 1; 64 65 68 public static final int LOCAL_TRANSACTION_STARTED = 2; 69 70 73 public static final int LOCAL_TRANSACTION_COMMITTED = 3; 74 75 78 public static final int LOCAL_TRANSACTION_ROLLEDBACK = 4; 79 80 84 public static final int CONNECTION_ERROR_OCCURRED = 5; 85 86 87 92 private Exception exception; 93 94 96 protected int id; 97 98 private Object connectionHandle; 99 100 107 public ConnectionEvent(ManagedConnection source, int eid) { 108 super(source); 109 this.id = eid; 110 } 111 112 120 public ConnectionEvent(ManagedConnection source, int eid, 121 Exception exception) { 122 super(source); 123 this.exception = exception; 124 this.id = eid; 125 } 126 127 132 public Object getConnectionHandle() { 133 return connectionHandle; 134 } 135 136 139 public void setConnectionHandle(Object connectionHandle) { 140 this.connectionHandle = connectionHandle; 141 } 142 143 144 149 public Exception getException() { 150 return exception; 151 } 152 153 156 public 157 int getId() { 158 return id; 159 } 160 } 161 162 163 164 165 166 | Popular Tags |