activemq-cpp-3.6.0
activemq::core::FifoMessageDispatchChannel Class Reference

#include <src/main/activemq/core/FifoMessageDispatchChannel.h>

Inheritance diagram for activemq::core::FifoMessageDispatchChannel:

Public Member Functions

 FifoMessageDispatchChannel ()
virtual ~FifoMessageDispatchChannel ()
virtual void enqueue (const Pointer< MessageDispatch > &message)
 Add a Message to the Channel behind all pending message.
virtual void enqueueFirst (const Pointer< MessageDispatch > &message)
 Add a message to the front of the Channel.
virtual bool isEmpty () const
virtual bool isClosed () const
virtual bool isRunning () const
virtual Pointer< MessageDispatchdequeue (long long timeout)
 Used to get an enqueued message.
virtual Pointer< MessageDispatchdequeueNoWait ()
 Used to get an enqueued message if there is one queued right now.
virtual Pointer< MessageDispatchpeek () const
 Peek in the Queue and return the first message in the Channel without removing it from the channel.
virtual void start ()
 Starts dispatch of messages from the Channel.
virtual void stop ()
 Stops dispatch of message from the Channel.
virtual void close ()
 Close this channel no messages will be dispatched after this method is called.
virtual void clear ()
 Clear the Channel, all pending messages are removed.
virtual int size () const
virtual std::vector< Pointer
< MessageDispatch > > 
removeAll ()
 Remove all messages that are currently in the Channel and return them as a list of Messages.
virtual void lock ()
 Locks the object.
virtual bool tryLock ()
 Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
virtual void unlock ()
 Unlocks the object.
virtual void wait ()
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void wait (long long millisecs, int nanos)
 Waits on a signal from this object, which is generated by a call to Notify.
virtual void notify ()
 Signals a waiter on this object that it can now wake up and continue.
virtual void notifyAll ()
 Signals the waiters on this object that it can now wake up and continue.
- Public Member Functions inherited from activemq::core::MessageDispatchChannel
virtual ~MessageDispatchChannel ()
- Public Member Functions inherited from decaf::util::concurrent::Synchronizable
virtual ~Synchronizable ()

Constructor & Destructor Documentation

activemq::core::FifoMessageDispatchChannel::FifoMessageDispatchChannel ( )
virtual activemq::core::FifoMessageDispatchChannel::~FifoMessageDispatchChannel ( )
virtual

Member Function Documentation

virtual void activemq::core::FifoMessageDispatchChannel::clear ( )
virtual

Clear the Channel, all pending messages are removed.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::close ( )
virtual

Close this channel no messages will be dispatched after this method is called.

Implements activemq::core::MessageDispatchChannel.

virtual Pointer<MessageDispatch> activemq::core::FifoMessageDispatchChannel::dequeue ( long long  timeout)
virtual

Used to get an enqueued message.

The amount of time this method blocks is based on the timeout value. - if timeout==-1 then it blocks until a message is received. - if timeout==0 then it it tries to not block at all, it returns a message if it is available - if timeout>0 then it blocks up to timeout amount of time. Expired messages will consumed by this method.

Returns
null if we timeout or if the consumer is closed.
Exceptions
ActiveMQException

Implements activemq::core::MessageDispatchChannel.

virtual Pointer<MessageDispatch> activemq::core::FifoMessageDispatchChannel::dequeueNoWait ( )
virtual

Used to get an enqueued message if there is one queued right now.

If there is no waiting message than this method returns Null.

Returns
a message if there is one in the queue.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::enqueue ( const Pointer< MessageDispatch > &  message)
virtual

Add a Message to the Channel behind all pending message.

Parameters
message- The message to add to the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::enqueueFirst ( const Pointer< MessageDispatch > &  message)
virtual

Add a message to the front of the Channel.

Parameters
message- The Message to add to the front of the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual bool activemq::core::FifoMessageDispatchChannel::isClosed ( ) const
inlinevirtual
Returns
has the Queue been closed.

Implements activemq::core::MessageDispatchChannel.

virtual bool activemq::core::FifoMessageDispatchChannel::isEmpty ( ) const
virtual
Returns
true if there are no messages in the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual bool activemq::core::FifoMessageDispatchChannel::isRunning ( ) const
inlinevirtual
Returns
true if the Channel currently running and will dequeue message.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::lock ( )
inlinevirtual

Locks the object.

Exceptions
RuntimeExceptionif an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::notify ( )
inlinevirtual

Signals a waiter on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.
RuntimeExceptionif an error occurs while notifying one of the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::notifyAll ( )
inlinevirtual

Signals the waiters on this object that it can now wake up and continue.

Must have this object locked before calling.

Exceptions
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.
RuntimeExceptionif an error occurs while notifying the waiting threads.

Implements decaf::util::concurrent::Synchronizable.

virtual Pointer<MessageDispatch> activemq::core::FifoMessageDispatchChannel::peek ( ) const
virtual

Peek in the Queue and return the first message in the Channel without removing it from the channel.

Returns
a message if there is one in the queue.

Implements activemq::core::MessageDispatchChannel.

virtual std::vector<Pointer<MessageDispatch> > activemq::core::FifoMessageDispatchChannel::removeAll ( )
virtual

Remove all messages that are currently in the Channel and return them as a list of Messages.

Returns
a list of Messages that was previously in the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual int activemq::core::FifoMessageDispatchChannel::size ( ) const
virtual
Returns
the number of Messages currently in the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::start ( )
virtual

Starts dispatch of messages from the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual void activemq::core::FifoMessageDispatchChannel::stop ( )
virtual

Stops dispatch of message from the Channel.

Implements activemq::core::MessageDispatchChannel.

virtual bool activemq::core::FifoMessageDispatchChannel::tryLock ( )
inlinevirtual

Attempts to Lock the object, if the lock is already held by another thread than this method returns false.

Returns
true if the lock was acquired, false if it is already held by another thread.
Exceptions
RuntimeExceptionif an error occurs while locking the object.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::unlock ( )
inlinevirtual

Unlocks the object.

Exceptions
RuntimeExceptionif an error occurs while unlocking the object.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::wait ( )
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling.

Exceptions
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::wait ( long long  millisecs)
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval.

Parameters
millisecsthe time in milliseconds to wait, or WAIT_INIFINITE
Exceptions
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.

virtual void activemq::core::FifoMessageDispatchChannel::wait ( long long  millisecs,
int  nanos 
)
inlinevirtual

Waits on a signal from this object, which is generated by a call to Notify.

Must have this object locked before calling. This wait will timeout after the specified time interval. This method is similar to the one argument wait function except that it add a finer grained control over the amount of time that it waits by adding in the additional nanosecond argument.

NOTE: The ability to wait accurately at a nanosecond scale depends on the platform and OS that the Decaf API is running on, some systems do not provide an accurate enough clock to provide this level of granularity.

Parameters
millisecsthe time in milliseconds to wait, or WAIT_INIFINITE
nanosadditional time in nanoseconds with a range of 0-999999
Exceptions
IllegalArgumentExceptionif an error occurs or the nanos argument is not in the range of [0-999999]
RuntimeExceptionif an error occurs while waiting on the object.
InterruptedExceptionif the wait is interrupted before it completes.
IllegalMonitorStateException- if the current thread is not the owner of the the Synchronizable Object.

Implements decaf::util::concurrent::Synchronizable.


The documentation for this class was generated from the following file: