我希望将“用户定义”配置列表从 Java 传递回 IIB 中的 ESQL。我可以传回单个值,但要查找完整列表。下面是 Java 和 ESQL 代码。非常感谢任何输入。
ESQL 代码:
CREATE COMPUTE MODULE SiteCodeValdationRoutine_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
CALL getSiteCodeProperties(Environment.MFT.Sitecode);
RETURN TRUE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
CREATE PROCEDURE getSiteCodeProperties( OUT Sitecode CHARACTER)
LANGUAGE JAVA EXTERNAL NAME "com.nb.iib.util.SiteCodeParameterLookup.getSiteCodeParameters";
END MODULE;
Java 代码:
package com.nb.iib.util;
import java.util.Properties;
import com.ibm.broker.config.proxy.BrokerProxy;
import com.ibm.broker.config.proxy.ConfigurableService;
public class SiteCodeParameterLookup {
public static void getSiteCodeParameters(String siteCodeArray[]) {
siteCodeArray = new String[10];
BrokerProxy bp = null;
try {
// Grab Local Broker Proxy
bp = BrokerProxy.getLocalInstance();
if (bp == null) {
throw new IllegalStateException("Could not obtain Broker Proxy Connection");
}
// Search up
ConfigurableService[] ud_set = bp.getConfigurableServices("UserDefined");
if (ud_set == null) {
throw new IllegalStateException("Could not find Site Code value under User Defined Properties: ");
}
// Add
System.out.println("Configurable Service Name :" + ud_set[0].getName());
for (int i = 0; i < 1; i++) {
siteCodeArray[i] = ud_set[i].getName();
}
} catch (Throwable t) {
throw new IllegalStateException(
"SiteCodeNotConfigured. Sitecode configuration missing in User Definied Properties", t);
} finally {
// Disconnect Broker Proxy when use is complete
if (bp != null)
bp.disconnect();
}
}
}
我需要将其传回siteCodeArray
给 ESQL。