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 Java EE application client container, or in the Java EE web or EJB container. If this method is called in the Java 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 Java EE application client container:
- The session will be non-transacted and received messages will be acknowledged automatically using an acknowledgement mode of {@code JMSContext.AUTO_ACKNOWLEDGE} For a definition of the meaning of this acknowledgement mode see the link below.
In a Java 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 {@code JMSContext}'s {@code commit} or {@code rollback} methods.
In the Java 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 {@code JMSContext.AUTO_ACKNOWLEDGE} For a definition of the meaning of this acknowledgement mode see the link below.
@return a newly created JMSContext
@exception JMSRuntimeException if the JMS provider fails to create theJMSContext due to some internal error.
@exception JMSSecurityRuntimeException if client authentication fails due to an invalid user name or password.
@since 2.0
@see JMSContext#AUTO_ACKNOWLEDGE
@see javax.jms.ConnectionFactory#createContext(int)
@see javax.jms.ConnectionFactory#createContext(java.lang.String,java.lang.String)
@see javax.jms.ConnectionFactory#createContext(java.lang.String,java.lang.String,int)
@see javax.jms.JMSContext#createContext(int)