com.caucho.remote.websocket
Class WebSocketBlockingQueue<T>

java.lang.Object
  extended by com.caucho.remote.websocket.WebSocketBlockingQueue<T>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.concurrent.BlockingQueue<T>, java.util.Queue<T>

public class WebSocketBlockingQueue<T>
extends java.lang.Object
implements java.util.concurrent.BlockingQueue<T>

WebSocketBlockingQueue blocks and encodes.


Constructor Summary
WebSocketBlockingQueue(WebSocketContext ws, WebSocketEncoder<T> encoder, int capacity)
           
 
Method Summary
 boolean add(T value)
           
 boolean addAll(java.util.Collection<? extends T> collection)
           
 void clear()
           
 boolean contains(java.lang.Object arg0)
           
 boolean containsAll(java.util.Collection<?> arg0)
           
 int drainTo(java.util.Collection<? super T> arg0)
           
 int drainTo(java.util.Collection<? super T> arg0, int arg1)
           
 T element()
           
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 boolean offer(T value)
           
 boolean offer(T value, long timeout, java.util.concurrent.TimeUnit unit)
           
 T peek()
           
 T poll()
           
 T poll(long arg0, java.util.concurrent.TimeUnit arg1)
           
 void put(T value)
           
 int remainingCapacity()
           
 T remove()
           
 boolean remove(java.lang.Object arg0)
           
 boolean removeAll(java.util.Collection<?> arg0)
           
 boolean retainAll(java.util.Collection<?> arg0)
           
 int size()
           
 T take()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

WebSocketBlockingQueue

public WebSocketBlockingQueue(WebSocketContext ws,
                              WebSocketEncoder<T> encoder,
                              int capacity)
Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<T>

size

public int size()
Specified by:
size in interface java.util.Collection<T>

remainingCapacity

public int remainingCapacity()
Specified by:
remainingCapacity in interface java.util.concurrent.BlockingQueue<T>

offer

public boolean offer(T value)
Specified by:
offer in interface java.util.concurrent.BlockingQueue<T>
Specified by:
offer in interface java.util.Queue<T>

offer

public boolean offer(T value,
                     long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException
Specified by:
offer in interface java.util.concurrent.BlockingQueue<T>
Throws:
java.lang.InterruptedException

add

public boolean add(T value)
Specified by:
add in interface java.util.Collection<T>
Specified by:
add in interface java.util.concurrent.BlockingQueue<T>
Specified by:
add in interface java.util.Queue<T>

put

public void put(T value)
         throws java.lang.InterruptedException
Specified by:
put in interface java.util.concurrent.BlockingQueue<T>
Throws:
java.lang.InterruptedException

addAll

public boolean addAll(java.util.Collection<? extends T> collection)
Specified by:
addAll in interface java.util.Collection<T>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<T>

element

public T element()
Specified by:
element in interface java.util.Queue<T>

peek

public T peek()
Specified by:
peek in interface java.util.Queue<T>

poll

public T poll()
Specified by:
poll in interface java.util.Queue<T>

remove

public T remove()
Specified by:
remove in interface java.util.Queue<T>

containsAll

public boolean containsAll(java.util.Collection<?> arg0)
Specified by:
containsAll in interface java.util.Collection<T>

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>
Specified by:
iterator in interface java.util.Collection<T>

removeAll

public boolean removeAll(java.util.Collection<?> arg0)
Specified by:
removeAll in interface java.util.Collection<T>

retainAll

public boolean retainAll(java.util.Collection<?> arg0)
Specified by:
retainAll in interface java.util.Collection<T>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<T>

toArray

public <T> T[] toArray(T[] arg0)
Specified by:
toArray in interface java.util.Collection<T>

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface java.util.Collection<T>
Specified by:
contains in interface java.util.concurrent.BlockingQueue<T>

drainTo

public int drainTo(java.util.Collection<? super T> arg0)
Specified by:
drainTo in interface java.util.concurrent.BlockingQueue<T>

drainTo

public int drainTo(java.util.Collection<? super T> arg0,
                   int arg1)
Specified by:
drainTo in interface java.util.concurrent.BlockingQueue<T>

poll

public T poll(long arg0,
              java.util.concurrent.TimeUnit arg1)
       throws java.lang.InterruptedException
Specified by:
poll in interface java.util.concurrent.BlockingQueue<T>
Throws:
java.lang.InterruptedException

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection<T>
Specified by:
remove in interface java.util.concurrent.BlockingQueue<T>

take

public T take()
       throws java.lang.InterruptedException
Specified by:
take in interface java.util.concurrent.BlockingQueue<T>
Throws:
java.lang.InterruptedException