public class InboundConsumer extends Object implements ServerSessionPool, InboundConsumerMBean
InboundConsumer
instance is responsible for consuming
messages from a given JORAM destination and through a given JORAM
connection.Modifier and Type | Field and Description |
---|---|
private int |
ackMode |
private boolean |
closeDurSub
for closing durable subscription
|
private XAConnection |
cnx
The provided connection to the underlying JORAM server.
|
private ConnectionConsumer |
cnxConsumer
Wrapped
ConnectionConsumer instance. |
(package private) MessageEndpointFactory |
endpointFactory
Application's endpoints factory.
|
static org.objectweb.util.monolog.api.Logger |
logger |
private int |
maxWorks
Maximum number of Work instances to be submitted (0 for infinite).
|
private Vector |
pool
Pool of server sessions.
|
private int |
serverSessions
Number of created server sessions.
|
private String |
subName
The durable subscription name, if provided.
|
private boolean |
transacted
true if message consumption occurs in a transaction. |
private WorkManager |
workManager
Application server's
WorkManager instance. |
Constructor and Description |
---|
InboundConsumer(WorkManager workManager,
MessageEndpointFactory endpointFactory,
XAConnection cnx,
Destination dest,
String selector,
boolean durable,
String subName,
boolean transacted,
int maxWorks,
int maxMessages,
int ackMode,
boolean closeDurSub)
Constructs an
InboundConsumer instance. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
close()
Closes the consumer.
|
String |
getAckMode()
the session mode.
|
boolean |
getCloseDurSub()
for closing durable subscription
|
String |
getJMXBeanName(XAConnection cnx) |
int |
getMaxWorks()
Maximum number of Work instances to be submitted (0 for infinite).
|
int |
getPoolSize()
Size of the pool of server sessions.
|
ServerSession |
getServerSession()
Provides a new
InboundSession instance for processing
incoming messages. |
int |
getServerSessions()
Number of created server sessions.
|
String[] |
getSessions() |
String |
getSubName()
The durable subscription name, if provided.
|
boolean |
getTransacted()
true if message consumption occurs in a transaction. |
private InboundSession |
newSession() |
String |
registerMBean() |
(package private) void |
releaseSession(InboundSession session)
Releases an
InboundSession instance. |
void |
unregisterMBean() |
public static org.objectweb.util.monolog.api.Logger logger
private WorkManager workManager
WorkManager
instance.MessageEndpointFactory endpointFactory
private XAConnection cnx
private String subName
private boolean transacted
true
if message consumption occurs in a transaction.private int maxWorks
private int ackMode
private boolean closeDurSub
private ConnectionConsumer cnxConsumer
ConnectionConsumer
instance.private int serverSessions
private Vector pool
public InboundConsumer(WorkManager workManager, MessageEndpointFactory endpointFactory, XAConnection cnx, Destination dest, String selector, boolean durable, String subName, boolean transacted, int maxWorks, int maxMessages, int ackMode, boolean closeDurSub) throws ResourceException
InboundConsumer
instance.workManager
- Application server's WorkManager
instance.endpointFactory
- Application's endpoints factory.cnx
- Connection to the JORAM server.dest
- Destination to get messages from.selector
- Selector for filtering messages.durable
- true
for durably subscribing.subName
- Durable subscription name.transacted
- true
if deliveries will occur in a
XA transaction.maxWorks
- Max number of Work instances to be submitted.NotSupportedException
- If the activation parameters are
invalid.SecurityException
- If the target destination is not
readable.CommException
- If the connection with the JORAM server
is lost.ResourceException
- Generic exception.public String getJMXBeanName(XAConnection cnx)
public String registerMBean()
public void unregisterMBean()
public ServerSession getServerSession() throws JMSException
InboundSession
instance for processing
incoming messages.getServerSession
in interface ServerSessionPool
JMSException
- Never thrown.private InboundSession newSession()
void releaseSession(InboundSession session)
InboundSession
instance.void close()
public String getSubName()
InboundConsumerMBean
getSubName
in interface InboundConsumerMBean
public boolean getTransacted()
InboundConsumerMBean
true
if message consumption occurs in a transaction.getTransacted
in interface InboundConsumerMBean
public int getMaxWorks()
InboundConsumerMBean
getMaxWorks
in interface InboundConsumerMBean
public String getAckMode()
InboundConsumerMBean
getAckMode
in interface InboundConsumerMBean
public boolean getCloseDurSub()
InboundConsumerMBean
getCloseDurSub
in interface InboundConsumerMBean
public int getServerSessions()
InboundConsumerMBean
getServerSessions
in interface InboundConsumerMBean
public int getPoolSize()
InboundConsumerMBean
getPoolSize
in interface InboundConsumerMBean
public String[] getSessions()
getSessions
in interface InboundConsumerMBean
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.