|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.xmlBlaster.jms.XBSession
public class XBSession
XBSession
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected int |
ackMode
|
protected java.util.concurrent.LinkedBlockingQueue<XBMsgEvent> |
channel
|
(package private) XBConnection |
connection
|
protected boolean |
connectionActivated
|
protected java.util.Map |
consumerMap
|
protected java.lang.Thread |
controlThread
Set in the constructor it can be changed in the update methods (also of the message consumers) only. |
protected boolean |
durableDefault
|
protected java.util.HashMap |
durableSubscriptionMap
|
protected javax.jms.ExceptionListener |
exceptionListener
|
protected Global |
global
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
(package private) static int |
MODE_ASYNC
|
(package private) static int |
MODE_SYNC
|
(package private) static int |
MODE_UNSET
|
protected javax.jms.MessageListener |
msgListener
|
protected java.lang.String |
msgSelectorDefault
|
protected boolean |
noLocalDefault
|
protected boolean |
open
|
protected java.lang.String |
sessionName
|
private boolean |
started
|
private I_StatusChangeListener |
statusChangeListener
|
protected int |
syncMode
|
private boolean |
tmpBypassCheckSet
|
protected boolean |
transacted
|
protected long |
updateTimeout
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Constructor Summary | |
---|---|
XBSession(Global global,
int ackMode,
boolean transacted)
This constructor is used if you want to pass a Global which has already done some work (connected) on the I_XmlBlasterAccess. |
|
XBSession(XBConnection connection,
int ackMode,
boolean transacted)
This constructor extracts the global from the ConnectQos. |
Method Summary | |
---|---|
(package private) void |
activateDispatcher(boolean doActivate)
Activates or deactivates the dispatcher associated to this session. |
(package private) void |
checkControlThread()
|
protected void |
checkIfOpen(java.lang.String methodName)
|
protected void |
checkIfTransacted(java.lang.String methodName)
|
void |
close()
It disconnects from xmlBlaster and deregisters from its XBConnection |
void |
commit()
|
(package private) java.lang.String |
connect()
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue)
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue,
java.lang.String msgSelector)
|
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination)
For each consumer created, an own xmlBlaster subscription is done since the msgSelector (i.e. |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String msgSelector)
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String msgSelector,
boolean noLocal)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String msgSelector,
boolean noLocal)
|
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.Message |
createMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.ObjectMessage |
createObjectMessage(java.io.Serializable content)
|
javax.jms.MessageProducer |
createProducer(javax.jms.Destination destination)
|
javax.jms.Queue |
createQueue(java.lang.String queueName)
|
XBStreamingMessage |
createStreamingMessage(I_ReplaceContent replaceContent)
|
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.TemporaryQueue |
createTemporaryQueue()
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
|
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
|
javax.jms.Topic |
createTopic(java.lang.String name)
|
int |
getAcknowledgeMode()
|
javax.jms.MessageListener |
getMessageListener()
|
(package private) int |
getSyncMode()
|
boolean |
getTransacted()
|
(package private) long |
getUpdateTimeout()
|
private void |
postConstructor(int ackMode,
boolean transacted)
|
void |
recover()
|
void |
rollback()
|
void |
run()
|
(package private) void |
setControlThread(java.lang.Thread controlThread)
|
void |
setMessageListener(javax.jms.MessageListener msgListener)
|
(package private) void |
setStatusChangeListener(I_StatusChangeListener statusChangeListener)
registeres the listener about status changes. |
(package private) void |
setSyncMode(int asyncMode)
|
void |
unsubscribe(java.lang.String subName)
|
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode about a new message. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final int MODE_UNSET
static final int MODE_ASYNC
static final int MODE_SYNC
private static final java.lang.String ME
protected Global global
private static java.util.logging.Logger log
XBConnection connection
protected int ackMode
protected final boolean noLocalDefault
protected final boolean durableDefault
protected final java.lang.String msgSelectorDefault
protected javax.jms.MessageListener msgListener
protected java.util.HashMap durableSubscriptionMap
protected boolean open
protected boolean transacted
protected int syncMode
protected long updateTimeout
protected java.util.Map consumerMap
private boolean tmpBypassCheckSet
protected java.lang.Thread controlThread
protected java.lang.String sessionName
private I_StatusChangeListener statusChangeListener
protected javax.jms.ExceptionListener exceptionListener
protected boolean connectionActivated
protected java.util.concurrent.LinkedBlockingQueue<XBMsgEvent> channel
private boolean started
Constructor Detail |
---|
XBSession(XBConnection connection, int ackMode, boolean transacted)
connectQos
- is the connectQos to be used for this session. It is an own instance and can not be null.public XBSession(Global global, int ackMode, boolean transacted)
global
- ackMode
- transacted
- Method Detail |
---|
private final void postConstructor(int ackMode, boolean transacted)
void setStatusChangeListener(I_StatusChangeListener statusChangeListener)
statusChangeListener
- final void activateDispatcher(boolean doActivate) throws XmlBlasterException
doActivate
-
XmlBlasterException
java.lang.String connect() throws javax.jms.JMSException
javax.jms.JMSException
protected final void checkIfOpen(java.lang.String methodName) throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
protected final void checkIfTransacted(java.lang.String methodName) throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
final void checkControlThread() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name, java.lang.String msgSelector, boolean noLocal) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Session
javax.jms.JMSException
public void commit() throws javax.jms.JMSException
commit
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Message createMessage() throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable content) throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
javax.jms.JMSException
public XBStreamingMessage createStreamingMessage(I_ReplaceContent replaceContent) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage(java.lang.String text) throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public boolean getTransacted() throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
javax.jms.JMSException
public void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.JMSException
public void rollback() throws javax.jms.JMSException
rollback
in interface javax.jms.Session
javax.jms.JMSException
public void run()
run
in interface java.lang.Runnable
run
in interface javax.jms.Session
run
in class java.lang.Thread
public void setMessageListener(javax.jms.MessageListener msgListener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Queue createQueue(java.lang.String queueName) throws javax.jms.JMSException
createQueue
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String msgSelector) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryQueue createTemporaryQueue() throws javax.jms.JMSException
createTemporaryQueue
in interface javax.jms.Session
javax.jms.JMSException
public int getAcknowledgeMode() throws javax.jms.JMSException
getAcknowledgeMode
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageProducer createProducer(javax.jms.Destination destination) throws javax.jms.JMSException
createProducer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String msgSelector) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String msgSelector, boolean noLocal) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Topic createTopic(java.lang.String name) throws javax.jms.JMSException
createTopic
in interface javax.jms.Session
javax.jms.JMSException
public void unsubscribe(java.lang.String subName) throws javax.jms.JMSException
unsubscribe
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.Session
javax.jms.JMSException
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
I_Callback
update
in interface I_Callback
cbSessionId
- The session ID specified by the client which registered the callback.
You can specify a cbSessionId during connection (with ConnectQos)
and this is bounced back here so you can authenticate the message.updateKey
- The arrived key containing the topic namecontent
- The arrived message content. This is your payload.
XmlBlasterException
I_XmlBlasterAccess
int getSyncMode()
void setSyncMode(int asyncMode)
asyncMode
- The asyncMode to set. This method starts the
runner thread if not running yet in case async is set.void setControlThread(java.lang.Thread controlThread)
long getUpdateTimeout()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |