• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MQException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.mq.MQException的典型用法代码示例。如果您正苦于以下问题:Java MQException类的具体用法?Java MQException怎么用?Java MQException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MQException类属于com.ibm.mq包,在下文中一共展示了MQException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPCFAgent

import com.ibm.mq.MQException; //导入依赖的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());
       }
   }
 
开发者ID:ibm-messaging,项目名称:mq-event-display,代码行数:22,代码来源:Xmqdspev.java


示例2: setRequestMQMD

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Sets the request mqmd.
 *
 * @param message the message
 * @return the MQ message
 * @throws MQException the MQ exception
 */
protected MQMessage setRequestMQMD(MQMessage message) throws MQException {
	if (qmanager_level < 500){
		message.setVersion(1);
	}
	message.messageType = 1;
	message.expiry = expiryTime;
	message.report = 64;
	message.feedback = 0;
	message.format = "MQADMIN ";
	message.encoding = encoding;
	message.characterSet = 0;
	message.replyToQueueName = replyQueue.name;
	message.replyToQueueManagerName = "";
	message.persistence = 0;
	return message;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:24,代码来源:Agent.java


示例3: initialize

import com.ibm.mq.MQException; //导入依赖的package包/类
public void initialize(MQMessage message) throws MQException, IOException {
	int type = message.readInt();

	if (type != 4) {
		throw new MQException(2, 3013, message);
	}

	this.strucLength = message.readInt();
	this.parameter = message.readInt();
	this.codedCharSetId = message.readInt();
	this.stringLength = message.readInt();
	this.string = ParameterHeader.readString(message, this.stringLength);

	if (this.stringLength < 0) {
		throw new MQException(2, 3011, message);
	}

	if (this.strucLength < 20 + this.stringLength) {
		throw new MQException(2, 3010, message);
	}

	int padLength = this.strucLength - 20 - this.stringLength;

	while (padLength-- > 0)
		message.readByte();
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:27,代码来源:ParameterString.java


示例4: initialize

import com.ibm.mq.MQException; //导入依赖的package包/类
public void initialize(MQMessage message) throws MQException, IOException {
	if (message.readInt() != 5) {
		throw new MQException(2, 3013, message);
	}

	this.strucLength = message.readInt();
	this.parameter = message.readInt();
	this.count = message.readInt();

	if (this.count < 0) {
		throw new MQException(2, 3027, message);
	}

	if (this.strucLength != 16 + this.count * 4) {
		throw new MQException(2, 3028, message);
	}

	this.values = new int[this.count];

	for (int i = 0; i < this.count; i++)
		this.values[i] = message.readInt();
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:23,代码来源:ParameterIntArray.java


示例5: fetchStats

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Fetch stats.
 *
 * @return the map
 */
public synchronized Map<Integer,Object> fetchStats(){
	Map<Integer,Object> stats = new HashMap<Integer,Object>();
	try {
		
		MQEnvironment.disableTracing();
		MQException.log = null;
		
		if(agentNode==null){
			agentNode = new Agent(queueConfig.getHost(),queueConfig.getPort(),queueConfig.getChannel(),queueConfig.getManager());
		}

		Parameter[] params = new Parameter[]{ new ParameterString(MQCA_Q_NAME, queueConfig.getName())};
		
		// Requerido para obtener profundidades de cola
		exec(agentNode.send(MQCMD_INQUIRE_Q, params),stats);
		
		// Requerido para obtener entrada y salida de mensajes
		exec(agentNode.send(MQCMD_RESET_Q_STATS, params),stats);

	} catch (Exception ex) {
		log.error(ex);
	} 
	return stats;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:30,代码来源:JMQQueue.java


示例6: IBMMQProvisioningProvider

import com.ibm.mq.MQException; //导入依赖的package包/类
public IBMMQProvisioningProvider(ConnectionFactory connectionFactory,
		IBMMQConfigurationProperties configurationProperties, DestinationNameResolver destinationNameResolver)
		throws MQException {
	this.destinationNameResolver = destinationNameResolver;

	this.ibmMQRequests = new IBMMQRequests(connectionFactory, configurationProperties);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-ibm-mq,代码行数:8,代码来源:IBMMQProvisioningProvider.java


示例7: IBMMQRequests

import com.ibm.mq.MQException; //导入依赖的package包/类
public IBMMQRequests(ConnectionFactory connectionFactory,
		IBMMQConfigurationProperties configurationProperties) {
	this.connectionFactory = connectionFactory;
	this.configurationProperties = configurationProperties;

	try {
		this.queueManager = new MQQueueManager(
				configurationProperties.getQueueManager());
	}
	catch (MQException e) {
		throw new RuntimeException(
				String.format("Could not create MQ Queue Manager object for '%s'",
						configurationProperties.getQueueManager()));
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-ibm-mq,代码行数:16,代码来源:IBMMQRequests.java


示例8: displayChannel_Auto_Definition_Error

import com.ibm.mq.MQException; //导入依赖的package包/类
private String displayChannel_Auto_Definition_Error(PCFMessage pcfMsg)
	throws PCFException {

	int channelType = pcfMsg.getIntParameterValue(CMQCFC.MQIACH_CHANNEL_TYPE);

	xw.println("     ReasonCode: " + pcfMsg.getReason());
	xw.println("      EventName: Channel Auto-Definition Error - MQRC_CHANNEL_AUTO_DEF_ERROR (2234, X'8BA')");
	xw.println("      EventType: Channel");
	xw.println("    Description: This condition is detected when the automatic definition of a channel");
	xw.println("                 fails; this may be because an error occurred during the definition");
	xw.println("                 process, or because the channel automatic-definition exit inhibited");
	xw.println("                 the definition. Additional information indicating the reason for the");
	xw.println("                 failure is returned in the event message.");
	xw.println("       QMgrName: " + pcfMsg.getStringParameterValue(CMQC.MQCA_Q_MGR_NAME));
	xw.println("    ChannelName: " + pcfMsg.getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME));
	xw.print("    ChannelType: " + channelType + " (");
	
	switch (channelType) {
		case CMQXC.MQCHT_RECEIVER: 
			xw.println("MQCHT_RECEIVER)");
			break;
		case CMQXC.MQCHT_SVRCONN: 
			xw.println("MQCHT_SVRCONN)");
			break;
		case CMQXC.MQCHT_CLUSSDR: 
			xw.println("MQCHT_CLUSSDR)");
			break;
		default:
			xw.println("Unknown!)");
	} // end switch

	xw.println("ErrorIdentifier: " + pcfMsg.getIntParameterValue(CMQCFC.MQIACF_ERROR_IDENTIFIER));
	xw.println(" ConnectionName: " + pcfMsg.getStringParameterValue(CMQCFC.MQCACH_CONNECTION_NAME));
	
	try {
		xw.println(" AuxErrDataInt1: " + pcfMsg.getIntParameterValue(CMQCFC.MQIACF_AUX_ERROR_DATA_INT_1));
	} catch (MQException mqe) {;}
	
	return rtrim(pcfMsg.getStringParameterValue(CMQC.MQCA_Q_MGR_NAME)) + " - " + pcfMsg.getReason() + " - " + pcfReasonToString(pcfMsg.getReason()) + " ==> " + pcfMsg.getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME);
}
 
开发者ID:ibm-messaging,项目名称:mq-event-display,代码行数:41,代码来源:Xmqdspev.java


示例9: ptpSender

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * 点到点客户机程序将创建一个简单的消息并发送它到WebSphere MQ 队列
 * 
 * 步骤如下: 调入WebSphere MQ Java API package; 为客户机连接设置环境属性; 连接到队列管理器;
 * 为打开WebSphere MQ 队列设置选项; 为发送消息打开应用程序队列; 设置选项, 放置消息到应用程序队列上; 创建消息缓冲区;
 * 使用用户数据和任何消息描述器字段准备消息; 放置消息到队列上。
 * 
 * @param args
 */
public static void ptpSender() {
	try {

		/* 设置MQEnvironment 属性以便客户机连接 */
		MQEnvironment.hostname = hostName;
		MQEnvironment.channel = channel;
		MQEnvironment.port = port;
		MQEnvironment.CCSID = CCSID;
		// MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
		// MQC.TRANSPORT_MQJD);

		/* 连接到队列管理器 */
		MQQueueManager qMgr = new MQQueueManager(qManager);

		/* 设置打开选项以便打开用于输出的队列,如果队列管理器正在停止,我们也已设置了选项去应对不成功情况。 */
		int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;

		/* 打开队列 */
		MQQueue queue = qMgr.accessQueue(qName, openOptions, null, null, null);

		/* 设置放置消息选项,我们将使用默认设置 */
		MQPutMessageOptions pmo = new MQPutMessageOptions();

		/* 创建消息缓冲区,MQMessage 类包含实际消息数据的数据缓冲区,和描述消息的所有MQMD 参数 */
		MQMessage outMsg = new MQMessage();
		/* 设置MQMD 格式字段 */
		outMsg.format = MQC.MQFMT_STRING;
		/* 准备用户数据消息 */
		String msgString = "Test Message from PtpSender program ";
		outMsg.writeString(msgString);

		/* 在队列上放置消息 */
		queue.put(outMsg, pmo);

		/* 提交事务处理 */
		qMgr.commit();
		System.out.println(" The message has been Successfully put!\n");

		/* 关闭队列和队列管理器对象 */
		queue.close();
		qMgr.disconnect();
	} catch (MQException ex) {
		System.out.println("An MQ Error Occurred: Completion Code is :\t" + ex.completionCode + "\n\n The Reason Code is :\t" + ex.reasonCode);
		ex.printStackTrace();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:dreajay,项目名称:jcode,代码行数:58,代码来源:Ptp.java


示例10: buildManager

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Builds the manager.
 *
 * @param host the host
 * @param port the port
 * @param channel the channel
 * @param manager the manager
 * @return the MQ queue manager
 * @throws MQException the MQ exception
 */
public static MQQueueManager buildManager(String host,int port,String channel,String manager) throws MQException{
	Hashtable<String,Object> mqProps = new Hashtable<String,Object>();

	if(host != null){
		mqProps.put("hostname", host);
	}
	if(port >0 ){
		mqProps.put("port",port);
	}
	if(channel != null){
		mqProps.put("channel", channel);
	}
	return new MQQueueManager(manager,mqProps);
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:25,代码来源:MQUtils.java


示例11: open

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Open.
 *
 * @throws MQException the MQ exception
 */
protected synchronized void open() throws MQException {
	adminQueue = qmanager.accessQueue(qmanager.getCommandInputQueueName(), 8208, null, "", "mqm");
	replyQueue = qmanager.accessQueue(modelQueueName, 8196, "", null, "mqm");
	replyQueue.closeOptions = 2;
	getBasicQmgrInfo(qmanager, true);
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:12,代码来源:Agent.java


示例12: disconnect

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Disconnect.
 *
 * @throws MQException the MQ exception
 */
public synchronized void disconnect() throws MQException { 
	if(adminQueue!=null && adminQueue.isOpen()){
		adminQueue.close();
	}
	if(replyQueue!=null && replyQueue.isOpen()){
		replyQueue.close();
	}
	if(qmanager!=null){
		qmanager.disconnect();		
	}
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:17,代码来源:Agent.java


示例13: isLast

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Checks if is last.
 *
 * @param response the response
 * @return true, if is last
 * @throws MQException the MQ exception
 * @throws IOException Signals that an I/O exception has occurred.
 */
boolean isLast(MQMessage response) throws MQException, IOException {
	cfh.initialize(response);
	boolean result = false;
	if(TYPE_390 == type){
		String current = null;
		int count = cfh.parameterCount;
		while (count-- > 0) {
			Parameter p = Parameter.nextParameter(response);
			int id = p.getParameter();
			if (id == 7003) {
				set.add(p.getStringValue());
			} else if (id == 7004) {
				set.add(current = p.getStringValue());
			}
		}
		response.seek(0);
		if ((cfh.control == 1) && (current != null)) {
			set.remove(current);
		}
		result = set.size() == 0;
	}else{
	    response.seek(0);
	    result= cfh.control == 1;
	}
	return result;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:35,代码来源:AgentResponseTracker.java


示例14: nextParameter

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Next parameter.
 *
 * @param message the message
 * @return the parameter
 * @throws MQException the MQ exception
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static Parameter nextParameter(MQMessage message) throws MQException, IOException {
	message.writeBytes("");
	int pos = message.getDataOffset();
	int type = message.readInt();
	message.seek(pos);

	switch (type) {
	case 3:
		return new ParameterInt(message);
	case 5:
		return new ParameterIntArray(message);
	case 4:
		return new ParameterString(message);
	case 6:
	case 9:
	case 23:
	case 25:
	case 20:
	case 13:
	case 14:
	case 15:
	case 7:
	case 8:
	case 10:
	case 11:
	case 12:
	case 16:
	case 17:
	case 18:
	case 19:
	case 21:
	case 22:
	case 24:
	}
	throw new MQException(2, 3013, message);
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:45,代码来源:Parameter.java


示例15: initialize

import com.ibm.mq.MQException; //导入依赖的package包/类
public void initialize(MQMessage message) throws MQException, IOException {
	if (message.readInt() != 3) {
		throw new MQException(2, 3013, message);
	}

	if (message.readInt() != 16) {
		throw new MQException(2, 3009, message);
	}

	this.parameter = message.readInt();
	this.value = message.readInt();
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:13,代码来源:ParameterInt.java


示例16: JMQQueue

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Instantiates a new JMQ queue.
 *
 * @param jmqmanager the jmqmanager
 * @param queuename the queuename
 * @param i the i
 * @throws MQException the MQ exception
 */
private JMQQueue(MQQueueManager jmqmanager, String queuename, int i) throws MQException {
	super(jmqmanager, queuename, i, null, null, null);
	jmqMgr = jmqmanager;
	listeners = new ArrayList<MessageReadedListener>();
	jmqMessages = new ArrayList<JMQMessage>();
	getMsgOpt = new MQGetMessageOptions();
	getMsgOpt.options = 16;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:17,代码来源:JMQQueue.java


示例17: getJMQMessage

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Gets the JMQ message.
 *
 * @param i the i
 * @return the JMQ message
 * @throws MQException the MQ exception
 */
public JMQMessage getJMQMessage(int i) throws MQException {
	JMQMessage jmqmessage = null;
	jmqmessage = new JMQMessage(this, i);
	get(jmqmessage, getMsgOpt);
	getMsgOpt.options = 32;
	jmqMessages.add(jmqmessage);
	return jmqmessage;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:16,代码来源:JMQQueue.java


示例18: getInfo

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Gets the info.
 *
 * @return the info
 * @throws MQException the MQ exception
 */
public String getInfo() throws MQException {
	StringBuffer stringbuffer = new StringBuffer();
	stringbuffer.append("Name: ").append(queueConfig.getName());
	stringbuffer.append("\n");
	stringbuffer.append("QueueManager: ").append(queueConfig.getManager());
	stringbuffer.append("\n");
	stringbuffer.append("CreationDateTime: ").append( getCreationDateTime().getTime() );
	return stringbuffer.toString();
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:16,代码来源:JMQQueue.java


示例19: toString

import com.ibm.mq.MQException; //导入依赖的package包/类
public String toString() {
	String s;
	try {
		s = queueConfig.getName() + " (currDepth: " + getCurrentDepth() + ")";
	} catch(MQException mqexception) {
		log.error(mqexception);
		s = "ERROR: " + queueConfig.getName();
	}
	return s;
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:11,代码来源:JMQQueue.java


示例20: exec

import com.ibm.mq.MQException; //导入依赖的package包/类
/**
 * Exec.
 *
 * @param responses the responses
 * @param fetch the fetch
 * @throws MQException the MQ exception
 * @throws IOException Signals that an I/O exception has occurred.
 */
private void exec(List<MQMessage> responses,Map<Integer,Object> fetch) throws MQException, IOException{
	ParameterMessage cfh = null;
	for(MQMessage response:responses){
		cfh = new ParameterMessage (response); 
		if (cfh.reason == 0){
			if(fetch!=null){
				for (int j = 0; j < cfh.parameterCount; j++) { 
					Parameter p = Parameter.nextParameter(response);
					fetch.put(p.getParameter(), p.getValue());
				}
			}
		}
	}
}
 
开发者ID:dubasdey,项目名称:MQQueueMonitor,代码行数:23,代码来源:JMQQueue.java



注:本文中的com.ibm.mq.MQException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntityPig类代码示例发布时间:2022-05-23
下一篇:
Java DatabaseSession类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap