com.caucho.message.common
Class AbstractQueueSender<T>

java.lang.Object
  extended by com.caucho.message.common.AbstractQueueSender<T>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.concurrent.BlockingQueue<T>, java.util.Queue<T>
Direct Known Subclasses:
AbstractMessageFactory, AbstractMessageSender

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

local connection to the message store


Constructor Summary
AbstractQueueSender()
           
 
Method Summary
 boolean add(T value)
           
 boolean addAll(java.util.Collection<? extends T> arg0)
           
 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()
           
protected  MessagePropertiesFactory<T> getMessageFactory()
           
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 boolean offer(T value)
           
 boolean offer(T value, long timeout, java.util.concurrent.TimeUnit timeUnit)
           
protected abstract  boolean offerMicros(MessagePropertiesFactory<T> factory, T value, long timeoutMicros)
          Offers a value to the queue.
 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()
           
<X> X[]
toArray(X[] arg0)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

AbstractQueueSender

public AbstractQueueSender()
Method Detail

offerMicros

protected abstract boolean offerMicros(MessagePropertiesFactory<T> factory,
                                       T value,
                                       long timeoutMicros)
Offers a value to the queue.


getMessageFactory

protected MessagePropertiesFactory<T> getMessageFactory()

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>

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 timeUnit)
Specified by:
offer in interface java.util.concurrent.BlockingQueue<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> arg0)
Specified by:
addAll in interface java.util.Collection<T>

remainingCapacity

public int remainingCapacity()
Specified by:
remainingCapacity 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

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>

clear

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

containsAll

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty 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>

size

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

toArray

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

toArray

public <X> X[] toArray(X[] 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>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object