1 5 package snaq.util; 6 7 import java.util.*; 8 9 13 public class ObjectPoolEvent extends EventObject 14 { 15 public static final int CHECKOUT = 1; 16 public static final int CHECKIN = 2; 17 public static final int MAX_POOL_LIMIT_REACHED = 3; 18 public static final int MAX_POOL_LIMIT_EXCEEDED = 4; 19 public static final int MAX_SIZE_LIMIT_REACHED = 5; 20 public static final int MAX_SIZE_LIMIT_ERROR = 6; 21 public static final int PARAMETERS_CHANGED = 7; 22 public static final int POOL_RELEASED = 8; 23 24 private int index, type; 25 26 27 30 public ObjectPoolEvent(ObjectPool pool, int type) 31 { 32 super(pool); 33 this.type = type; 34 } 35 36 39 public ObjectPool getPool() { return (ObjectPool)getSource(); } 40 41 44 public int getType() { return type; } 45 46 49 64 65 public boolean isPoolCheckOut() { return type == CHECKOUT; } 66 public boolean isPoolCheckIn() { return type == CHECKIN; } 67 public boolean isMaxPoolLimitReached() { return type == MAX_POOL_LIMIT_REACHED; } 68 public boolean isMaxPoolLimitExceeded() { return type == MAX_POOL_LIMIT_EXCEEDED; } 69 public boolean isMaxSizeLimitReached() { return type == MAX_SIZE_LIMIT_REACHED; } 70 public boolean isMaxSizeLimitError() { return type == MAX_SIZE_LIMIT_ERROR; } 71 public boolean isPoolParametersChanged() { return type == PARAMETERS_CHANGED; } 72 public boolean isPoolReleased() { return type == POOL_RELEASED; } 73 } | Popular Tags |