有没有办法编写PCF程序来获取处于“正在运行”状态的群集发送者/接收者通道的通道状态?
我有这样的东西,只给我一个频道的频道状态!如何编写PCF命令以获取条件的通道状态?
// send the request and collect the responses
String checkStatus="";
String channelName ="";
// build a request
request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
// add a parameter designating the name of the channel for which status is requested
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, "TO.*");
// add a parameter designating the instance type (current) desired
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL);
responses = agent.send(request);
for (int j = 0; j < responses.length; j++) {
// get the channel name and trim the spaces
String temp ="";
temp = responses[j].getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME);
channelName = temp.trim();
int chlStatus = responses[j].getIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS);
//System.out.println("channel status: " + chlStatus);
String[] chStatusText = {
"", "MQCHS_BINDING", "MQCHS_STARTING", "MQCHS_RUNNING",
"MQCHS_STOPPING", "MQCHS_RETRYING", "MQCHS_STOPPED",
"MQCHS_REQUESTING", "MQCHS_PAUSED",
"", "", "", "", "MQCHS_INITIALIZING"
};
checkStatus = chStatusText[chlStatus];
//System.out.println("channel status: " + checkStatus);
}
System.out.println("chl: " + channelName + " STATUS: " + checkStatus + ")");
上面的代码给出了只有一个通道而不是所有通道的通道状态。这里有什么问题?
您是否在问如何将您返回的整数转换为运行(或其他状态),或者您在问如何从通道状态记录中获取其他信息以及运行状态? –
基本上我想写一个对应于下面的runmqsc dis chs(TO。*)的PCF命令,其中(STATUS eq RUNNING) – sijo0703