Class ActiveMQRAConnectionFactoryImpl
- All Implemented Interfaces:
ConnectionFactory,QueueConnectionFactory,TopicConnectionFactory,XAConnectionFactory,XAQueueConnectionFactory,XATopicConnectionFactory,Referenceable,Serializable,Referenceable,ActiveMQRAConnectionFactory
- See Also:
-
Field Summary
Fields inherited from interface org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactory
CONNECTION, QUEUE_CONNECTION, TOPIC_CONNECTION, XA_CONNECTION, XA_QUEUE_CONNECTION, XA_TOPIC_CONNECTION -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionCreates a connection with the default user identity.createConnection(String userName, String password) Creates a connection with the specified user identity.Creates a JMSContext with the default user identity and an unspecified sessionMode.createContext(int sessionMode) Creates a JMSContext with the default user identity and the specified session mode.createContext(String userName, String password) Creates a JMSContext with the specified user identity and an unspecified sessionMode.createContext(String userName, String password, int sessionMode) Creates a JMSContext with the specified user identity and the specified session mode.Creates a queue connection with the default user identity.createQueueConnection(String userName, String password) Creates a queue connection with the specified user identity.Creates a topic connection with the default user identity.createTopicConnection(String userName, String password) Creates a topic connection with the specified user identity.Creates anXAConnectionwith the default user identity.createXAConnection(String userName, String password) Creates anXAConnectionwith the specified user identity.Creates aXAJMSContextwith the default user identitycreateXAContext(String userName, String password) Creates a JMSContext with the specified user identityCreates an XA queue connection with the default user identity.createXAQueueConnection(String userName, String password) Creates an XA queue connection with the specified user identity.Creates an XA topic connection with the default user identity.createXATopicConnection(String userName, String password) Creates an XA topic connection with the specified user identity.voidsetReference(Reference reference) Sets the Reference instance.
-
Constructor Details
-
ActiveMQRAConnectionFactoryImpl
public ActiveMQRAConnectionFactoryImpl(ActiveMQRAManagedConnectionFactory mcf, ConnectionManager cm)
-
-
Method Details
-
setReference
Sets the Reference instance. This method is called by the deployment code to set the Reference that can be later returned by the getReference method (as defined in the javax.naming.Referenceable interface).- Specified by:
setReferencein interfaceReferenceable- Parameters:
reference- A Reference instance- See Also:
-
getReference
- Specified by:
getReferencein interfaceReferenceable
-
createQueueConnection
Creates a queue connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createQueueConnectionin interfaceQueueConnectionFactory- Returns:
- a newly created queue connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create the queue connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createQueueConnection
Creates a queue connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createQueueConnectionin interfaceQueueConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created queue connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create the queue connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createTopicConnection
Creates a topic connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createTopicConnectionin interfaceTopicConnectionFactory- Returns:
- a newly created topic connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create a topic connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createTopicConnection
Creates a topic connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createTopicConnectionin interfaceTopicConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created topic connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create a topic connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createConnection
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createConnectionin interfaceConnectionFactory- Returns:
- a newly created connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create the connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createConnection
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createConnectionin interfaceConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create the connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXAQueueConnection
Creates an XA queue connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXAQueueConnectionin interfaceXAQueueConnectionFactory- Returns:
- a newly created XA queue connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA queue connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXAQueueConnection
public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException Creates an XA queue connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXAQueueConnectionin interfaceXAQueueConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created XA queue connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA queue connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXATopicConnection
Creates an XA topic connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXATopicConnectionin interfaceXATopicConnectionFactory- Returns:
- a newly created XA topic connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA topic connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXATopicConnection
public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException Creates an XA topic connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXATopicConnectionin interfaceXATopicConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created XA topic connection
- Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA topic connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXAConnection
Creates anXAConnectionwith the default user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXAConnectionin interfaceXAConnectionFactory- Returns:
- a newly created
XAConnection - Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createXAConnection
Creates anXAConnectionwith the specified user identity. The connection is created in stopped mode. No messages will be delivered until theConnection.startmethod is explicitly called.- Specified by:
createXAConnectionin interfaceXAConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created
XAConnection - Throws:
JMSException- if the Jakarta Messaging provider fails to create an XA connection due to some internal error.JMSSecurityException- if client authentication fails due to an invalid user name or password.
-
createContext
Creates a JMSContext with the default user identity and an unspecified sessionMode.A connection and session are created for use by the new JMSContext. The connection is created in stopped mode but will be automatically started when a JMSConsumer is created.
The behaviour of the session that is created depends on whether this method is called in a Java SE environment, in the Jakarta EE application client container, or in the Jakarta EE web or EJB container. If this method is called in the Jakarta EE web or EJB container then the behaviour of the session also depends on whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Jakarta EE application client container:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
JMSContext.AUTO_ACKNOWLEDGEFor a definition of the meaning of this acknowledgement mode see the link below.
In a Jakarta EE web or EJB container, when there is an active JTA transaction in progress:
- The session will participate in the JTA transaction and will be committed or rolled back when that transaction is
committed or rolled back, not by calling the
JMSContext'scommitorrollbackmethods.
In the Jakarta EE web or EJB container, when there is no active JTA transaction in progress:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
JMSContext.AUTO_ACKNOWLEDGEFor a definition of the meaning of this acknowledgement mode see the link below.
- Specified by:
createContextin interfaceConnectionFactory- Returns:
- a newly created JMSContext
- See Also:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
-
createContext
Creates a JMSContext with the specified user identity and an unspecified sessionMode.A connection and session are created for use by the new JMSContext. The connection is created in stopped mode but will be automatically started when a JMSConsumer.
The behaviour of the session that is created depends on whether this method is called in a Java SE environment, in the Jakarta EE application client container, or in the Jakarta EE web or EJB container. If this method is called in the Jakarta EE web or EJB container then the behaviour of the session also depends on whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Jakarta EE application client container:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
JMSContext.AUTO_ACKNOWLEDGEFor a definition of the meaning of this acknowledgement mode see the link below.
In a Jakarta EE web or EJB container, when there is an active JTA transaction in progress:
- The session will participate in the JTA transaction and will be committed or rolled back when that transaction is
committed or rolled back, not by calling the
JMSContext'scommitorrollbackmethods.
In the Jakarta EE web or EJB container, when there is no active JTA transaction in progress:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
JMSContext.AUTO_ACKNOWLEDGEFor a definition of the meaning of this acknowledgement mode see the link below.
- Specified by:
createContextin interfaceConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created JMSContext
- See Also:
- The session will be non-transacted and received messages will be acknowledged automatically using an
acknowledgement mode of
-
createContext
Creates a JMSContext with the specified user identity and the specified session mode.A connection and session are created for use by the new JMSContext. The JMSContext is created in stopped mode but will be automatically started when a JMSConsumer is created.
The effect of setting the
sessionModeargument depends on whether this method is called in a Java SE environment, in the Jakarta EE application client container, or in the Jakarta EE web or EJB container. If this method is called in the Jakarta EE web or EJB container then the effect of setting thesessionModeargument also depends on whether or not there is an active JTA transaction in progress.In a Java SE environment or in the Jakarta EE application client container:
- If
sessionModeis set toJMSContext.SESSION_TRANSACTEDthen the session will use a local transaction which may subsequently be committed or rolled back by calling theJMSContext'scommitorrollbackmethods. - If
sessionModeis set to any ofJMSContext.CLIENT_ACKNOWLEDGE,JMSContext.AUTO_ACKNOWLEDGEorJMSContext.DUPS_OK_ACKNOWLEDGE. then the session will be non-transacted and messages received by this session will be acknowledged according to the value ofsessionMode. For a definition of the meaning of these acknowledgement modes see the links below.
In a Jakarta EE web or EJB container, when there is an active JTA transaction in progress:
- The argument
sessionModeis ignored. The session will participate in the JTA transaction and will be committed or rolled back when that transaction is committed or rolled back, not by calling theJMSContext'scommitorrollbackmethods. Since the argument is ignored, developers are recommended to usecreateContext(String userName, String password)instead of this method.
In the Jakarta EE web or EJB container, when there is no active JTA transaction in progress:
- The argument
acknowledgeModemust be set to either ofJMSContext.AUTO_ACKNOWLEDGEorJMSContext.DUPS_OK_ACKNOWLEDGE. The session will be non-transacted and messages received by this session will be acknowledged automatically according to the value ofacknowledgeMode. For a definition of the meaning of these acknowledgement modes see the links below. The valuesJMSContext.SESSION_TRANSACTEDandJMSContext.CLIENT_ACKNOWLEDGEmay not be used.
- Specified by:
createContextin interfaceConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's passwordsessionMode- indicates which of four possible session modes will be used.- If this method is called in a Java SE environment or in the Jakarta EE application client container, the permitted
values are
JMSContext.SESSION_TRANSACTED,JMSContext.CLIENT_ACKNOWLEDGE,JMSContext.AUTO_ACKNOWLEDGEandJMSContext.DUPS_OK_ACKNOWLEDGE. - If this method is called in the Jakarta EE web or EJB container when there is an active JTA transaction in progress then this argument is ignored.
- If this method is called in the Jakarta EE web or EJB container when there is no active JTA transaction in progress,
the permitted values are
JMSContext.AUTO_ACKNOWLEDGEandJMSContext.DUPS_OK_ACKNOWLEDGE. In this case the valuesJMSContext.TRANSACTEDandJMSContext.CLIENT_ACKNOWLEDGEare not permitted.
- If this method is called in a Java SE environment or in the Jakarta EE application client container, the permitted
values are
- Returns:
- a newly created JMSContext
- See Also:
- If
-
createContext
Creates a JMSContext with the default user identity and the specified session mode.A connection and session are created for use by the new JMSContext. The JMSContext is created in stopped mode but will be automatically started when a JMSConsumer is created.
The effect of setting the
sessionModeargument depends on whether this method is called in a Java SE environment, in the Jakarta EE application client container, or in the Jakarta EE web or EJB container. If this method is called in the Jakarta EE web or EJB container then the effect of setting thesessionModeargument also depends on whether or not there is an active JTA transaction in progress.In a Java SE environment or in the Jakarta EE application client container:
- If
sessionModeis set toJMSContext.SESSION_TRANSACTEDthen the session will use a local transaction which may subsequently be committed or rolled back by calling theJMSContext'scommitorrollbackmethods. - If
sessionModeis set to any ofJMSContext.CLIENT_ACKNOWLEDGE,JMSContext.AUTO_ACKNOWLEDGEorJMSContext.DUPS_OK_ACKNOWLEDGE. then the session will be non-transacted and messages received by this session will be acknowledged according to the value ofsessionMode. For a definition of the meaning of these acknowledgement modes see the links below.
In a Jakarta EE web or EJB container, when there is an active JTA transaction in progress:
- The argument
sessionModeis ignored. The session will participate in the JTA transaction and will be committed or rolled back when that transaction is committed or rolled back, not by calling theJMSContext'scommitorrollbackmethods. Since the argument is ignored, developers are recommended to usecreateContext()instead of this method.
In the Jakarta EE web or EJB container, when there is no active JTA transaction in progress:
- The argument
acknowledgeModemust be set to either ofJMSContext.AUTO_ACKNOWLEDGEorJMSContext.DUPS_OK_ACKNOWLEDGE. The session will be non-transacted and messages received by this session will be acknowledged automatically according to the value ofacknowledgeMode. For a definition of the meaning of these acknowledgement modes see the links below. The valuesJMSContext.SESSION_TRANSACTEDandJMSContext.CLIENT_ACKNOWLEDGEmay not be used.
- Specified by:
createContextin interfaceConnectionFactory- Parameters:
sessionMode- indicates which of four possible session modes will be used.- If this method is called in a Java SE environment or in the Jakarta EE application client container, the permitted
values are
JMSContext.SESSION_TRANSACTED,JMSContext.CLIENT_ACKNOWLEDGE,JMSContext.AUTO_ACKNOWLEDGEandJMSContext.DUPS_OK_ACKNOWLEDGE. - If this method is called in the Jakarta EE web or EJB container when there is an active JTA transaction in progress then this argument is ignored.
- If this method is called in the Jakarta EE web or EJB container when there is no active JTA transaction in progress,
the permitted values are
JMSContext.AUTO_ACKNOWLEDGEandJMSContext.DUPS_OK_ACKNOWLEDGE. In this case the valuesJMSContext.TRANSACTEDandJMSContext.CLIENT_ACKNOWLEDGEare not permitted.
- If this method is called in a Java SE environment or in the Jakarta EE application client container, the permitted
values are
- Returns:
- a newly created JMSContext
- See Also:
-
JMSContext.SESSION_TRANSACTEDJMSContext.CLIENT_ACKNOWLEDGEJMSContext.AUTO_ACKNOWLEDGEJMSContext.DUPS_OK_ACKNOWLEDGEConnectionFactory.createContext()ConnectionFactory.createContext(java.lang.String, java.lang.String)ConnectionFactory.createContext(java.lang.String, java.lang.String, int)JMSContext.createContext(int)
- If
-
createXAContext
Creates aXAJMSContextwith the default user identityA connection and session are created for use by the new
XAJMSContext. The connection is created in stopped mode but will be automatically started when aJMSConsumeris created.- Specified by:
createXAContextin interfaceXAConnectionFactory- Returns:
- a newly created
XAJMSContext
-
createXAContext
Creates a JMSContext with the specified user identityA connection and session are created for use by the new
XAJMSContext. The connection is created in stopped mode but will be automatically started when aJMSConsumeris created.- Specified by:
createXAContextin interfaceXAConnectionFactory- Parameters:
userName- the caller's user namepassword- the caller's password- Returns:
- a newly created JMSContext
-
getDefaultFactory
- Specified by:
getDefaultFactoryin interfaceActiveMQRAConnectionFactory- Throws:
ResourceException
-
getResourceAdapter
- Specified by:
getResourceAdapterin interfaceActiveMQRAConnectionFactory
-