01: /*
02: * Created on 10.06.2005
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package de.schlund.pfixxml.perflogging;
08:
09: import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
10:
11: /**
12: * @author jh
13: *
14: */
15: class BoundedBufferWrapper {
16: private BoundedBuffer boundedBuffer;
17: private int size;
18: private int ms;
19:
20: /**
21: *
22: */
23: /**
24: *
25: */
26: BoundedBufferWrapper(int size, int ms) {
27: this .size = size;
28: this .ms = ms;
29: }
30:
31: boolean offer(Object arg) throws InterruptedException {
32: return boundedBuffer.offer(arg, ms);
33: }
34:
35: Object take() throws InterruptedException {
36: return boundedBuffer.take();
37: }
38:
39: void init() {
40: boundedBuffer = new BoundedBuffer(size);
41: }
42:
43: void reset() {
44: boundedBuffer = null;
45: }
46:
47: int size() {
48: return boundedBuffer.size();
49: }
50: }
|