Created
September 13, 2015 11:02
-
-
Save abhirockzz/c53117016370f54ad411 to your computer and use it in GitHub Desktop.
Protected access to JMSContext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option 1 | |
--------- | |
@Inject | |
@JMSConnectionFactory("jms/myConnectionFactory") | |
@JMSPasswordCredential(password = "secret", userName = "admin") | |
JMSContext ctx; | |
---------------------------------------------------------------- | |
Option 2 | |
--------- | |
//inject javax.jms.ConnectionFactory | |
@Resource("jndi/AppJMSConnFactory") | |
ConnectionFactory cf; | |
//use it to create the JMSContext | |
JMSContext ctx = cf.createContext("admin","secret"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment