![[8.5.5.2 이상]](../ng_v8552.gif)

기본 JCA ResourceAdapter 구성 및 배치
JCA(Java™ EE Connector Architecture) ConnectionFactory 및 Resource Adapter를 구성하고 배치할 수 있습니다.
이 태스크 정보
프로시저
- server.xml 파일에서 JCA 기능을 사용하도록 설정하십시오. server.xml 파일은 [path_to_liberty\wlp\usr\servers\server_name]에 있습니다.
<server> <featureManager> <feature>jca-1.6</feature> <feature>servlet-3.0</feature> </featureManager> </server>
- 자원 어댑터 RAR 파일(ExampleRA.rar)을 서버의 드롭인 폴더에 넣으십시오. 서버가 실행 중인 경우, 콘솔 로그에 자원 어댑터가 설치되었음을 표시하는 다음과 같은 메시지가 표시됩니다.
[AUDIT ] J2CA7001I: Resource adapter ExampleRA installed in 1.306 seconds.
- 자원 어댑터에서 배치 디스크립터, 어노테이션 및 기타 문서를 검사하여
어댑터가 제공하는 자원 유형 및 각 어댑터가 승인하는 구성 특성을 식별하십시오. 예제 자원 어댑터인 ExampleRA.rar에는 ra.xml 배치 디스크립터에 있는
다음 정보가 있습니다. ra.xml 파일은 [path_to_ExampleRA\ExampleRA\META-INF]에 있습니다. 배치 디스크립터는
사용자가 구성할 수 있는 세 가지 유형의 자원을 식별합니다.
<connection-definition> <managedconnectionfactory-class>com.ibm.example.jca.adapter.ManagedConnectionFactoryImpl</managedconnectionfactory-class> <config-property> <config-property-name>tableName</config-property-name> <config-property-type>java.lang.String</config-property-type> </config-property> <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface> ... </connection-definition> <adminobject> <adminobject-interface>javax.resource.cci.ConnectionSpec</adminobject-interface> <adminobject-class>com.ibm.example.jca.adapter.ConnectionSpecImpl</adminobject-class> <config-property> <config-property-name>readOnly</config-property-name> <config-property-type>java.lang.Boolean</config-property-type> <config-property-value>false</config-property-value> </config-property> </adminobject> <adminobject> <adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface> <adminobject-class>com.ibm.example.jca.adapter.InteractionSpecImpl</adminobject-class> <config-property> <description>Function name. Supported values are: ADD, FIND, REMOVE</description> <config-property-name>functionName</config-property-name> <config-property-type>java.lang.String</config-property-type> </config-property> </adminobject>
- server.xml 파일에서 사용 가능한 자원 유형의 인스턴스를 구성하십시오.
<server> <featureManager> <feature>jca-1.6</feature> <feature>servlet-3.0</feature> </featureManager> <connectionFactory jndiName="eis/conFactory"> <properties.ExampleRA tableName="TABLE1"/> </connectionFactory> <adminObject jndiName="eis/conSpec"> <properties.ExampleRA.ConnectionSpec/> </adminObject> <adminObject jndiName="eis/iSpec_ADD"> <properties.ExampleRA.InteractionSpec functionName="ADD"/> </adminObject> <adminObject jndiName="eis/iSpec_FIND"> <properties.ExampleRA.InteractionSpec functionName="FIND"/> </adminObject> </server>
- 사용자의 서블릿에서 자원 인젝션을 사용하여 자원에 액세스하십시오. 예제:
@Resource(lookup = "eis/conFactory") private ConnectionFactory conFactory; @Resource(lookup = "eis/conSpec") private ConnectionSpec conSpec; @Resource(lookup = "eis/iSpec_ADD") private InteractionSpec iSpec_ADD; @Resource(lookup = "eis/iSpec_FIND") private InteractionSpec iSpec_FIND; ... MappedRecord input = conFactory.getRecordFactory().createMappedRecord("input"); input.put("city", "Rochester"); input.put("state", "Minnesota"); input.put("population", 106769); Connection con = conFactory.getConnection(conSpec); try { Interaction interaction = con.createInteraction(); interaction.execute(iSpec_ADD, input); interaction.close(); } finally { con.close(); }
참고: 인젝션을 사용하지 않고 네임스페이스에서 자원을 검색하려면 server.xml 파일에서 JNDI 기능을 사용하도록 설정해야 합니다.
하위 주제
JCA 구성 요소 개요
JCA(Java Platform, Enteprise Edition Connector Architecture) 기능은 연결 팩토리, 관리 오브젝트 및 활성화 스펙의 인스턴스를 정의하고 이 인스턴스를 설치된 자원 어댑터와 연관시키는 데 필요한 구성 요소를 제공합니다. 각각의 JCA 구성 요소는 최상위 레벨 요소와 하위 요소라는 두 개의 기본 파트로 구성되며 구성된 인스턴스를 위해 두 파트 모두 필요합니다.
상위 주제: 수동으로 Liberty 프로파일 관리

Information Center 이용 약관 | 피드백

http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=twlp_jca_config_dep
파일 이름: twlp_jca_config_dep.html