|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
jrun.jms.core.client.JmsConnectionConsumer | +--jrun.jms.core.client.JmsQueueConnectionConsumer
This class is part of the application server facility that allows concurrent processing of messages on the client side. It extends the JmsConnectionConsumer abstract class. An instance of this class is created given a JmsQueueSession a selector, session pool and the maximum number of messages that a particular session from the pool.
This class maps back to a single JMS server session object. It registers a listener and caches messages locally. When messages arrive it will try grab a server session from the pool, load it with one or more message and then start it. The server session will deliver messages to the registered client.
The number of messages that are loaded on the server session is dependent on the load of the system. On lightly loaded system, where server sessions are readily available then this object may only load a single message. Conversely, in a heavily loaded system this object may load several messages into the one server session object to minimize context switches.
org.exolab.jms.client.JmsTopicConnection| Constructor Summary | |
JmsQueueConnectionConsumer(JmsQueueSession session,
javax.jms.Queue queue,
javax.jms.ServerSessionPool pool,
java.lang.String selector,
int maxMessages)
This constructor, which is scoped at the package level, is responsible for constructing an instance of this class. |
|
| Method Summary | |
void |
close()
Since a provider may allocate some resources on behalf of a ConnectionConsumer outside the JVM, clients should close them when they are not needed. |
protected Logger |
getLogger()
Return a reference to the logger. |
javax.jms.ServerSessionPool |
getServerSessionPool()
Return a reference ot the server session pool instance use by this object |
void |
onMessage(javax.jms.Message message)
Impmentation of MessageListener.onMessage, which will receive messages from the server. |
| Constructor Detail |
public JmsQueueConnectionConsumer(JmsQueueSession session,
javax.jms.Queue queue,
javax.jms.ServerSessionPool pool,
java.lang.String selector,
int maxMessages)
throws javax.jms.JMSException
JmsQueueConnection class.
The method takes a topic, which specified what topic it will receive messages for, a sessionPool, which it uses to source all its server session objects, a messageSelector, which is used to filter messages a null or empty messageSelector implies no filtering. This constructor also takes the maxMessages, which identifies the maximum number of messages it can send down each server session object.
It throws an JMSException if it fails to construct an instance of this object for whatever reason.
session - server side session objectqueue - which queue it will receive messges forpool - the server session poolselector - associated message selector, can be nullmaxMessages - max number of messages it can send to down
a server session object at any one time.JMSException - | Method Detail |
public void close()
throws javax.jms.JMSException
close in class jrun.jms.core.client.JmsConnectionConsumerJMSException - if a JMS fails to release resources on
behalf of ConnectionConsumer or it fails
to close the connection consumer.
public javax.jms.ServerSessionPool getServerSessionPool()
throws javax.jms.JMSException
If the object is not set or there is any other issue throw the JMSException exception.
JMSException - public void onMessage(javax.jms.Message message)
If this methods gets an error then it will send an error message to the logger and return successful
message - message send back by the server.protected Logger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||