Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Queue |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
3 | * The software in this package is published under the terms of the CPAL v1.0 | |
4 | * license, a copy of which has been included with this distribution in the | |
5 | * LICENSE.txt file. | |
6 | */ | |
7 | package org.mule.util.queue; | |
8 | ||
9 | /** | |
10 | * <code>Queue</code> TODO | |
11 | */ | |
12 | public interface Queue | |
13 | { | |
14 | ||
15 | /** | |
16 | * Returns the number of elements in this queue. | |
17 | */ | |
18 | int size(); | |
19 | ||
20 | /** | |
21 | * Puts a new object in this queue and wait if necessary. | |
22 | * | |
23 | * @param o the object to put | |
24 | */ | |
25 | void put(Object o) throws InterruptedException; | |
26 | ||
27 | /** | |
28 | * Blocks and retrieves an object from this queue. | |
29 | * | |
30 | * @return an object. | |
31 | */ | |
32 | Object take() throws InterruptedException; | |
33 | ||
34 | void untake(Object item) throws InterruptedException; | |
35 | ||
36 | Object peek() throws InterruptedException; | |
37 | ||
38 | Object poll(long timeout) throws InterruptedException; | |
39 | ||
40 | boolean offer(Object o, long timeout) throws InterruptedException; | |
41 | ||
42 | String getName(); | |
43 | } |