<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources">Infinispan Data Sources</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~rareddy">Ramesh Reddy</a>
    </h4>
        <br/>
                         <h4>Changes (20)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1. {color:#000000}{*}Infinispan Data Sources{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1. *Infinispan Data Sources* <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Infinispan</span> data sources use a Teiid specific JCA connector &quot;teiid-connector-infinispan.rar&quot;, which is deployed into the AS7.x during installation. <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">&amp;nbsp;This</span> <span class="diff-added-words"style="background-color: #dfd;"> This</span> connector can be configured to support the following modes of Infinispan <span class="diff-changed-words">caches:<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >|| Cache Type || Obtain Cache By || <br>| Local Cache | using JNDI | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The following are the configuration properties that can be configured for this connector: <br>|| *Property Name* || *Req.* || *Property Template* || *Description* || <br></td></tr>
            <tr><td class="diff-changed-lines" >| CacheTypeMap | Y | <span class="diff-changed-words">cacheName:className\[;pkFieldName\]<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">&amp;nbsp;</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >\[,cacheName:className\[;pkFieldName\]..\] | Map the root Java Object class name to the cache, and identify which attribute is the primary key to the cache. | <br>| module | N | | Specify the JBoss AS module that contains the cache classes that were defined in CacheTypeMap | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| ConfigurationFileNameForLocalCache | N | | The Infinispan Configuration xml file for configuring a local cache | <br>| HotRodClientPropertiesFile | N | | The HotRod properties file for configuring a connection to a remote cache | <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">&amp;nbsp;&amp;nbsp;</span> <span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>There</span> are many ways to create the data source, using <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">CLI,&amp;nbsp;{color}[AdminShell]{color:#333333},</span> <span class="diff-added-words"style="background-color: #dfd;">CLI, [AdminShell],</span> admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain <span class="diff-changed-words">modes.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Execute</span> following command <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">using&amp;nbsp;[CLI|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI]{color}{color:#333333}&amp;nbsp;once</span> <span class="diff-added-words"style="background-color: #dfd;">using [CLI|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI] once</span> you connected to the Server. Make sure you provide the correct directory name and other properties below. Add any additional properties required by the connector by duplicating the &quot;connection-definitions&quot; command below. Edit the JNDI name to match the JNDI name you used in <span class="diff-changed-words">VDB.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code}batch <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">/subsystem=resource-adapters/resource-adapter=infinispanDS:add(archive=teiid-connector-infinispan.rar, transaction-support=NoTransaction){color} <br>/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true){color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true) <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">/subsystem=resource-adapters/resource-adapter=infinispanDS/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId){color}</span> <span class="diff-added-words"style="background-color: #dfd;">/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">/subsystem=resource-adapters/resource-adapter=infinispan<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">DS</span>/connection-definitions=infinispanDS/config-properties=Module:add(value=org.somewhere)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">/subsystem=resource-adapters/resource-adapter=infinispan<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">DS</span>/connection-definitions=infinispanDS/config-properties=CacheJndiName:add(value=java:/myCache)</span> <br></td></tr>
            <tr><td class="diff-unchanged" >runbatch <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br>\\ <br>{info} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>To</span> find out all the properties that are supported by this File Connector execute the following command in the <span class="diff-changed-words">CLI.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{code}<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">/subsystem=teiid:read-rar-description(rar-name=teiid-connector-infinispan.rar){code}{color:#333333}&amp;nbsp;{color}{info}</span></span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}&amp;nbsp;{color}</span> <span class="diff-added-words"style="background-color: #dfd;">/subsystem=teiid:read-rar-description(rar-name=infinispan)</span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{warning}</span> <span class="diff-added-words"style="background-color: #dfd;">{code}</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}As of AS 7.1 CR1b release the above does not work without restarting the Server. This issue will be fixed before 7.2 Final.{color}{warning} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}&amp;nbsp;{color}</span> <span class="diff-added-words"style="background-color: #dfd;">{info}</span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{tip:title=Developer&#39;s Tip} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>If</span> the JBoss AS 7.x is running in standalone mode, you can also manually edit the &quot;&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml&quot; file and add the XML configuration defined in &quot;&lt;jboss-install&gt;/docs/teiid/datasources/infinispan&quot; directory under &quot;resource-adapters&quot; subsystem. Shutdown the server before you edit this file, and restart after the modifications are <span class="diff-changed-words">done.{<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">color}{</span>tip}</span> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="InfinispanDataSources-InfinispanDataSources"></a><b>Infinispan Data Sources</b></h1>

<p>Infinispan data sources use a Teiid specific JCA connector "teiid-connector-infinispan.rar", which is deployed into the AS7.x during installation.  This connector can be configured to support the following modes of Infinispan caches:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Cache Type </th>
<th class='confluenceTh'> Obtain Cache By </th>
</tr>
<tr>
<td class='confluenceTd'> Local Cache </td>
<td class='confluenceTd'> using JNDI </td>
</tr>
<tr>
<td class='confluenceTd'> Local Cache </td>
<td class='confluenceTd'> using configuration file </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> using JNDI </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> specify 1 or more host:port's </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> specify HotRod client properties file </td>
</tr>
</tbody></table>
</div>


<p>The following are the configuration properties that can be configured for this connector:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> <b>Property Name</b> </th>
<th class='confluenceTh'> <b>Req.</b> </th>
<th class='confluenceTh'> <b>Property Template</b> </th>
<th class='confluenceTh'> <b>Description</b> </th>
</tr>
<tr>
<td class='confluenceTd'> CacheTypeMap </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'> cacheName:className[;pkFieldName]  <br class="atl-forced-newline" />
[,cacheName:className[;pkFieldName]..] </td>
<td class='confluenceTd'> Map the root Java Object class name to the cache, and identify which attribute is the primary key to the cache. </td>
</tr>
<tr>
<td class='confluenceTd'> module </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specify the JBoss AS module that contains the cache classes that were defined in CacheTypeMap </td>
</tr>
<tr>
<td class='confluenceTd'> CacheJndiName </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> JNDI name to fine the CacheContainer </td>
</tr>
<tr>
<td class='confluenceTd'> RemoteServerList </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'> host:port[;host:port….] </td>
<td class='confluenceTd'> Specify the host and ports that will be clustered together to access the caches defined in CacheTypeMap </td>
</tr>
<tr>
<td class='confluenceTd'> ConfigurationFileNameForLocalCache </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The Infinispan Configuration xml file for configuring a local cache </td>
</tr>
<tr>
<td class='confluenceTd'> HotRodClientPropertiesFile </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The HotRod properties file for configuring a connection to a remote cache </td>
</tr>
</tbody></table>
</div>



<p>There are many ways to create the data source, using CLI, <a href="/author/display/TEIID/AdminShell" title="AdminShell">AdminShell</a>, admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.</p>

<p>Execute following command using <a href="https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI" class="external-link" rel="nofollow">CLI</a> once you connected to the Server. Make sure you provide the correct directory name and other properties below. Add any additional properties required by the connector by duplicating the "connection-definitions" command below. Edit the JNDI name to match the JNDI name you used in VDB.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">batch
/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS:add(jndi-name=java:/infinispanDS, class-name=org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS/config-properties=CacheTypeMap:add(value=trades:org.somewhere.Trade;tradeId)
/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS/config-properties=Module:add(value=org.somewhere)
/subsystem=resource-adapters/resource-adapter=infinispan/connection-definitions=infinispanDS/config-properties=CacheJndiName:add(value=java:/myCache)
runbatch
</pre>
</div></div>
<p><br class="atl-forced-newline" /></p>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>To find out all the properties that are supported by this File Connector execute the following command in the CLI.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
/subsystem=teiid:read-rar-description(rar-name=infinispan)
</pre>
</div></div></td></tr></table></div>


<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Developer's Tip</b><br />If the JBoss AS 7.x is running in standalone mode, you can also manually edit the "&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "&lt;jboss-install&gt;/docs/teiid/datasources/infinispan" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</td></tr></table></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55476963&revisedVersion=8&originalVersion=7">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Infinispan+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>