Skip to content

Commit

Permalink
Upgrade quickstarts to ISPN 6.0.0.CR1
Browse files Browse the repository at this point in the history
  • Loading branch information
mgencur authored and tristantarrant committed Oct 9, 2013
1 parent 688392e commit 64e6783
Show file tree
Hide file tree
Showing 21 changed files with 187 additions and 112 deletions.
112 changes: 91 additions & 21 deletions carmart-tx/pom.xml
Expand Up @@ -45,15 +45,11 @@
<version.jboss.weld>1.1.8.Final</version.jboss.weld>
<version.com.sun.faces.jsf.impl>2.0.2</version.com.sun.faces.jsf.impl>

<!-- Define the version of the JBoss BOMs we want to import to specify tested stacks. -->
<version.jboss.bom.eap>6.2.0-redhat-1</version.jboss.bom.eap>
<version.jboss.bom.jdg>6.2.0-redhat-1</version.jboss.bom.jdg>
<!-- Alternatively, comment out the above line, and un-comment the
line below to use version 1.0.4.Final-redhat-4 which is a release certified
to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6
maven repository. -->
<!-- <version.jboss.bom.eap>1.0.4.Final-redhat-4</version.jboss.bom.eap> -->
<!-- <version.jboss.bom.jdg>1.0.4.Final-redhat-4</version.jboss.bom.jdg> -->
<version.org.infinispan>6.0.0.CR1</version.org.infinispan>

<version.jboss.spec.javaee.6.0>3.0.2.Final</version.jboss.spec.javaee.6.0>

<version.org.jboss.jbossts.jbossjts>4.16.4.Final</version.org.jboss.jbossts.jbossjts>

<!-- This is the Management URL of EWS/Tomcat, so tomcat-maven-plugin
can deploy this quickstart on EWS/Tomcat through this URL -->
Expand All @@ -73,28 +69,102 @@
</properties>

<dependencyManagement>
<!-- JBoss distributes a complete set of Java EE 6 APIs including
a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
a collection) of artifacts. We use this here so that we always get the correct
versions of artifacts. Here we use the jboss-javaee-6.0-with-infinispan stack
and the jboss-javaee-6.0-with-transactions stack (you can read this as the
JBoss stack of the Java EE 6 APIs, with Infinispan and Transactions) -->
<dependencies>
<dependency>
<groupId>org.jboss.bom.jdg</groupId>
<artifactId>jboss-javaee-6.0-with-infinispan</artifactId>
<version>${version.jboss.bom.jdg}</version>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-bom</artifactId>
<version>${version.org.infinispan}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Define the version of JBoss' Java EE 6 APIs we want to import.
Any dependencies from org.jboss.spec will have their version defined by this
BOM -->
<!-- JBoss distributes a complete set of Java EE 6 APIs including
a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
a collection) of artifacts. We use this here so that we always get the correct
versions of artifacts. Here we use the jboss-javaee-6.0 stack (you can
read this as the JBoss stack of the Java EE 6 APIs). You can actually
use this stack with any version of JBoss AS that implements Java EE 6, not
just JBoss AS 7! -->
<dependency>
<groupId>org.jboss.bom.eap</groupId>
<artifactId>jboss-javaee-6.0-with-transactions</artifactId>
<version>${version.jboss.bom.eap}</version>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${version.jboss.spec.javaee.6.0}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.jboss.jbossts</groupId>
<artifactId>jbossjta</artifactId>
<version>${version.org.jboss.jbossts.jbossjts}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-core</artifactId>
</exclusion>
<exclusion>
<artifactId>emma</artifactId>
<groupId>emma</groupId>
</exclusion>
<exclusion>
<artifactId>emma_ant</artifactId>
<groupId>emma</groupId>
</exclusion>
<exclusion>
<artifactId>hornetq-core</artifactId>
<groupId>org.hornetq</groupId>
</exclusion>
<exclusion>
<artifactId>netty</artifactId>
<groupId>org.jboss.netty</groupId>
</exclusion>
<exclusion>
<artifactId>wrapper</artifactId>
<groupId>tanukisoft</groupId>
</exclusion>
<exclusion>
<artifactId>jacorb</artifactId>
<groupId>jacorb</groupId>
</exclusion>
<exclusion>
<artifactId>jfreechart</artifactId>
<groupId>jfree</groupId>
</exclusion>
<exclusion>
<artifactId>jboss-corba-ots-spi</artifactId>
<groupId>org.jboss.integration</groupId>
</exclusion>
<exclusion>
<artifactId>jboss-server-manager</artifactId>
<groupId>org.jboss.jbossas</groupId>
</exclusion>
<exclusion>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<groupId>org.jboss.spec.javax.ejb</groupId>
</exclusion>
<exclusion>
<artifactId>jnp-client</artifactId>
<groupId>org.jboss.naming</groupId>
</exclusion>
<exclusion>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<groupId>org.jboss.spec.javax.servlet</groupId>
</exclusion>
<exclusion>
<artifactId>jbossws-common</artifactId>
<groupId>org.jboss.ws</groupId>
</exclusion>
<exclusion>
<artifactId>jcl-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- Import Prettyfaces dependency. This is a UNSUPPORTED component -->
<dependency>
<groupId>com.ocpsoft</groupId>
Expand Down
Expand Up @@ -26,7 +26,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.transaction.UserTransaction;
import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.CarType;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.Country;
Expand Down
Expand Up @@ -16,7 +16,7 @@
*/
package org.jboss.as.quickstarts.datagrid.carmart.session;

