Try OpenEdge Now
skip to main content
Messaging and ESB
Implementing Messaging : Externally managed connections : Finding administered objects in JNDI or proprietary directories : jmsfrom4gl.AdminObjectFinder class
 
jmsfrom4gl.AdminObjectFinder class
The following code is the skeleton of the jmsfrom4gl.AdminObjectFinder class. Use it as a template to create a class file and install it on the OpenEdge Adapter for the SonicMQ host; Unified Broker host for BrokerConnect, OpenEdge client host for ClientConnect, and AppServer or WebSpeed Transaction server host for the ServerConnect option.
The jmsfrom4gl.AdminObjectFinder name is mandatory. The class and the get...() methods must be declared public. The AdminObjectFinder class must be part of the jmsfrom4gl package and placed in a directory called jmsfrom4gl. The directory that contains jmsfrom4gl must be on the CLASSPATH of the OpenEdge Adapter for SonicMQ.
For example:
package jmsfrom4gl;
import javax.jms.TopicConnectionFactory;
import javax.jms.QueueConnectionFactory;
import javax.jms.Topic;
import javax.jms.Queue;
public class AdminObjectFinder
{  public TopicConnectionFactory getTopicConnectionFactory(String name)
    throws Exception
  {
    TopicConnectionFactory factory = null;
    // Write code to populate factory
    return factory;
  }
  public QueueConnectionFactory getQueueConnectionFactory(String name)
    throws Exception
  {
    QueueConnectionFactory factory = null;
    // Write code to populate factory
    return factory;
  }
  public Topic getTopic(String name)
    throws Exception
  {
    Topic topic = null;
    // Write code to populate topic
    return topic;
  }
  public Queue getQueue(String name)
    throws Exception
  {
    Queue queue = null;
    // Write code to populate queue
    return queue;
  }
Note: The brokerURL startup parameter is used as the input parameter for the getTopicConnectionFactory and getQueueConnectionFactory methods. For example, if the OpenEdge application calls the setBrokerURL procedure passing in the input parameter directory_factory_name, the ABL–JMS implementation on the server side calls the getTopicConnectionFactory method with directory_factory_name as the parameter. If the getTopicConnectionFactory and getQueueConnectionFactory methods are implemented, the jmsServerName startup parameter is ignored (since the identity of the server's vendor is encapsulated in the object). It is sufficient to implement methods for those objects that should be obtained from the directory. For example, it is legal to have an AdminObjectFinder class with only the getTopicConnectionFactory method. The ABL–JMS implementation looks for the methods dynamically and does not fail if the other methods are missing. If the object finder method returns null, the ABL–JMS implementation tries to create the object as if the method is not there. For more information on CLASSPATH, see Setting the CLASSPATH.