JmsSetJndiEnvironment Function

Action

Manually sets the JNDI environment. Another option is to set a jndi.property file in the classpath. (mandatory).

Include file

Jms.bdh

Syntax

JmsSetJndiEnvironment( in sKey   : string, 
                       in SValue : string);
Parameter Description
sKey The key of the JNDI environment
sValue The value of the JNDI environment

Example

transaction TInit
  var hPerf : number;
  begin    
    JavaCreateJavaVM();
    
    hPerf := JavaLoadObject("silk/performer/SilkPerformer");
    JavaSetObject(JAVA_STATIC_METHOD, hPerf);
    ghJmsSampleObj := JavaLoadObject("JmsSample");
    JavaFreeObject(hPerf);    

    JmsSetJndiEnvironment(JNDI_NAMING_FACTORY_INITIAL_KEY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
    JmsSetJndiEnvironment("java.naming.provider.url", "tcp://demo.borland.com:61616");
    
    JmsSetJndiEnvironment("queue.TestQueue", csQueue);
    
    JmsInit("ConnectionFactory");
  end TInit;

Sample scripts

JmsSample.bdf, JmsSample.java