Class JndiLookingUpJmsMessagingProvider

java.lang.Object
nablarch.fw.messaging.provider.JmsMessagingProvider
nablarch.fw.messaging.provider.JndiLookingUpJmsMessagingProvider
All Implemented Interfaces:
MessagingProvider

public class JndiLookingUpJmsMessagingProvider extends JmsMessagingProvider
ConnectionFactoryおよびQueueをJNDIから取得する MessagingProvider実装クラス。
リソースの取得をJNDIから行う以外は、JmsMessagingProviderと同様。 設定例をいかに示す。
 
 <!-- メッセージングプロバイダ定義 -->
 <component name="messagingProvider"
          class="nablarch.fw.messaging.provider.JndiLookingUpJmsMessagingProvider">
   <!-- 本クラス独自のプロパティ(JNDI関連)-->
   <!-- JNDIルックアップのための情報 -->
   <property name="jndiHelper">
     <component class="nablarch.core.repository.jndi.JndiHelper">
       <property name="jndiProperties">
         <map>
            <entry key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory"/>
            <entry key="java.naming.provider.url"    value="t3://weblogic.server.125:7001"/>
         </map>
       </property>
     </component>
   </property>
   <!-- jakarta.jms.ConnectionFactory実装クラスをルックアップするためのJNDI名 -->
   <property name="connectionFactoryJndiName" value="jakarta.jms.QueueConnectionFactory"/>

   <!-- FWで使用するキュー論理名と、jakarta.jms.Queue実装クラスをルックアップするためのJNDI名のペア -->
   <property name="destinationNamePairs">
     <map>
       <!-- key=キュー論理名、value=キューJNDI名 -->
       <entry key="TEST.REQUEST"  value="TEST.REQUEST"/>
       <entry key="TEST.RESPONSE" value="TEST.RESPONSE"/>
     </map>
   </property>
   <!-- その他のプロパティは親クラス(JmsMessagingProvider)と同じ -->
 </component>
 
 
See Also:
  • Constructor Details

    • JndiLookingUpJmsMessagingProvider

      public JndiLookingUpJmsMessagingProvider()
  • Method Details

    • createContext

      public MessagingContext createContext()
      メッセージングコンテキストを返す。 この実装では、コネクションファクトリからJMSコネクションを取得し、 新規セッションを作成する。
      Specified by:
      createContext in interface MessagingProvider
      Overrides:
      createContext in class JmsMessagingProvider
      Returns:
      メッセージングコンテキスト
    • setJndiHelper

      public JndiLookingUpJmsMessagingProvider setJndiHelper(JndiHelper jndiHelper)
      JNDIサポートクラスを設定する。
      Parameters:
      jndiHelper - JNDIサポートクラス
      Returns:
      本インスタンス
    • setDestinationNamePairs

      public JndiLookingUpJmsMessagingProvider setDestinationNamePairs(Map<String,String> pairs)
      key=キュー論理名、value=キューJNDI名をペアにしたMapを設定する。
      このMapは、QueueをJNDIから取得する際に使用される。 value(キューJNDI名)からQueueがルックアップされ、 key(キュー論理名)と紐付けられて、JmsMessagingProviderに設定される。
      Parameters:
      pairs - key=キュー論理名、value=キューJNDI名をペアにしたMap
      Returns:
      本インスタンス
    • setConnectionFactoryJndiName

      public JndiLookingUpJmsMessagingProvider setConnectionFactoryJndiName(String connectionFactoryJndiName)
      ConnectionFactoryをJNDIから取得するためのJNDI名を設定する。
      Parameters:
      connectionFactoryJndiName - ConnectionFactoryのJNDI名
      Returns:
      本インスタンス