Author: van.halbert
Date: 2012-05-09 10:35:51 -0400 (Wed, 09 May 2012)
New Revision: 4076
Modified:
branches/7.7.x/connectors/connector-infinispan/src/main/ear/infinispan-ds.xml
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanConnectionImpl.java
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanManagedConnectionFactory.java
branches/7.7.x/connectors/connector-infinispan/src/main/rar/META-INF/ra.xml
Log:
Teiid-1992 fixed the passing of the data source property: remoteServerList and how its
handled for creating the cache manager
Modified: branches/7.7.x/connectors/connector-infinispan/src/main/ear/infinispan-ds.xml
===================================================================
---
branches/7.7.x/connectors/connector-infinispan/src/main/ear/infinispan-ds.xml 2012-05-08
17:12:27 UTC (rev 4075)
+++
branches/7.7.x/connectors/connector-infinispan/src/main/ear/infinispan-ds.xml 2012-05-09
14:35:51 UTC (rev 4076)
@@ -10,10 +10,11 @@
<rar-name>infinispan-jca.ear#connector-infinispan.rar</rar-name>
<!-- connection interface; (do not change this) -->
<connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
-
- <!-- (OPTIONAL) Infinispan Server List -->
- <!-- config-property
name="RemoteInfinispanServerList">host:port[;host:port...]</config-property-->
-<min-pool-size>5</min-pool-size>
+
+ <!-- Infinispan server list - host:port[;host:port...] (required)-->
+ <config-property
name="RemoteServerList">localhost:11222</config-property>
+
+ <min-pool-size>0</min-pool-size>
<max-pool-size>20</max-pool-size>
</no-tx-connection-factory>
Modified:
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanConnectionImpl.java
===================================================================
---
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanConnectionImpl.java 2012-05-08
17:12:27 UTC (rev 4075)
+++
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanConnectionImpl.java 2012-05-09
14:35:51 UTC (rev 4076)
@@ -1,5 +1,5 @@
/*
- * JBoss, Home of Professional Open Source.
+sele * JBoss, Home of Professional Open Source.
* See the COPYRIGHT.txt file distributed with this work for information
* regarding copyright ownership. Some portions may be licensed
* to Red Hat, Inc. under one or more contributor license agreements.
Modified:
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanManagedConnectionFactory.java
===================================================================
---
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanManagedConnectionFactory.java 2012-05-08
17:12:27 UTC (rev 4075)
+++
branches/7.7.x/connectors/connector-infinispan/src/main/java/org/teiid/resource/adapter/infinispan/InfinispanManagedConnectionFactory.java 2012-05-09
14:35:51 UTC (rev 4076)
@@ -31,26 +31,30 @@
private String remoteServerList;
private RemoteCacheManager cacheContainer;
- private Object lock = new Object();
+
@Override
public BasicConnectionFactory createConnectionFactory() throws ResourceException {
- synchronized(lock) {
-
- this.cacheContainer = getOrCreateCacheContainer();
- if (this.cacheContainer == null) {
- throw new ResourceException("Unable to create Infinispan
CacheContainer" );
- }
- }
return new BasicConnectionFactory() {
private static final long serialVersionUID = 1L;
+
+ private Object lock = new Object();
+
@Override
public InfinispanConnectionImpl getConnection() throws ResourceException {
+ synchronized(lock) {
+
+ RemoteCacheManager cc = getOrCreateCacheContainer();
+ if (cc == null) {
+ throw new ResourceException("Unable to create Infinispan
CacheContainer" );
+ }
+
+ }
return new InfinispanConnectionImpl(InfinispanManagedConnectionFactory.this);
}
};
@@ -66,12 +70,12 @@
* must be in the appropriate format of
<code>host:port[;host:port...]</code> that would be used when defining an
Infinispan
* {@link RemoteCacheManager} instance. If the value is missing,
<code>localhost:11311</code> is assumed.
*
- * @param remoteInfinispanServerList the server list in appropriate
<code>server:port;server2:port2</code> format.
+ * @param remoteServerList the server list in appropriate
<code>server:port;server2:port2</code> format.
*/
- public synchronized void setRemoteInfinispanServerList( String
remoteInfinispanServerList ) {
- if (this.remoteServerList == remoteInfinispanServerList || this.remoteServerList
!= null
- && this.remoteServerList.equals(remoteInfinispanServerList)) return;
// unchanged
- this.remoteServerList = remoteInfinispanServerList;
+ public synchronized void setRemoteServerList( String remoteServerList ) {
+ if (this.remoteServerList == remoteServerList || this.remoteServerList != null
+ && this.remoteServerList.equals(remoteServerList)) return; //
unchanged
+ this.remoteServerList = remoteServerList;
}
@@ -83,9 +87,12 @@
return this.cacheContainer;
}
if (getRemoteServerList() == null || getRemoteServerList().equals(""))
{
- return new RemoteCacheManager();
+ this.cacheContainer = new RemoteCacheManager();
+ return this.cacheContainer;
}
- return new RemoteCacheManager(getRemoteServerList());
+ this.cacheContainer = new RemoteCacheManager(getRemoteServerList());
+
+ return this.cacheContainer;
}
Modified: branches/7.7.x/connectors/connector-infinispan/src/main/rar/META-INF/ra.xml
===================================================================
--- branches/7.7.x/connectors/connector-infinispan/src/main/rar/META-INF/ra.xml 2012-05-08
17:12:27 UTC (rev 4075)
+++ branches/7.7.x/connectors/connector-infinispan/src/main/rar/META-INF/ra.xml 2012-05-09
14:35:51 UTC (rev 4076)
@@ -35,18 +35,17 @@
<outbound-resourceadapter>
<connection-definition>
<managedconnectionfactory-class>org.teiid.resource.adapter.infinispan.InfinispanManagedConnectionFactory</managedconnectionfactory-class>
+
+ <config-property>
+ <description>{$display:"Infinispan Server
List",$description:"Infinispan Server
List",$required:"true"}</description>
+ <config-property-name>RemoteServerList</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>org.teiid.resource.adapter.custom.spi.WrappedConnectionFactory</connectionfactory-impl-class>
<connection-interface>javax.resource.cci.Connection</connection-interface>
-
<connection-impl-class>org.teiid.resource.adapter.custom.spi.WrappedConnection</connection-impl-class>
-
- <!-- config-property>
- <description>{$display:"Infinispan Server
List",$description:"Infinispan Server List
(host:port[;host:port...])",$required:"true"}</description>
- <config-property-name>RemoteServerList</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
-
<config-property-value>localhost:11311</config-property-value>
- </config-property-->
+
<connection-impl-class>org.teiid.resource.adapter.custom.spi.WrappedConnection</connection-impl-class>
</connection-definition>
Show replies by date