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

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

public class AbstractMessageFactory<T>
extends AbstractQueueSender<T>
implements MessagePropertiesFactory<T>

message factory


Constructor Summary
AbstractMessageFactory()
           
 
Method Summary
 void close()
           
 java.lang.String getContentEncoding()
           
 java.lang.String getContentType()
           
 java.lang.Object getCorrelationId()
           
 long getCreationTime()
           
 long getExpiryTime()
           
 java.lang.String getGroupId()
           
 long getGroupSequence()
           
 java.lang.Object getMessageId()
           
 int getPriority()
           
 java.lang.String getReplyTo()
           
 java.lang.String getReplyToGroupId()
           
 java.lang.String getSubject()
           
 long getTimeToLive()
           
 java.lang.String getTo()
           
 java.lang.String getUserId()
           
 boolean isDurable()
           
 boolean isFirstAcquirer()
           
protected  boolean offerMicros(MessagePropertiesFactory<T> factory, T value, long timeoutMicros)
          Offers a value to the queue.
 void setContentEncoding(java.lang.String value)
           
 void setContentType(java.lang.String value)
           
 void setCorrelationId(java.lang.Object value)
           
 void setCreationTime(long value)
           
 void setDurable(boolean isDurable)
           
 void setExpiryTime(long value)
           
 void setFirstAcquirer(boolean isFirst)
           
 void setGroupId(java.lang.String value)
           
 void setGroupSequence(long value)
           
 void setMessageId(java.lang.Object value)
           
 void setPriority(int priority)
           
 void setReplyTo(java.lang.String value)
           
 void setReplyToGroupId(java.lang.String value)
           
 void setSubject(java.lang.String subject)
           
 void setTimeToLive(long ttl)
           
 void setTo(java.lang.String to)
           
 void setUserId(java.lang.String value)
           
 
Methods inherited from class com.caucho.message.common.AbstractQueueSender
add, addAll, clear, contains, containsAll, drainTo, drainTo, element, getMessageFactory, isEmpty, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, remove, removeAll, retainAll, size, take, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
 
Methods inherited from interface java.util.Queue
element, peek, poll, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractMessageFactory

public AbstractMessageFactory()
Method Detail

setDurable

public void setDurable(boolean isDurable)
Specified by:
setDurable in interface MessagePropertiesFactory<T>

isDurable

public boolean isDurable()
Specified by:
isDurable in interface MessagePropertiesFactory<T>

getPriority

public int getPriority()
Specified by:
getPriority in interface MessagePropertiesFactory<T>

setPriority

public void setPriority(int priority)
Specified by:
setPriority in interface MessagePropertiesFactory<T>

getTimeToLive

public long getTimeToLive()
Specified by:
getTimeToLive in interface MessagePropertiesFactory<T>

setTimeToLive

public void setTimeToLive(long ttl)
Specified by:
setTimeToLive in interface MessagePropertiesFactory<T>

isFirstAcquirer

public boolean isFirstAcquirer()
Specified by:
isFirstAcquirer in interface MessagePropertiesFactory<T>

setFirstAcquirer

public void setFirstAcquirer(boolean isFirst)
Specified by:
setFirstAcquirer in interface MessagePropertiesFactory<T>

getMessageId

public java.lang.Object getMessageId()
Specified by:
getMessageId in interface MessagePropertiesFactory<T>

setMessageId

public void setMessageId(java.lang.Object value)
Specified by:
setMessageId in interface MessagePropertiesFactory<T>

getUserId

public java.lang.String getUserId()
Specified by:
getUserId in interface MessagePropertiesFactory<T>

setUserId

public void setUserId(java.lang.String value)
Specified by:
setUserId in interface MessagePropertiesFactory<T>

getTo

public java.lang.String getTo()
Specified by:
getTo in interface MessagePropertiesFactory<T>

setTo

public void setTo(java.lang.String to)
Specified by:
setTo in interface MessagePropertiesFactory<T>

getSubject

public java.lang.String getSubject()
Specified by:
getSubject in interface MessagePropertiesFactory<T>

setSubject

public void setSubject(java.lang.String subject)
Specified by:
setSubject in interface MessagePropertiesFactory<T>

getReplyTo

public java.lang.String getReplyTo()
Specified by:
getReplyTo in interface MessagePropertiesFactory<T>

setReplyTo

public void setReplyTo(java.lang.String value)
Specified by:
setReplyTo in interface MessagePropertiesFactory<T>

getCorrelationId

public java.lang.Object getCorrelationId()
Specified by:
getCorrelationId in interface MessagePropertiesFactory<T>

setCorrelationId

public void setCorrelationId(java.lang.Object value)
Specified by:
setCorrelationId in interface MessagePropertiesFactory<T>

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface MessagePropertiesFactory<T>

setContentType

public void setContentType(java.lang.String value)
Specified by:
setContentType in interface MessagePropertiesFactory<T>

getContentEncoding

public java.lang.String getContentEncoding()
Specified by:
getContentEncoding in interface MessagePropertiesFactory<T>

setContentEncoding

public void setContentEncoding(java.lang.String value)
Specified by:
setContentEncoding in interface MessagePropertiesFactory<T>

getExpiryTime

public long getExpiryTime()
Specified by:
getExpiryTime in interface MessagePropertiesFactory<T>

setExpiryTime

public void setExpiryTime(long value)
Specified by:
setExpiryTime in interface MessagePropertiesFactory<T>

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface MessagePropertiesFactory<T>

setCreationTime

public void setCreationTime(long value)
Specified by:
setCreationTime in interface MessagePropertiesFactory<T>

getGroupId

public java.lang.String getGroupId()
Specified by:
getGroupId in interface MessagePropertiesFactory<T>

setGroupId

public void setGroupId(java.lang.String value)
Specified by:
setGroupId in interface MessagePropertiesFactory<T>

getGroupSequence

public long getGroupSequence()
Specified by:
getGroupSequence in interface MessagePropertiesFactory<T>

setGroupSequence

public void setGroupSequence(long value)
Specified by:
setGroupSequence in interface MessagePropertiesFactory<T>

getReplyToGroupId

public java.lang.String getReplyToGroupId()
Specified by:
getReplyToGroupId in interface MessagePropertiesFactory<T>

setReplyToGroupId

public void setReplyToGroupId(java.lang.String value)
Specified by:
setReplyToGroupId in interface MessagePropertiesFactory<T>

offerMicros

protected boolean offerMicros(MessagePropertiesFactory<T> factory,
                              T value,
                              long timeoutMicros)
Description copied from class: AbstractQueueSender
Offers a value to the queue.

Specified by:
offerMicros in class AbstractQueueSender<T>

close

public void close()
Specified by:
close in interface MessagePropertiesFactory<T>