Progress
External Program
Interfaces


Using the SonicMQ Adapter and the 4GL–JMS API With Administered Objects

JMS does not impose any specific directory for storing administered objects (although it establishes the convention of using JNDI-compliant directories, such as LDAP). Also, the process of connecting to a JNDI server and obtaining an initial context is not standardized.

Therefore, to use directory-stored JMS objects, you must implement a Java class, compile it, and install the class file on the SonicMQ Adapter host under the SonicMQ Adapter’s CLASSPATH. The SonicMQ Adapter looks for that class when it starts up. If it finds the class, it creates an instance object of it and uses it to locate administered objects. If it does not find the class, the SonicMQ Adapter creates objects as required.

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 SonicMQ Adapter host. 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 Ubroker:

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; 
  } 
} 

The following sections explain how to set the CLASSPATH by modifying the value for PROGRESSCP.

Setting the CLASSPATH On Windows

On Windows, you can set the CLASSPATH by using the Progress in2reg utility to modify the value for the PROGRESSCP environment variable.

Follow these steps to modify the PROGRESSCP environment variable:

  1. Modify the [JAVA] section of the progress.ini file (in <Progress_install_dir>\bin) by appending a semicolon followed by the full path to the \jmsfrom4gl directory at the end of the current information.
  2. Run ini2reg on the progress.ini file, changing the registry base key to HKEY_LOCAL_MACHINE.

For more information on the ini2reg utility, see its online help.

Setting the CLASSPATH On UNIX

On UNIX, you can set the CLASSPATH by editing the java_env script (in the <install-directory>/bin directory). The java_env script contains a definition for the PROGRESSCP environment variable. Append a colon followed by the full path to the /jmsfrom4gl directory at the end of the entry for PROGRESSCP.

NOTES:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095