org.osesb.test.soapjmsreceiverservice.ejb20
Class SOAPJMSReceiverWSBean

java.lang.Object
  extended by org.osesb.test.soapjmsreceiverservice.ejb20.SOAPJMSReceiverWSBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class SOAPJMSReceiverWSBean
extends java.lang.Object
implements javax.ejb.SessionBean

SOAPJMSReceiverWSBean is a stateless session bean is configured as a test web service that processes SOAPMessages onto a JMS Destination as follows:

Since:
Version .9
See Also:
Serialized Form

Field Summary
protected  java.lang.String destinationQueue
          From the javax.jms.Queue environment property, the JNDI name for a Queue for sending messages to the JMS Destination using a non-pooled JMS client.
protected  java.lang.String destinationTopic
          From the javax.jms.Topic environment property, the JNDI name for a Topic for sending messages to the JMS Destination using a non-pooled JMS client.
protected  java.lang.String jmsPoolKey
          The MDB uses pooled JMS clients to send replies.
protected  java.lang.String queueConnectionFactory
          From the javax.jms.QueueConnectionFactory environment property, the JNDI name of the javax.jms.QueueConnectionFactory used to create a Queue connection for a non-pooled JMS client which sends messages to the JMS Destination.
protected  java.lang.String topicConnectionFactory
          From the javax.jms.TopicConnectionFactory environment property, the JNDI name of the javax.jms.TopicConnectionFactory used to create a Topic connection for a non-pooled JMS client which sends messages to the JMS Destination.
protected static java.lang.String xmlContentKey
          receiveMessage() processes XML messages with attachments into JMS MapMessages with the following keys: 1) 'xmlContent' maps to a String that is the XML message, and 2) there are 'attachmentN' keys that map to byte[](s), which contain attachment data.
 
Constructor Summary
SOAPJMSReceiverWSBean()
           
 
Method Summary
 void ejbActivate()
           
 void ejbCreate()
          ejbCreate().
 void ejbPassivate()
           
 void ejbRemove()
           
protected  JMSProducerBase getJMSProducer()
          Uses J2EE environment properties to return a JMSProducerBase for sending messages to a JMS Destination.
 javax.ejb.SessionContext getSessionContext()
           
protected  void logMessage(java.lang.String messageID, java.lang.String xmlMessageText, int numberOfAttachments)
          Log a message.
 void receiveMessage(java.lang.String xmlMessageText)
          Receive a XML message, possibly with attachments, and put it to the configured JMS Destination.
 void setSessionContext(javax.ejb.SessionContext sessionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueConnectionFactory

protected java.lang.String queueConnectionFactory
From the javax.jms.QueueConnectionFactory environment property, the JNDI name of the javax.jms.QueueConnectionFactory used to create a Queue connection for a non-pooled JMS client which sends messages to the JMS Destination.

See Also:
ejbCreate()

topicConnectionFactory

protected java.lang.String topicConnectionFactory
From the javax.jms.TopicConnectionFactory environment property, the JNDI name of the javax.jms.TopicConnectionFactory used to create a Topic connection for a non-pooled JMS client which sends messages to the JMS Destination.

See Also:
ejbCreate()

destinationQueue

protected java.lang.String destinationQueue
From the javax.jms.Queue environment property, the JNDI name for a Queue for sending messages to the JMS Destination using a non-pooled JMS client.

See Also:
ejbCreate()

destinationTopic

protected java.lang.String destinationTopic
From the javax.jms.Topic environment property, the JNDI name for a Topic for sending messages to the JMS Destination using a non-pooled JMS client.

See Also:
ejbCreate()

jmsPoolKey

protected java.lang.String jmsPoolKey
The MDB uses pooled JMS clients to send replies.

From the keyed.pooled.jms.client.poolkey environment property, poolkey points to the JMSClientConfiguration in the pool config file for the pooled JMS client which sends messages to the JMS Destination. poolkey points to the JMSClientConfiguration in the pool config file for the pooled JMS client that sends replies. The pool configuration file path for the EAR is defined in object-pool-configurations.properties, which is packaged in osesb-configurations.jar.

See Also:
ejbCreate()

xmlContentKey

protected static java.lang.String xmlContentKey
receiveMessage() processes XML messages with attachments into JMS MapMessages with the following keys: 1) 'xmlContent' maps to a String that is the XML message, and 2) there are 'attachmentN' keys that map to byte[](s), which contain attachment data. So, if there are 5 attachments, then there are 5 'attachmentN' keys (where N is 0-4)..

This is the 'xmlContent' key.

Constructor Detail

SOAPJMSReceiverWSBean

public SOAPJMSReceiverWSBean()
Method Detail

receiveMessage

public void receiveMessage(java.lang.String xmlMessageText)
                    throws java.lang.Exception
Receive a XML message, possibly with attachments, and put it to the configured JMS Destination.

Parameters:
xmlMessageText - The received XML message.
Throws:
java.lang.Exception - if there is an error while processing the message.

getJMSProducer

protected JMSProducerBase getJMSProducer()
                                  throws java.lang.Exception
Uses J2EE environment properties to return a JMSProducerBase for sending messages to a JMS Destination.

Returns:
A JMSProducerBase as a JMSQueueSender or JMSTopicPublisher.
Throws:
java.lang.Exception - if there is a problem getting a JMSProducer configured by environment properties.

logMessage

protected void logMessage(java.lang.String messageID,
                          java.lang.String xmlMessageText,
                          int numberOfAttachments)
Log a message.

Parameters:
messageID - The ID of the incoming message from the <wsa:MessageID> entry in the SOAPHeader, if any.
xmlMessageText - The incoming XML message.
numberOfAttachments - The number of attachments in the incoming message.

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
ejbCreate().

Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

getSessionContext

public javax.ejb.SessionContext getSessionContext()

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
Specified by:
setSessionContext in interface javax.ejb.SessionBean