0

WAS 6.1 ベースのアプリケーションを WAS 7.0 に移行する作業を行っています。以下の 2 つのステートメントを見つけました。

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

MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); // 2
  1. 行番号 1securityExit非推奨であり、ドキュメントには次のように記載されています。

    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. 行番号 2JMSC非推奨です。ドキュメントは次のように述べています。

    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メソッドは、アプリケーションとキュー マネージャーが共有メモリ、ソケット、または HTTP などを介して通信するかどうか、アプリケーションが WMQ キュー マネージャーに接続する方法を決定します。このメソッドの可能な値は、ここで定義されています。

于 2013-04-09T15:32:20.507 に答える