Added the initial files from ariane jellyfish
[ariane.git] / ariane-old-core / src / main / java / com / assembla / ariane / jellyfish / util / collections / client / ClientMessageQueue.java
blob4529afcf170a45e1f9279ffad814a6db3c60b6e2
1 /*******************************************************************************
2 * Copyright 2012 Fat Cat
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 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;
24 /**
25 * This class implements an queue of http client requests.
26 * @author Fat Cat
27 * @version 2
28 * @since 0.0.1
30 public final class ClientMessageQueue extends JellyfishQueue< ProxyRequestMessage, ProxyResponseMessage >
33 /** The singleton. */
34 private static final ClientMessageQueue inst = new ClientMessageQueue( );
36 /**
37 * Method to return this singleton.
38 * @return The singleton.
40 public static ClientMessageQueue instance( )
42 return ClientMessageQueue.inst;
45 /**
46 * Private constructor to create a new queue.
48 private ClientMessageQueue( )
50 super( );
51 this.logger = LoggerFactory.getLogger( ClientMessageQueue.class );
54 /**
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()
59 @Override( )
60 protected int sendSize( )
62 return JellyfishConstants.DEFAULT_QUEUE_SIZE;
65 /**
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()
70 @Override( )
71 protected int receiveSize( )
73 return JellyfishConstants.DEFAULT_QUEUE_SIZE;