0

我正在将基于 WAS 6.1 的应用程序迁移到 WAS 7.0 我发现以下两个语句

com.ibm.mq.MQEnvironment.securityExit = null; // 1

MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); // 2
  1. 在第 1 行securityExit弃用,文档说:

    The security exit used when connecting to a queue manager. It allows you to customise the security flows that occur when an attempt is made to connect to a queue manager. If you want to provide your own security exit, define a class that implements the MQSecurityExit interface and assign securityExit to an instance of that class. If you set this field to null no security exit is called.

    我从中了解到的是com.ibm.mq.MQSecurityExit需要实现接口。将 securityExit 分配给该类的实例是什么意思?

  2. 第 2 行JMSC弃用。医生说:

    This parameter can be passed to MQConnectionFactory.setTransportType(int) to indicate that the application should connect to the queue manager in client TCP/IP mode.

    对于界面,文档还说:

    Use the constants defined in the classes in the com.ibm.mq.constants package instead

    com.ibm.mq.constants的文档没有多大帮助。

感谢您在替换已弃用的语句方面的任何帮助。

4

1 回答 1

0

这意味着您需要创建 MQSecurityExit 类的实现实例并设置安全出口属性。像这样的东西

   // in MySecurityExit.java
   class MySecurityExit implements MQSecurityExit 
   {
       // you must provide an implementation of the securityExit method
       public byte[] securityExit(MQChannelExit       channelExitParms,
                                  MQChannelDefinition channelDefinition,
                                  byte[]              agentBuffer)
       {
           // your exit code goes here...
       }
   }

   // in your main program...
   MQEnvironment.securityExit = new MySecurityExit();
   ...    // other initialisation
   MQQueueManager qMgr        = new MQQueueManager("");

setTransportType方法确定您的应用程序如何连接到 WMQ 队列管理器,应用程序和队列管理器是否通过共享内存或套接字或 HTTP 等进行通信。此方法的可能值在此处定义

于 2013-04-09T15:32:20.507 回答