import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;
import org.jboss.as.quickstarts.datagrid.carmart.session.CacheContainerProvider;

Expand Down
Expand Up @@ -19,7 +19,7 @@
import java.util.logging.Logger;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder;
Expand Down Expand Up @@ -64,7 +64,7 @@ public BasicCacheContainer getCacheContainer() {
.lockingMode(LockingMode.OPTIMISTIC).transactionManagerLookup(new GenericTransactionManagerLookup()) //uses GenericTransactionManagerLookup - This is a lookup class that locate transaction managers in the most popular Java EE application servers. If no transaction manager can be found, it defaults on the dummy transaction manager.
.locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
.eviction().maxEntries(4).strategy(EvictionStrategy.LIRS) //Sets 4 as maximum number of entries in a cache instance and uses the LIRS strategy - an efficient low inter-reference recency set replacement policy to improve buffer cache performance
.loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup
.persistence().passivation(false).addSingleFileStore().purgeOnStartup(true) //Disable passivation and adds a SingleFileStore that is purged on Startup
.build(); //Builds the Configuration object
manager = new DefaultCacheManager(glob, loc, true);
log.info("=== Using DefaultCacheManager (library mode) ===");
Expand Down
Expand Up @@ -16,7 +16,7 @@
*/
package org.jboss.as.quickstarts.datagrid.carmart.session;

import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;

/**
*
Expand Down
Expand Up @@ -32,7 +32,7 @@
import javax.transaction.TransactionManager;

import org.infinispan.CacheImpl;
import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.CarType;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.Country;
Expand Down
Expand Up @@ -28,7 +28,7 @@
import javax.transaction.TransactionManager;

import org.infinispan.CacheImpl;
import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;

/**
Expand Down
Expand Up @@ -19,7 +19,7 @@
import java.util.logging.Logger;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder;
Expand Down Expand Up @@ -64,7 +64,7 @@ public BasicCacheContainer getCacheContainer() {
.lockingMode(LockingMode.OPTIMISTIC).transactionManagerLookup(new JBossStandaloneJTAManagerLookup()) //uses JBossStandaloneJTAManagerLookup - If you're running Infinispan in a standalone environment, this should be your default choice for transaction manager. It's a fully fledged transaction manager based on JBoss Transactions which overcomes all the deficiencies of the dummy transaction manager.
.locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
.eviction().maxEntries(4).strategy(EvictionStrategy.LIRS) //Sets 4 as maximum number of entries in a cache instance and uses the LIRS strategy - an efficient low inter-reference recency set replacement policy to improve buffer cache performance
.loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup
.persistence().passivation(false).addSingleFileStore().purgeOnStartup(true) //Disable passivation and adds a SingleFileStore that is purged on Startup
.build(); //Builds the Configuration object
manager = new DefaultCacheManager(glob, loc, true);
log.info("=== Using DefaultCacheManager (library mode) ===");
Expand Down
3 changes: 1 addition & 2 deletions carmart/README.md
Expand Up @@ -93,8 +93,7 @@ NOTE: The application must be deployed to JBoss Enterprise Application Platform

2. Configure the remote datagrid in the `$JDG_HOME/standalone/configuration/standalone.xml` file. Copy the following XML into the Infinispan subsystem before the ending </cache-container> tag. If you have an existing `carcache` element, be sure to replace it with this one.

<local-cache name="carcache" start="EAGER" batching="false" indexing="NONE">
<locking isolation="REPEATABLE_READ" striping="false" acquire-timeout="20000" concurrency-level="500"/>
<local-cache name="carcache" start="EAGER" batching="false">
<eviction strategy="LIRS" max-entries="4"/>
</local-cache>

Expand Down
42 changes: 25 additions & 17 deletions carmart/pom.xml
Expand Up @@ -50,13 +50,9 @@
can deploy this quickstart on EWS/Tomcat through this URL -->
<tomcat.management.url>http://localhost:8080/manager/text</tomcat.management.url>

<!-- Define the version of the JBoss BOMs we want to import to specify tested stacks. -->
<version.jboss.bom.jdg>6.2.0-redhat-1</version.jboss.bom.jdg>
<!-- Alternatively, comment out the above line, and un-comment the
line below to use version 1.0.4.Final-redhat-4 which is a release certified
to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6
maven repository. -->
<!-- <version.jboss.bom.jdg>1.0.4.Final-redhat-4</version.jboss.bom.jdg> -->
<version.org.infinispan>6.0.0.CR1</version.org.infinispan>

<version.jboss.spec.javaee.6.0>3.0.2.Final</version.jboss.spec.javaee.6.0>

<!-- other plugin versions -->
<version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
Expand All @@ -75,21 +71,33 @@


<dependencyManagement>
<!-- JBoss distributes a complete set of Java EE 6 APIs including
a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
a collection) of artifacts. We use this here so that we always get the correct
versions of artifacts. Here we use the jboss-javaee-6.0-with-infinispan stack
and the jboss-javaee-6.0-with-transactions stack (you can read this as the
JBoss stack of the Java EE 6 APIs, with Infinispan and Transactions) -->
<dependencies>
<dependency>
<groupId>org.jboss.bom.jdg</groupId>
<artifactId>jboss-javaee-6.0-with-infinispan</artifactId>
<version>${version.jboss.bom.jdg}</version>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-bom</artifactId>
<version>${version.org.infinispan}</version>
<type>pom</type>
<scope>import</scope>
</dependency>


<!-- Define the version of JBoss' Java EE 6 APIs we want to import.
Any dependencies from org.jboss.spec will have their version defined by this
BOM -->
<!-- JBoss distributes a complete set of Java EE 6 APIs including
a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
a collection) of artifacts. We use this here so that we always get the correct
versions of artifacts. Here we use the jboss-javaee-6.0 stack (you can
read this as the JBoss stack of the Java EE 6 APIs). You can actually
use this stack with any version of JBoss AS that implements Java EE 6, not
just JBoss AS 7! -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${version.jboss.spec.javaee.6.0}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Import Prettyfaces dependency. This is a UNSUPPORTED component -->
<dependency>
<groupId>com.ocpsoft</groupId>
Expand Down
Expand Up @@ -19,7 +19,7 @@
import java.util.logging.Logger;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder;
Expand Down Expand Up @@ -57,7 +57,7 @@ public BasicCacheContainer getCacheContainer() {
.clustering().cacheMode(CacheMode.LOCAL) //Set Cache mode to LOCAL - Data is not replicated.
.locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
.eviction().maxEntries(4).strategy(EvictionStrategy.LIRS) //Sets 4 as maximum number of entries in a cache instance and uses the LIRS strategy - an efficient low inter-reference recency set replacement policy to improve buffer cache performance
.loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is Purged on Startup
.persistence().passivation(false).addSingleFileStore().purgeOnStartup(true) //Disable passivation and adds a SingleFileStore that is Purged on Startup
.build(); //Builds the Configuration object
manager = new DefaultCacheManager(glob, loc, true);
log.info("=== Using DefaultCacheManager (library mode) ===");
Expand Down
Expand Up @@ -25,7 +25,7 @@
import javax.faces.event.SystemEventListener;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.CarType;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car.Country;
Expand Down
Expand Up @@ -20,7 +20,7 @@
import java.io.IOException;
import java.util.Properties;

import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;

/**
*
Expand Down
Expand Up @@ -16,7 +16,7 @@
*/
package org.jboss.as.quickstarts.datagrid.carmart.session;

import org.infinispan.api.BasicCache;
import org.infinispan.commons.api.BasicCache;
import org.jboss.as.quickstarts.datagrid.carmart.model.Car;

import javax.enterprise.inject.Model;
Expand Down
Expand Up @@ -19,11 +19,13 @@
import java.util.logging.Logger;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import org.infinispan.api.BasicCacheContainer;
import org.infinispan.commons.api.BasicCacheContainer;
import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.jboss.as.quickstarts.datagrid.carmart.session.CacheContainerProvider;



/**
*
* {@link CacheContainerProvider}'s implementation creating a HotRod client.
Expand All @@ -42,7 +44,11 @@ public class RemoteCacheContainerProvider extends CacheContainerProvider {

public BasicCacheContainer getCacheContainer() {
if (manager == null) {
manager = new RemoteCacheManager(jdgProperty(DATAGRID_HOST) + ":" + jdgProperty(HOTROD_PORT), true);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
.host(jdgProperty(DATAGRID_HOST))
.port(Integer.parseInt(jdgProperty(HOTROD_PORT)));
manager = new RemoteCacheManager(builder.build());
log.info("=== Using RemoteCacheManager (Hot Rod) ===");
}
return manager;
Expand Down

0 comments on commit 64e6783

Please sign in to comment.