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