1 /*******************************************************************************
2 * Copyright 2012 Fat Cat
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 com
.assembla
.ariane
.jellyfish
.util
.collections
.client
;
18 import com
.assembla
.ariane
.jellyfish
.util
.collections
.queue
.JellyfishQueue
;
19 import com
.assembla
.ariane
.jellyfish
.main
.JellyfishConstants
;
20 import com
.assembla
.ariane
.jellyfish
.proxy
.messages
.requests
.ProxyRequestMessage
;
21 import com
.assembla
.ariane
.jellyfish
.proxy
.messages
.response
.ProxyResponseMessage
;
22 import org
.slf4j
.LoggerFactory
;
25 * This class implements an queue of http client requests.
30 public final class ClientMessageQueue
extends JellyfishQueue
< ProxyRequestMessage
, ProxyResponseMessage
>
34 private static final ClientMessageQueue inst
= new ClientMessageQueue( );
37 * Method to return this singleton.
38 * @return The singleton.
40 public static ClientMessageQueue
instance( )
42 return ClientMessageQueue
.inst
;
46 * Private constructor to create a new queue.
48 private ClientMessageQueue( )
51 this.logger
= LoggerFactory
.getLogger( ClientMessageQueue
.class );
55 * Method that returns the size of the request queue.
56 * @return The size of the request queue (1024).
57 * @see com.assembla.ariane.jellyfish.util.collections.queue.JellyfishQueue#sendSize()
60 protected int sendSize( )
62 return JellyfishConstants
.DEFAULT_QUEUE_SIZE
;
66 * Method that returns the size of the response queue.
67 * @return The size of the response queue (1024).
68 * @see com.assembla.ariane.jellyfish.util.collections.queue.JellyfishQueue#receiveSize()
71 protected int receiveSize( )
73 return JellyfishConstants
.DEFAULT_QUEUE_SIZE
;