JSlim  


com.gtcgroup.jslim
Class JSlimProducer

java.lang.Object
  extended bycom.gtcgroup.jslim.JSlimProducer
All Implemented Interfaces:
IJSlimCachable, IJSlimPoolable

final class JSlimProducer
extends java.lang.Object
implements IJSlimPoolable

This JMS producer class enables the sending of text and object messages.

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Field Summary
private  int intUrlSelected
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
private  javax.jms.QueueConnection queueConnection
          A QueueConnection object is an active connection to a point-to-point JMS provider.
private  javax.jms.QueueSender queueSender
          A client uses a QueueSender object to send messages to a queue.
private  javax.jms.QueueSession queueSession
          A QueueSession object provides methods for creating QueueReceiver, QueueSender, QueueBrowser, and TemporaryQueue objects.
private  ServiceKeyVO serviceKeyVO
          A portion of a descriptor document representing one service.
private  java.lang.String strQueueName
          The name of the queue.
 
Constructor Summary
JSlimProducer(ServiceKeyVO serviceKeyVO, JSlimQueueConnectionFactory jSlimQueueConnectionFactory, JSlimQueue jSlimQueue)
          Constructor.
 
Method Summary
 java.lang.String getServiceKey()
          Returns the service key associated with this object.
 int getServiceType()
          Returns the service type associated with this object.
 int getUrlSelected()
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
private  void rethrowJMSException(java.lang.String strSourceMethod, javax.jms.JMSException e)
           
 java.lang.String sendMessage(java.io.Serializable messageSend)
          Sends a message to the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceKeyVO

private final ServiceKeyVO serviceKeyVO
A portion of a descriptor document representing one service.


intUrlSelected

private int intUrlSelected
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.


strQueueName

private java.lang.String strQueueName
The name of the queue.


queueConnection

private javax.jms.QueueConnection queueConnection
A QueueConnection object is an active connection to a point-to-point JMS provider. A client uses a QueueConnection object to create one or more QueueSession objects for producing and consuming messages.


queueSession

private javax.jms.QueueSession queueSession
A QueueSession object provides methods for creating QueueReceiver, QueueSender, QueueBrowser, and TemporaryQueue objects.


queueSender

private javax.jms.QueueSender queueSender
A client uses a QueueSender object to send messages to a queue.

Constructor Detail

JSlimProducer

public JSlimProducer(ServiceKeyVO serviceKeyVO,
                     JSlimQueueConnectionFactory jSlimQueueConnectionFactory,
                     JSlimQueue jSlimQueue)
              throws JSlimException
Constructor.

Parameters:
serviceKeyVO - A portion of a descriptor document representing one service.
jSlimQueueConnectionFactory - A client uses a QueueConnectionFactory object to create QueueConnection objects with a point-to-point JMS provider.
jSlimQueue - A Queue object encapsulates a provider-specific queue name. It is the way a client specifies the identity of a queue to JMS API methods
Throws:
JSlimException - if an exception encountered.
Method Detail

sendMessage

public final java.lang.String sendMessage(java.io.Serializable messageSend)
                                   throws JSlimException
Sends a message to the queue. Uses the QueueSender's default delivery mode, priority, and time to live.

Parameters:
messageSend - The message to be sent.
Returns:
The JMS message ID.
Throws:
JSlimException - if an exception encountered.

getServiceKey

public final java.lang.String getServiceKey()
Returns the service key associated with this object.

Specified by:
getServiceKey in interface IJSlimPoolable
Returns:
The service key associated with this object.

getServiceType

public final int getServiceType()
Returns the service type associated with this object.

Specified by:
getServiceType in interface IJSlimPoolable
Returns:
The service type associated with this object.

getUrlSelected

public final int getUrlSelected()
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Specified by:
getUrlSelected in interface IJSlimCachable
Returns:
Which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

rethrowJMSException

private final void rethrowJMSException(java.lang.String strSourceMethod,
                                       javax.jms.JMSException e)
                                throws JSlimException
Throws:
JSlimException

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.