KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > thread > BoundedQueue


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.thread;
17
18 /**
19  * Efficient array-based bounded buffer class. Adapted from CPJ, chapter 8,
20  * which describes design.
21  *
22  * <p>
23  * [<a
24  * HREF="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html">
25  * Introduction to this package. </a>]
26  * </p>
27  *
28  * <p></p>
29  */

30 public class BoundedQueue
31     extends EDU.oswego.cs.dl.util.concurrent.BoundedBuffer
32     implements Queue
33 {
34     //~ Constructors -----------------------------------------------------------
35

36     /**
37      * Create a buffer with the current default capacity
38      */

39     public BoundedQueue( )
40     {
41         super( );
42     }
43
44     /**
45      * Create a BoundedQueue with the given capacity.
46      *
47      * @param capacity The capacity
48      *
49      * @exception IllegalArgumentException if capacity less or equal to zero
50      */

51     public BoundedQueue( int capacity )
52         throws IllegalArgumentException JavaDoc
53     {
54         super( capacity );
55     }
56
57     //~ Methods ----------------------------------------------------------------
58

59     /**
60      * DOCUMENT ME!
61      *
62      * @return current size of queue.
63      */

64     public int getQueueSize( )
65     {
66         return usedSlots_;
67     }
68 }
69
Popular Tags