JCA 활성화 스펙 구성
JCA(Java EE Connector Architecture) 스펙을 준수하는 활성화 스펙을 구성할 수 있습니다.
이 태스크 정보
참고: Liberty에 대한 JCA 지원을 구성하려면 WebSphere® Application Server
Developer Tools for Eclipse의 서버 구성 편집기의 소스 보기 또는 다른 일부 문서 편집기를
사용하여 server.xml 파일을 편집해야 합니다. 이 주제에서는 MyAdapter라는 고유 ID가 있는 자원 어댑터가 이미 서버에 구성되어 있다고 가정하고
자원 어댑터 구성에 대한 문서에서 세부사항을 참조합니다. 기본 시나리오를 구성하는 엔드-투-엔드 예제는 다음 단계에서 제공됩니다.
참고: WebSphere®
Development Tools(WDT)의 디자인 보기에서는 연결 팩토리, 관리 오브젝트, 활성화 스펙 및 자원 어댑터에 대한
서버 구성의 특성 하위 요소를 편집할 수 없습니다.
프로시저
예
다음 예제를 사용하여 두 개의 메시지 리스너 유형과 고유한 인터페이스 클래스 이름을 가진 자원 어댑터를 구성하는 방법을 학습하십시오.
다음 스니펫은 ra.xml 파일에 있으며, MyAdapter 자원 어댑터는 고유한 인터페이스 클래스 이름과 두 개의 메시지 리스너 유형을 제공합니다.
<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.CCIActivationSpec</activationspec-class>
<config-property>
<config-property-name>maxSize</config-property-name>
<config-property-type>java.lang.Long</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
<messagelistener>
<messagelistener-type>com.vendor.adapter.MyMessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.MyActivationSpec</activationspec-class>
<config-property>
<config-property-name>messageFilter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
다음은 이 시나리오를 위한 서버 구성의 예제입니다. <activationSpec id="app1/module1/CCIMessageDrivenBean">
<properties.MyAdapter.MessageListener maxSize="1024"/>
</activationSpec>
<activationSpec id="app1/module1/MyMessageDrivenBean">
<properties.MyAdapter.MyMessageListener messageFilter="ALL"/>
</activationSpec>
다음 예제를 사용하여 두 개의 메시지 리스너 유형과 고유한 구현 클래스 이름을 가진 자원 어댑터를 구성하는 방법을 학습하십시오.
다음 스니펫은 ra.xml 파일에 있으며, MyAdapter 자원 어댑터는 고유한 구현 클래스 이름과 두 개의 메시지 리스너 유형을 제공합니다.
<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.CCIActivationSpec</activationspec-class>
<config-property>
<config-property-name>maxSize</config-property-name>
<config-property-type>java.lang.Long</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
<messagelistener>
<messagelistener-type>com.vendor.adapter.MessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.MyActivationSpec</activationspec-class>
<config-property>
<config-property-name>messageFilter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
다음은 이 시나리오를 위한 서버 구성의 예제입니다. <activationSpec id="app1/module1/CCIMessageDrivenBean">
<properties.MyAdapter.CCIActivationSpec maxSize="1024"/>
</activationSpec>
<activationSpec id="app1/module1/MyMessageDrivenBean">
<properties.MyAdapter.MyActivationSpec messageFilter="ALL"/>
</activationSpec>
다음 예제를 사용하여 두 개의 메시지 리스너 유형이 있고 단순 인터페이스와 구현 클래스 이름이 모두 고유하지 않은 자원 어댑터를 구성하는 방법을 학습하십시오.
다음 스니펫은 ra.xml 파일에 있으며, MyAdapter 자원 어댑터는 단순 인터페이스와 구현 클래스 이름이 둘 다 고유하지 않은 두 개의 메시지 리스너 유형을 제공합니다.
<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.cci.ActivationSpec</activationspec-class>
<config-property>
<config-property-name>maxSize</config-property-name>
<config-property-type>java.lang.Long</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
<messagelistener>
<messagelistener-type>com.vendor.adapter.MessageListener</messagelistener-type>
<activationspec>
<activationspec-class>com.vendor.adapter.ActivationSpec</activationspec-class>
<config-property>
<config-property-name>messageFilter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
...
</activationspec>
...
</messagelistener>
다음은 이 시나리오를 위한 서버 구성의 예제입니다. <activationSpec id="app1/module1/CCIMessageDrivenBean">
<properties.MyAdapter.javax.resource.cci.MessageListener maxSize="1024"/>
</activationSpec>
<activationSpec id="app1/module1/MyMessageDrivenBean">
<properties.MyAdapter.com.vendor.adapter.MessageListener messageFilter="ALL"/>
</activationSpec>
구성 요소 이름의 접미부를 대체할 수 있습니다. 구성 요소 이름의 접미부를 대체하는 방법에 대해 학습하려면 JCA 구성 요소 사용자 정의에 대한 정보를 참조하십시오.