Created
November 18, 2014 16:26
-
-
Save sachin-handiekar/197640ad51178bb7446b to your computer and use it in GitHub Desktop.
OracleAQQueueDestinationFactory
This file contains hidden or 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
package com.sachinhandiekar.oracle.aq; | |
import org.springframework.beans.factory.FactoryBean; | |
import oracle.jms.AQjmsSession; | |
import javax.jms.Queue; | |
import javax.jms.QueueConnection; | |
import javax.jms.QueueConnectionFactory; | |
import javax.jms.Session; | |
public class OracleAQQueueDestinationFactory implements FactoryBean<queue> { | |
private QueueConnectionFactory connectionFactory; | |
private String queueUser; | |
private String queueName; | |
public Queue getObject() throws Exception { | |
QueueConnection queueConnection = connectionFactory.createQueueConnection(); | |
AQjmsSession session = (AQjmsSession) queueConnection.createQueueSession(true, Session.SESSION_TRANSACTED); | |
return session.getQueue(queueUser, queueName); | |
} | |
public Class<queue> getObjectType() { | |
return javax.jms.Queue.class; | |
} | |
public boolean isSingleton() { | |
return false; | |
} | |
public void setConnectionFactory(QueueConnectionFactory connectionFactory) { | |
this.connectionFactory = connectionFactory; | |
} | |
public void setQueueUser(String queueUser) { | |
this.queueUser = queueUser; | |
} | |
public void setQueueName(String queueName) { | |
this.queueName = queueName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment