History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-274
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Lars Torunski
Reporter: Ian Pojman
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OSCache

new method getIntialContext JMSBroadcastingListener

Created: 21/Nov/06 07:34 PM   Updated: 19/Mar/07 05:53 PM
Component/s: Listeners
Affects Version/s: 2.3.2
Fix Version/s: 2.4


 Description  « Hide
I need to be able to specify a specific JNDI context for the JMS connection factory when using JMSBroadcastingListener.

Could we separate the following code into a protected method, get/lookupConnectionFactory?

// Make sure you have specified the necessary JNDI properties (usually in
            // a jndi.properties resource file, or as system properties)
            InitialContext jndi = new InitialContext();

// Look up a JMS connection factory
            ConnectionFactory connectionFactory = (ConnectionFactory) jndi.lookup(topicFactory);

// Create a JMS connection
            connection = connectionFactory.createConnection();

basically I need to connect to a remote JMS - but setting system properties/jndi.properties is oo global for me. (i have other stuff which has different JNDI initialcontext settings)


 All   Comments   Change History      Sort Order:
Ian Pojman - [21/Nov/06 07:46 PM ]
this is the other way it could be done...

Properties p = getProperties();

// Make sure you have specified the necessary JNDI properties (usually in
            // a jndi.properties resource file, or as system properties)
            // get digitalchicago properties for current server, get remote "jms url" so we can set properties
            InitialContext jndi = new InitialContext(p);

Lars Torunski - [22/Nov/06 03:04 PM ]
new method added:

/**
     * @return creates a context for performing naming operations.
     * @throws NamingException if a naming exception is encountered
     */
    protected InitialContext getInitialContext() throws NamingException {
        return new InitialContext();
    }