定制 JCA 配置元素
您可以定制在安装资源适配器时如何生成 JCA properties 子元素。
关于此任务
注:
要为 Liberty 添加 JCA 支持,必须使用 WebSphere®® Application Server Developer Tools for Eclipse 的服务器配置编辑器的“源代码”视图或某个其他文本编辑器来编辑 server.xml 文件。Beta 中不支持在“设计”视图中编辑连接工厂、管理对象、激活规范和资源适配器的配置的部分。
过程
- 对于独立资源适配器,使用要定制的现有配置启动。 例如,如果 MyAdapter 资源适配器提供了两种连接工厂,且这两种连接工厂的简单接口类名或实现类名均不唯一:
<featureManager> <feature>jca-1.6</feature> <feature>jndi-1.0</feature> <!-- Add the jndi feature to enable look up of connection factories and administered objects. --> ... </featureManager> <resourceAdapter location="C:/adapters/MyAdapter.rar"/> <connectionFactory jndiName="eis/cci-cf"> <properties.MyAdapter.javax.resource.cci.ConnectionFactory serverName="localhost"/> </connectionFactory> <connectionFactory jndiName="eis/custom-cf"> <properties.MyAdapter.com.vendor.adapter.custom.ConnectionFactory hostName="localhost"/> </connectionFactory>
- 将 customize 子元素添加到 resourceAdapter,以便为两种连接工厂接口选择后缀。
<featureManager> <feature>jca-1.6</feature> <feature>jndi-1.0</feature> <!-- Add the jndi feature to enable look up of connection factories and administered objects. --> ... </featureManager> <resourceAdapter location="C:/adapters/MyAdapter.rar"> <customize interface="javax.resource.cci.ConnectionFactory" suffix="cci"/> <customize interface="com.vendor.adapter.custom.ConnectionFactory" suffix="custom"/> </resourceAdapter> <connectionFactory jndiName="eis/cci-cf"> <properties.MyAdapter.cci serverName="localhost"/> </connectionFactory> <connectionFactory jndiName="eis/custom-cf"> <properties.MyAdapter.custom hostName="localhost"/> </connectionFactory>
- 对于应用程序中嵌入的资源适配器,使用要定制的现有配置启动。 例如,假设您有一个应用程序 app1 包含名为 MyAdapter 的嵌入式资源适配器,如下所示:
<featureManager> <feature>jca-1.6</feature> <feature>jndi-1.0</feature> <!-- Add the jndi feature to enable look up of connection factories and administered objects. --> ... </featureManager> <application name="app1" type="ear" location="C:/applications/app1.ear"/> <adminObject jndiName="eis/interactionSpec-find"> <properties.app1.MyAdapter.javax.resource.cci.InteractionSpec-com.vendor.adapter.finder.InteractionSpecImpl resultSetType="1003"/> </adminObject> <adminObject jndiName="eis/interactionSpec-update"> <properties.app1.MyAdapter.com.vendor.adapter.InteractionSpec-com.vendor.adapter.updater.InteractionSpecImpl executionTimeout="3000"/> </adminObject>
- 针对应用程序中的资源适配器归档 (RAR) 模块指定 resourceAdapter 元素。指定 id 属性作为 RAR 模块的模块名称。添加 customize 子元素,以便为基于接口类或实现类的两种受管对象选择后缀。 在此示例中,仅指定实现类,这足以识别受管对象:
<featureManager> <feature>jca-1.6</feature> <feature>jndi-1.0</feature> <!-- Add the jndi feature to enable look up of connection factories and administered objects. --> ... </featureManager> <application name="app1" type="ear" location="C:/applications/app1.ear"> <resourceAdapter id="MyAdapter"> <customize implementation="com.vendor.adapter.finder.InteractionSpecImpl" suffix="finder"/> <customize implementation="com.vendor.adapter.updater.InteractionSpecImpl" suffix="updater"/> </resourceAdapter> </application> <adminObject jndiName="eis/interactionSpec-find"> <properties.app1.MyAdapter.finder resultSetType="1003"/> </adminObject> <adminObject jndiName="eis/interactionSpec-update"> <properties.app1.MyAdapter.updater executionTimeout="3000"/> </adminObject>
父主题: JCA 配置元素概述


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=twlp_jca_config_custelements
文件名:twlp_jca_config_custelements.html