|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.jms.JmsWriterBase
This abstract class defines the code that is shareable between all JmsWriter classes.
Field Summary | |
protected javax.jms.Connection |
_connection
|
protected javax.jms.Session |
_session
|
Constructor Summary | |
protected |
JmsWriterBase()
|
Method Summary | |
void |
close()
Inform the system that no more messaging will occur on this object. |
void |
commit()
Commit all messages done in the current transaction and release any locks currently held. |
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
|
boolean |
isTransacted()
|
void |
rollback()
Rollback all messages done in the current transaction and release any locks currently held. |
protected void |
setConnection(javax.jms.Connection conn)
|
protected void |
setSession(javax.jms.Session session)
|
void |
writeAndClose(javax.jms.Message message,
java.util.Map writeOptions)
|
void |
writeAndCommit(javax.jms.Message message,
java.util.Map writeOptions)
Write a message, and then immediately commit the session. |
void |
writeAndCommitAndClose(javax.jms.Message message,
java.util.Map writeOptions)
Write a message, commit the session, and close the connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.waveset.util.jms.JmsWriter |
write |
Field Detail |
protected javax.jms.Connection _connection
protected javax.jms.Session _session
Constructor Detail |
protected JmsWriterBase()
Method Detail |
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to create this message due to some internal errorpublic javax.jms.TextMessage createTextMessage(java.lang.String text) throws javax.jms.JMSException
createTextMessage
in interface JmsWriter
text
- the string used to initialize this message
javax.jms.JMSException
- if JMS fails to create this message due to some internal error.public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to create this message due to some internal error.public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to create this message due to some internal error.public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to create this message due to some internal error.public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to create this message due to some internal error.public void close()
JmsWriter
Any transacted session will be rolled back.
Do not attempt to use this object again after calling close().
close
in interface JmsWriter
public void writeAndCommit(javax.jms.Message message, java.util.Map writeOptions) throws WavesetException, javax.jms.JMSException
JmsWriter
NOTE: The commit will be performed only if the session is transacted.
writeAndCommit
in interface JmsWriter
message
- the message to be sentwriteOptions
- same as described in write
WavesetException
- if illegal values are found in writeOptions map
javax.jms.JMSException
- if JMS fails to send the message or to commit the transaction due to some internal error.public void writeAndCommitAndClose(javax.jms.Message message, java.util.Map writeOptions) throws WavesetException, javax.jms.JMSException
JmsWriter
This is the most succinct way to send a message, however it does not offer you the opportunity to send multiple messages over a single connection.
NOTE: The commit will be performed only if the session is transacted.
writeAndCommitAndClose
in interface JmsWriter
message
- the message to be sentwriteOptions
- same as described in write
javax.jms.JMSException
- if JMS fails to send the message or to commit the transaction due to some internal error.
WavesetException
- if illegal values are found in writeOptions mappublic void writeAndClose(javax.jms.Message message, java.util.Map writeOptions) throws javax.jms.JMSException, WavesetException
javax.jms.JMSException
WavesetException
public void commit() throws javax.jms.JMSException
JmsWriter
commit
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to commit the session due to some internal error.public void rollback() throws javax.jms.JMSException
JmsWriter
rollback
in interface JmsWriter
javax.jms.JMSException
- if JMS fails to rollback the session due to some internal error.public boolean isTransacted() throws javax.jms.JMSException
isTransacted
in interface JmsWriter
true
if the encapsulated javax.jms.Session
is in transacted mode; otherwise return false
.
If this was created with "LOCAL" reliabilityMode, then it is transacted.
javax.jms.JMSException
- if JMS fails to return the transaction mode due to internal error in JMS Provider.protected void setConnection(javax.jms.Connection conn)
protected void setSession(javax.jms.Session session)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |