net.sf.jmsmq
Class MSMQQueue

java.lang.Object
  extended bynet.sf.jmsmq.MSMQQueue
All Implemented Interfaces:
java.io.Serializable

public class MSMQQueue
extends java.lang.Object
implements java.io.Serializable

Class that mapping a native implementation of a MSMQ queue object. Microsoft® Message Queuing Server. This class use JNI interfaces over the "jmsmq.dll" library. This library has to have visibility from the environment "PATH" variable of the execution of the application that use this project

See Also:
Serialized Form

Method Summary
 MSMQMessageEnumerator getMessageEnumerator()
          Method that create a new message enumerator of the queue This method returns a new message enumerator associated to the queue.
 java.lang.String getQueueFormatName()
          Method that returns the queue format name
 java.lang.String getQueueLabel()
          Method that returns the queue label
 java.lang.String getQueueName()
          Method that returns the queue name
 java.lang.String getQueuePathName()
          Method that returns the queue path name
 MQ_QUEUE_TYPE getQueueType()
          Method that returns the queue type
 MQ_XACT_TYPE getQueueXActType()
          Method that returns the transactional type of the queue
 MSMQMessage peekMessage()
          Method that read the first message in the queue
 MSMQMessage peekMessage(long timeOut)
          Method that read the first message in the queue
 void purgeQueue()
          Method that delete all message in the queue
 MSMQMessage readMessage()
          Method that extract a message of the queue
 MSMQMessage readMessage(long timeOut)
          Method that extract a message of the queue
 void sendMessage(MSMQMessage message)
          Method that sends a message to the queue
 void setQueueLabel(java.lang.String newQueueLabel)
          Method that sets the queue label
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getQueueFormatName

public java.lang.String getQueueFormatName()
Method that returns the queue format name

Returns:
String Queue format name

getQueueName

public java.lang.String getQueueName()
Method that returns the queue name

Returns:
String Queue name

getQueuePathName

public java.lang.String getQueuePathName()
                                  throws MSMQException
Method that returns the queue path name

Returns:
String Queue path name
Throws:
MSMQException - Throw if an exception occurs retrieving the queue info

getQueueLabel

public java.lang.String getQueueLabel()
                               throws MSMQException
Method that returns the queue label

Returns:
String Queue label
Throws:
MSMQException - Throw if an exception occurs retrieving the queue info

setQueueLabel

public void setQueueLabel(java.lang.String newQueueLabel)
                   throws MSMQException,
                          MSMQMaxLenPropertyException
Method that sets the queue label

Parameters:
newQueueLabel - New queue label
Throws:
MSMQException - Throw if an exception occurs setting the queue info
MSMQMaxLenPropertyException - Throw if an exception new queue label exceded the max size for queue label size

getQueueType

public MQ_QUEUE_TYPE getQueueType()
Method that returns the queue type

Returns:
String Queue type

getQueueXActType

public MQ_XACT_TYPE getQueueXActType()
                              throws MSMQException
Method that returns the transactional type of the queue

Returns:
String Queue transactional type
Throws:
MSMQException - Throw if an exception occurs setting the queue info

purgeQueue

public void purgeQueue()
                throws MSMQException
Method that delete all message in the queue

Throws:
MSMQException - Throw if an exception occurs purging the queue

readMessage

public MSMQMessage readMessage()
                        throws MSMQException
Method that extract a message of the queue

Returns:
MSMQMessage The message read
Throws:
MSMQException - Throw if an exception occurs reading the queue
MSMQEmptyQueueException - Throw if an exception occurs if the queue has no messages

readMessage

public MSMQMessage readMessage(long timeOut)
                        throws MSMQException
Method that extract a message of the queue

Parameters:
timeOut - Read operation timeout
Returns:
MSMQMessage The message read
Throws:
MSMQException - Throw if an exception occurs reading the queue
MSMQEmptyQueueException - Throw if an exception occurs if the queue has no messages

getMessageEnumerator

public MSMQMessageEnumerator getMessageEnumerator()
Method that create a new message enumerator of the queue This method returns a new message enumerator associated to the queue. The message enumerator is dereference if any of the methods getMessageEnumerator(), readMessage(), peekMessage, sendMessage() or purgeQueue are invoked.

Returns:
MSMQMessageEnumerator New message enumerator reference

peekMessage

public MSMQMessage peekMessage()
                        throws MSMQException,
                               MSMQEmptyQueueException
Method that read the first message in the queue

Returns:
MSMQMessage The message read
Throws:
MSMQException - Throw if an exception occurs reading the queue
MSMQEmptyQueueException - Throw if an exception occurs if the queue has no messages

peekMessage

public MSMQMessage peekMessage(long timeOut)
                        throws MSMQException,
                               MSMQEmptyQueueException
Method that read the first message in the queue

Parameters:
timeOut - Read operation timeout
Returns:
MSMQMessage The message read
Throws:
MSMQException - Throw if an exception occurs reading the queue
MSMQEmptyQueueException - Throw if an exception occurs if the queue has no messages

sendMessage

public void sendMessage(MSMQMessage message)
                 throws MSMQException,
                        MSMQMaxLenPropertyException
Method that sends a message to the queue

Parameters:
message - Message to send
Throws:
MSMQException - Throw if an exception occurs sending the message to the queue
MSMQMaxLenPropertyException - Throw if an exception occurs if the message label length excedeed the maximum label size


Jorge Ruesga © 2006. All rigths reserved.