package jmsfromABL;
import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.TopicConnectionFactory; import javax.jms.QueueConnectionFactory; import javax.jms.Topic; import javax.jms.Queue; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import java.util.Hashtable; public class AdminObjectFinder{ public Context context = null; public AdminObjectFinder() throws Exception{ Hashtable<String, String> env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:/C:/JNDI"); env.put(Context.SECURITY_PRINCIPAL, "username"); env.put(Context.SECURITY_CREDENTIALS, "password"); context = new InitialContext(env); } public TopicConnectionFactory getTopicConnectionFactory(String name) throws Exception { TopicConnectionFactory factory = null; factory = (javax.jms.TopicConnectionFactory)context.lookup(name); return factory; } public QueueConnectionFactory getQueueConnectionFactory(String name) throws Exception { QueueConnectionFactory factory = null; factory = (javax.jms.QueueConnectionFactory)context.lookup(name); return factory; } public ConnectionFactory getConnectionFactory(String name) throws NamingException { return (ConnectionFactory) context.lookup(name); } public Topic getTopic(String name) throws Exception { Topic topic = null; Object object = null; object = context.lookup(name); if (object != null) { topic = (javax.jms.Topic) object; } return topic; } public Queue getQueue(String name) throws Exception { Queue queue = null; Object object = null; object = context.lookup(name); if (object != null) { queue = (javax.jms.Queue) object; } return queue; } public Destination getDestination(String name) throws NamingException { return (Destination) context.lookup(name); } } |
[PluginPolicy.Progress.SonicMQ]
pluginclasspath=C:\Progress115\OpenEdge/java/progress.jar, C:\PROGRA~2\IBM\WEBSPH~1\java\lib\com.ibm.mqjms.jar, C:\AdminObjectFinder.jar classpath=C:\Progress115\OpenEdge/java/progress.jar, C:\PROGRA~2\IBM\WEBSPH~1\java\lib\com.ibm.mqjms.jar, C:\AdminObjectFinder.jar jvmargs=-DsonicMQExtensions=false -DjmsProvider=WebSphereMQ |