A MasterInfo class exists for each protocol. The MasterInfo describes the parameters needed to configure a listener and an emitter. To prepare a MasterInfo, extend the MasterInfo base class with a specific instance. A MasterInfo is static, so that the tables appear once in memory, but are instanced as needed to make available their methods to validate entered parameters.
When you develop a component, you provide a reference to the static instance of your MasterInfo in the addListener() and addEmitter() calls.
The following syntax is an example of a MasterInfo class.
package com.ibi.config;
import com.ibi.edaqm.XD;
import java.util.*;
public class MasterInfoTick extends MasterInfo
{
public static final MasterInfoTick INFO = new MasterInfoTick("Tick", "Tick", "Passes input on a predefined interval");
private MasterInfoTick(MasterType type) {
super(type);
}
private MasterInfoTick(String innerName, String patternName, String description) {
super(innerName,patternName,description);
}
public static final MasterPropertyInfo RETRY =
new MasterPropertyInfo(XD.KW_TIMEOUT, "Execution Interval", "2.0", PropertyType.DECIMAL_TENTHS, MasterPropertyInfo.REQUIRED,
"Interval between cycled requests", "#listener.schedule.timeout");
public static final MasterPropertyInfo FILE =
new MasterPropertyInfo(XD.KW_FILE, "Input File", "", PropertyType.FILE, MasterPropertyInfo.OPTIONAL,
"Name of a file to use for repeating input, if empty, use builtin document", null);
public static final MasterPropertyInfo INTYPE =
new MasterPropertyInfo("type", "Operation Type", "tree", PropertyType.CHOICE, MasterPropertyInfo.OPTIONAL,
"Type of message to pass through: tree is preparsed, bytes are parsed each pass", null);
static {
Map typeValues = new TreeMap();
typeValues.put("tree", "tree: preparsed");
typeValues.put("bytes", "bytes: parsed each pass");
INTYPE.setAllowedValues(typeValues);
}
// List of all the master properties
private static final MasterPropertyInfo[] PRIVATE_VALUES =
{ CommonMasterProps.ACTIVE,
RETRY,
FILE,
INTYPE,
CommonMasterProps.XALOG, // removed own parm and use common, SOC-727
CommonMasterProps.COUNT,
CommonMasterProps.MAX_LIFE};
private static final List VALUES =
Collections.unmodifiableList(Arrays.asList(PRIVATE_VALUES));
/**
* Returns a List of the master's properties.
* @return a List of the master's properties.
*/
public List getMasterProperties() {
return VALUES;
}
// List of all the master properties
private static final MasterPropertyInfo[] PRIVATE_REPLYTO_VALUES =
{};
private static final List REPLYTO_VALUES = Collections.unmodifiableList(Arrays.asList(PRIVATE_REPLYTO_VALUES));
public List getReplytoProperties() {
return REPLYTO_VALUES;
}
}