本文整理汇总了Java中com.ibm.mq.pcf.PCFMessageAgent类的典型用法代码示例。如果您正苦于以下问题:Java PCFMessageAgent类的具体用法?Java PCFMessageAgent怎么用?Java PCFMessageAgent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PCFMessageAgent类属于com.ibm.mq.pcf包,在下文中一共展示了PCFMessageAgent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createQueue
import com.ibm.mq.pcf.PCFMessageAgent; //导入依赖的package包/类
public void createQueue(String name) throws Exception {
if ( usingJNDI ) {
// Assumes use of ME01 SupportPac for WMQInitialContextFactory
Queue queue = configureMQQueue( new MQQueue(name) );
try {
getInitialContext().bind( name, queue );
} catch ( NameAlreadyBoundException e ) {
// No op - already exists
}
} else {
// "new" PCF style.
PCFMessageAgent agent = new PCFMessageAgent( Config.parms.getString("jh"), Config.parms.getInt("jp"), "CLIENT" );
PCFMessage message = new PCFMessage( CMQCFC.MQCMD_CREATE_Q );
message.addParameter( CMQC.MQCA_Q_NAME, name);
agent.send( message );
}
}
示例2: createPCFAgent
import com.ibm.mq.pcf.PCFMessageAgent; //导入依赖的package包/类
private void createPCFAgent(MQQueueManager qmgr) {
try
{
if(debugMode)
xw.println("Creating PCF Message Agent for queue manager '" + qmgrName + "'...");
pcfAgent = new PCFMessageAgent(qmgr);
if(debugMode)
xw.println("PCF Message Agent reply queue name is '" + pcfAgent.getReplyQueueName() + "'...");
}
catch(PCFException pcfe)
{
System.err.println("PCF Message Agent creation ended with reason code " + pcfe.reasonCode + " (PCFExeption)");
System.err.println(pcfe.getLocalizedMessage());
}
catch(MQException mqe)
{
System.err.println("PCF Message Agent creation ended with reason code " + mqe.reasonCode + " (MQException)");
System.err.println(mqe.getLocalizedMessage());
}
}
示例3: deleteQueue
import com.ibm.mq.pcf.PCFMessageAgent; //导入依赖的package包/类
/**
** delete a queue on the provider. differs from deleting a jms queue.
** unbind the associated admin object from the jndi store.
*/
public void deleteQueue(String name) throws Exception {
if ( usingJNDI ) {
// Assumes use of ME01 SupportPac for WMQInitialContextFactory
System.setProperty( "MQJMS_PURGE_ON_DELETE", "yes" );
unbind( name );
} else {
// "new" PCF style.
PCFMessageAgent agent = new PCFMessageAgent( Config.parms.getString("jh"), Config.parms.getInt("jp"), "CLIENT" );
PCFMessage message = new PCFMessage( CMQCFC.MQCMD_DELETE_Q );
message.addParameter( CMQC.MQCA_Q_NAME, name);
message.addParameter( CMQCFC.MQIACF_PURGE, CMQCFC.MQPO_YES );
agent.send( message );
}
}