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 containsjmsfrom4gl
must be on the CLASSPATH of the Ubroker:
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:
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). Thejava_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:
- The brokerURL startup parameter is used as the input parameter for the getTopicConnectionFactory and getQueueConnectionFactory methods. For example, if the 4GL application calls setBrokerURL(“directory_factory_name”), the 4GL–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 4GL–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 4GL–JMS implementation tries to create the object as if the method is not there.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |