本文整理匯總了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 );
}
}