Package org.ow2.joram.jakarta.connector
Class InboundConsumer
- java.lang.Object
-
- org.ow2.joram.jakarta.connector.InboundConsumer
-
- All Implemented Interfaces:
jakarta.jms.ServerSessionPool,InboundConsumerMBean
public class InboundConsumer extends Object implements jakarta.jms.ServerSessionPool, InboundConsumerMBean
AnInboundConsumerinstance is responsible for consuming messages from a given JORAM destination and through a given JORAM connection.
-
-
Field Summary
Fields Modifier and Type Field Description private intackModeprivate booleancloseDurSubfor closing durable subscriptionprivate jakarta.jms.XAConnectioncnxThe provided connection to the underlying JORAM server.private jakarta.jms.ConnectionConsumercnxConsumerWrappedConnectionConsumerinstance.private static booleanDEBUG(package private) jakarta.resource.spi.endpoint.MessageEndpointFactoryendpointFactoryApplication's endpoints factory.private static Loggerloggerprivate intmaxWorksMaximum number of Work instances to be submitted (0 for infinite).private Vector<jakarta.jms.ServerSession>poolPool of server sessions.private intserverSessionsNumber of created server sessions.private StringsubNameThe durable subscription name, if provided.private booleantransactedtrueif message consumption occurs in a transaction.private jakarta.resource.spi.work.WorkManagerworkManagerApplication server'sWorkManagerinstance.
-
Constructor Summary
Constructors Constructor Description InboundConsumer(jakarta.resource.spi.work.WorkManager workManager, jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.jms.XAConnection cnx, jakarta.jms.Destination dest, String selector, boolean durable, String subName, boolean transacted, int maxWorks, int maxMessages, int ackMode, boolean closeDurSub)Constructs anInboundConsumerinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclose()Closes the consumer.StringgetAckMode()the session mode.booleangetCloseDurSub()for closing durable subscriptionStringgetJMXBeanName(jakarta.jms.XAConnection cnx)intgetMaxWorks()Maximum number of Work instances to be submitted (0 for infinite).intgetPoolSize()Size of the pool of server sessions.jakarta.jms.ServerSessiongetServerSession()Provides a newInboundSessioninstance for processing incoming messages.intgetServerSessions()Number of created server sessions.String[]getSessions()StringgetSubName()The durable subscription name, if provided.booleangetTransacted()trueif message consumption occurs in a transaction.private InboundSessionnewSession()StringregisterMBean()(package private) voidreleaseSession(InboundSession session)Releases anInboundSessioninstance.voidunregisterMBean()
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
workManager
private jakarta.resource.spi.work.WorkManager workManager
Application server'sWorkManagerinstance.
-
endpointFactory
jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory
Application's endpoints factory.
-
cnx
private jakarta.jms.XAConnection cnx
The provided connection to the underlying JORAM server.
-
subName
private String subName
The durable subscription name, if provided.
-
transacted
private boolean transacted
trueif message consumption occurs in a transaction.
-
maxWorks
private int maxWorks
Maximum number of Work instances to be submitted (0 for infinite).
-
ackMode
private int ackMode
-
closeDurSub
private boolean closeDurSub
for closing durable subscription
-
cnxConsumer
private jakarta.jms.ConnectionConsumer cnxConsumer
WrappedConnectionConsumerinstance.
-
serverSessions
private int serverSessions
Number of created server sessions.
-
pool
private Vector<jakarta.jms.ServerSession> pool
Pool of server sessions.
-
-
Constructor Detail
-
InboundConsumer
public InboundConsumer(jakarta.resource.spi.work.WorkManager workManager, jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.jms.XAConnection cnx, jakarta.jms.Destination dest, String selector, boolean durable, String subName, boolean transacted, int maxWorks, int maxMessages, int ackMode, boolean closeDurSub) throws jakarta.resource.ResourceExceptionConstructs anInboundConsumerinstance.- Parameters:
workManager- Application server'sWorkManagerinstance.endpointFactory- Application's endpoints factory.cnx- Connection to the JORAM server.dest- Destination to get messages from.selector- Selector for filtering messages.durable-truefor durably subscribing.subName- Durable subscription name.transacted-trueif deliveries will occur in a XA transaction.maxWorks- Max number of Work instances to be submitted.- Throws:
jakarta.resource.NotSupportedException- If the activation parameters are invalid.jakarta.resource.spi.SecurityException- If the target destination is not readable.jakarta.resource.spi.CommException- If the connection with the JORAM server is lost.jakarta.resource.ResourceException- Generic exception.
-
-
Method Detail
-
getJMXBeanName
public String getJMXBeanName(jakarta.jms.XAConnection cnx)
-
registerMBean
public String registerMBean()
-
unregisterMBean
public void unregisterMBean()
-
getServerSession
public jakarta.jms.ServerSession getServerSession() throws jakarta.jms.JMSExceptionProvides a newInboundSessioninstance for processing incoming messages.- Specified by:
getServerSessionin interfacejakarta.jms.ServerSessionPool- Throws:
jakarta.jms.JMSException- Never thrown.
-
newSession
private InboundSession newSession()
-
releaseSession
void releaseSession(InboundSession session)
Releases anInboundSessioninstance.
-
close
void close()
Closes the consumer.
-
getSubName
public String getSubName()
Description copied from interface:InboundConsumerMBeanThe durable subscription name, if provided.- Specified by:
getSubNamein interfaceInboundConsumerMBean
-
getTransacted
public boolean getTransacted()
Description copied from interface:InboundConsumerMBeantrueif message consumption occurs in a transaction.- Specified by:
getTransactedin interfaceInboundConsumerMBean
-
getMaxWorks
public int getMaxWorks()
Description copied from interface:InboundConsumerMBeanMaximum number of Work instances to be submitted (0 for infinite).- Specified by:
getMaxWorksin interfaceInboundConsumerMBean
-
getAckMode
public String getAckMode()
Description copied from interface:InboundConsumerMBeanthe session mode.- Specified by:
getAckModein interfaceInboundConsumerMBean
-
getCloseDurSub
public boolean getCloseDurSub()
Description copied from interface:InboundConsumerMBeanfor closing durable subscription- Specified by:
getCloseDurSubin interfaceInboundConsumerMBean
-
getServerSessions
public int getServerSessions()
Description copied from interface:InboundConsumerMBeanNumber of created server sessions.- Specified by:
getServerSessionsin interfaceInboundConsumerMBean
-
getPoolSize
public int getPoolSize()
Description copied from interface:InboundConsumerMBeanSize of the pool of server sessions.- Specified by:
getPoolSizein interfaceInboundConsumerMBean
-
getSessions
public String[] getSessions()
- Specified by:
getSessionsin interfaceInboundConsumerMBean
-
-