1 10 11 package org.mule.util; 12 13 16 public interface ObjectPool 17 { 18 21 static final int WHEN_EXHAUSTED_FAIL = 0; 22 static final int WHEN_EXHAUSTED_BLOCK = 1; 23 static final int WHEN_EXHAUSTED_GROW = 2; 24 25 static final int DEFAULT_MAX_SIZE = 5; 26 static final int DEFAULT_MAX_WAIT = 4000; 27 static final int DEFAULT_EXHAUSTED_ACTION = WHEN_EXHAUSTED_BLOCK; 28 29 Object borrowObject() throws Exception ; 30 31 void returnObject(Object object) throws Exception ; 32 33 int getSize(); 34 35 int getMaxSize(); 36 37 void setFactory(ObjectFactory factory); 38 39 void clearPool(); 40 41 void start() throws Exception ; 42 43 void stop() throws Exception ; 44 45 void onAdd(Object obj); 46 47 void onRemove(Object obj); 48 49 } 50 | Popular Tags |