Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 28 files changed
  • 0 commit comments
  • 1 contributor
Showing with 353 additions and 542 deletions.
  1. +162 −0 core-services-nosql-mongodb/pom.xml
  2. 0  ...ervices-nosql-mongodb}/src/main/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/Main.java
  3. 0  ...osql-mongodb}/src/main/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/MongoCustomer.java
  4. +1 −1  .../main/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/MongoDbCrossStoreConfiguration.java
  5. +2 −1  ...ain/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/MongoDbCrossStoreCustomerService.java
  6. +0 −2  ...l-mongodb}/src/main/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/MongoProductInfo.java
  7. +0 −2  ...ices-nosql-mongodb}/src/main/java/org/springsource/examples/sawt/services/nosql/mongodb/xstore/Product.java
  8. 0  {core-services-nosql → core-services-nosql-mongodb}/src/main/resources/services.properties
  9. +122 −0 core-services-nosql-redis/pom.xml
  10. 0  ...ces-nosql → core-services-nosql-redis}/src/main/java/org/springsource/examples/sawt/CoreCrmConfig.java
  11. 0  ...s-nosql → core-services-nosql-redis}/src/main/java/org/springsource/examples/sawt/CustomerService.java
  12. +2 −2 ...e-services-nosql-redis}/src/main/java/org/springsource/examples/sawt/services/nosql/redis/caching/Main.java
  13. +1 −1  ...is/src/main/java/org/springsource/examples/sawt/services/nosql/redis/caching/RedisCachingConfiguration.java
  14. +3 −1 .../src/main/java/org/springsource/examples/sawt/services/nosql/redis/caching/RedisCachingCustomerService.java
  15. +21 −25 ...services-nosql-redis}/src/main/java/org/springsource/examples/sawt/services/nosql/redis/model/Customer.java
  16. +1 −1  ...rvices-nosql-redis}/src/main/java/org/springsource/examples/sawt/services/nosql/redis/persistence/Main.java
  17. 0  ...edis}/src/main/java/org/springsource/examples/sawt/services/nosql/redis/persistence/RedisConfiguration.java
  18. 0  ...in/java/org/springsource/examples/sawt/services/nosql/redis/persistence/RedisPersistantCustomerService.java
  19. +21 −0 core-services-nosql-redis/src/main/resources/services.properties
  20. +0 −315 core-services-nosql/pom.xml
  21. +0 −80 core-services-nosql/src/main/resources/batch.sql
  22. +0 −6 core-services-nosql/src/main/resources/crm.sql
  23. +0 −8 core-services-nosql/src/main/resources/log4j.properties
  24. +0 −19 core-services-nosql/src/main/resources/org/springsource/examples/sawt/services/batch/context.xml
  25. +0 −30 core-services-nosql/src/main/resources/org/springsource/examples/sawt/services/customers-schema.xsd
  26. +0 −37 core-services-nosql/src/main/resources/org/springsource/examples/sawt/services/integration/context.xml
  27. +0 −10 core-services-nosql/src/main/resources/sample/a.csv
  28. +17 −1 pom.xml
View
162 core-services-nosql-mongodb/pom.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.springsource.examples.sawt</groupId>
+ <artifactId>core</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>core-services-nosql-mongodb</artifactId>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-mongodb-cross-store</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warName>customer-service</warName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>sources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <version>1.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${org.aspectj.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjtools</artifactId>
+ <version>${org.aspectj.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>test-compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outxml>true</outxml>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <aspectLibraries>
+ <aspectLibrary>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ </aspectLibrary>
+ <aspectLibrary>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-mongodb-cross-store</artifactId>
+ </aspectLibrary>
+ </aspectLibraries>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.8</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
0  ...t/services/nosql/mongodb/xstore/Main.java → ...t/services/nosql/mongodb/xstore/Main.java
File renamed without changes
View
0  ...s/nosql/mongodb/xstore/MongoCustomer.java → ...s/nosql/mongodb/xstore/MongoCustomer.java
File renamed without changes
View
2  ...store/MongoDbCrossStoreConfiguration.java → ...store/MongoDbCrossStoreConfiguration.java
@@ -75,7 +75,7 @@ public static PersistenceAnnotationBeanPostProcessor persistenceAnnotationBeanPo
}
@Bean
- public PlatformTransactionManager transactionManager() throws Exception {
+ public JpaTransactionManager transactionManager() throws Exception {
EntityManagerFactory entityManagerFactory = entityManagerFactory().getObject();
return new JpaTransactionManager(entityManagerFactory);
}
View
3  ...ore/MongoDbCrossStoreCustomerService.java → ...ore/MongoDbCrossStoreCustomerService.java
@@ -62,6 +62,7 @@ public String doInCollection(DBCollection collection) throws MongoException, Dat
return mongoData;
}
+ @Transactional
public MongoCustomer createCustomer(String fn, String ln) {
MongoCustomer newCustomer = new MongoCustomer();
newCustomer.setFirstName(fn);
@@ -71,7 +72,7 @@ public MongoCustomer createCustomer(String fn, String ln) {
this.entityManager.flush();
this.entityManager.refresh(newCustomer);
- System.out.println(debug());
+ // System.out.println(debug());
return newCustomer;
}
View
2  ...osql/mongodb/xstore/MongoProductInfo.java → ...osql/mongodb/xstore/MongoProductInfo.java
@@ -1,7 +1,5 @@
package org.springsource.examples.sawt.services.nosql.mongodb.xstore;
-import org.springframework.data.mongodb.core.mapping.Document;
-
import java.util.ArrayList;
import java.util.List;
View
2  ...ervices/nosql/mongodb/xstore/Product.java → ...ervices/nosql/mongodb/xstore/Product.java
@@ -1,7 +1,5 @@
package org.springsource.examples.sawt.services.nosql.mongodb.xstore;
-import org.springframework.data.mongodb.core.mapping.Document;
-
/**
* Simple entity designed to hold the state for a customer's purchase
*/
View
0  ...ql/src/main/resources/services.properties → ...db/src/main/resources/services.properties
File renamed without changes
View
122 core-services-nosql-redis/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.springsource.examples.sawt</groupId>
+ <artifactId>core</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>core-services-nosql-redis</artifactId>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-redis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warName>customer-service</warName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>sources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.8</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
0  ...ngsource/examples/sawt/CoreCrmConfig.java → ...ngsource/examples/sawt/CoreCrmConfig.java
File renamed without changes
View
0  ...source/examples/sawt/CustomerService.java → ...source/examples/sawt/CustomerService.java
File renamed without changes
View
4 ...wt/services/nosql/redis/caching/Main.java → ...wt/services/nosql/redis/caching/Main.java
@@ -16,7 +16,7 @@
public class Main {
public static void main(String args[]) throws Throwable {
- AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(RedisConfiguration.class.getPackage().getName());
+ AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(RedisCachingConfiguration.class.getPackage().getName());
Log log = LogFactory.getLog(Main.class);
@@ -26,7 +26,7 @@ public static void main(String args[]) throws Throwable {
for (int i = 0; i < 10; i++) {
Customer retrievedCustomer = customerService.getCustomerById(customer.getId());
- log.info(String.format("customer.id (%s) == retreivedCustomer.id (%s)? %s", customer.getId(), retrievedCustomer.getId(), customer.getId().equals(retrievedCustomer.getId())));
+ log.info(String.format("customer.id (%s) == retreivedCustomer.id (%s)? %s", customer.getId(), retrievedCustomer.getId(), customer.getId() .equals (retrievedCustomer.getId())));
}
Customer updatedCustomer = customerService.updateCustomer(customer.getId(), "JPA", "Lover");
View
2  ...sql/redis/caching/RedisConfiguration.java → ...is/caching/RedisCachingConfiguration.java
@@ -29,7 +29,7 @@
@PropertySource("classpath:/services.properties")
@EnableTransactionManagement
@EnableCaching
-public class RedisConfiguration {
+public class RedisCachingConfiguration {
@Inject
private Environment environment;
View
4 .../caching/RedisCachingCustomerService.java → .../caching/RedisCachingCustomerService.java
@@ -3,6 +3,7 @@
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springsource.examples.sawt.CustomerService;
import org.springsource.examples.sawt.services.nosql.redis.model.Customer;
@@ -11,7 +12,7 @@
import javax.persistence.PersistenceContext;
-@Component
+@Service
@Transactional
public class RedisCachingCustomerService implements CustomerService {
@@ -24,6 +25,7 @@ public Customer getCustomerById(long id) {
return this.entityManager.find(Customer.class, id);
}
+ @Cacheable( "customers")
public Customer createCustomer(String fn, String ln) {
Customer newCustomer = new Customer();
newCustomer.setFirstName(fn);
View
46 .../services/nosql/redis/model/Customer.java → .../services/nosql/redis/model/Customer.java
@@ -5,58 +5,54 @@
import javax.persistence.*;
-@Table(name = "customer")
+@Entity
public class Customer implements java.io.Serializable {
- private Long id;
- private String firstName;
- private String lastName;
- public Customer() {
- }
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ Long id;
- public Customer(String fn, String ln) {
- this.firstName = fn;
- this.lastName = ln;
- }
-
- public Customer(long id, String firstName, String lastName) {
- this.id = id;
- this.firstName = firstName;
- this.lastName = lastName;
- }
+ String firstName;
+ String lastName;
+ public Customer(){}
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "id", unique = true, nullable = false)
public Long getId() {
- return this.id;
+ return id;
}
public void setId(Long id) {
this.id = id;
}
- @Column(name = "first_name", nullable = false)
public String getFirstName() {
- return this.firstName;
+ return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
-
- @Column(name = "last_name", nullable = false)
public String getLastName() {
- return this.lastName;
+ return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
+ public Customer(Long id, String firstName, String lastName) {
+ this.id = id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+
+
+
+
+
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
View
2  ...ervices/nosql/redis/persistence/Main.java → ...ervices/nosql/redis/persistence/Main.java
@@ -27,7 +27,7 @@ public static void main(String[] args) throws Exception {
log.info(String.format("customer.id (%s) == retrievedCustomer.id (%s)? %s",
customer.getId(),
retrievedCustomer.getId(),
- customer.getId().equals(retrievedCustomer.getId())));
+ customer.getId()==(retrievedCustomer.getId())));
Customer updatedCustomer = customerService.updateCustomer(customer.getId(), "NoSql", "Lover");
View
0  ...redis/persistence/RedisConfiguration.java → ...redis/persistence/RedisConfiguration.java
File renamed without changes
View
0  ...tence/RedisPersistantCustomerService.java → ...tence/RedisPersistantCustomerService.java
File renamed without changes
View
21 core-services-nosql-redis/src/main/resources/services.properties
@@ -0,0 +1,21 @@
+
+
+jdbc.sql.customers.insert = INSERT INTO customer( first_name, last_name) VALUES ( :firstName , :lastName )
+jdbc.sql.customers.queryById = SELECT id, first_name, last_name FROM customer WHERE id = ?
+jdbc.sql.customers.update = UPDATE customer set first_name = ?, last_name = ? WHERE id = ?
+
+dataSource.xstoreUrl=jdbc:h2:tcp://localhost/~/nosql_crm
+dataSource.batchUrl = jdbc:h2:tcp://localhost/~/batch_crm
+dataSource.url=jdbc:h2:tcp://localhost/~/crm
+dataSource.driverClass=org.h2.Driver
+dataSource.dialect=org.hibernate.dialect.H2Dialect
+dataSource.user=sa
+dataSource.password=
+
+jms.broker.url=tcp://localhost:61616
+
+amqp.customer.queue=customers
+amqp.customer.exchange=customers
+amqp.broker.url=localhost
+amqp.broker.username=guest
+amqp.broker.password=guest
View
315 core-services-nosql/pom.xml
@@ -1,315 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.springframework.data.examples</groupId>
- <artifactId>customer-survey</artifactId>
- <name>customer-service</name>
- <packaging>war</packaging>
- <version>1.0.0-BUILD-SNAPSHOT</version>
- <properties>
- <java-version>1.6</java-version>
- <org.springframework-version>3.1.0.RELEASE</org.springframework-version>
- <spring.data.mongo.version>1.0.0.RELEASE</spring.data.mongo.version>
- <org.cloudfoundry-version>0.8.1</org.cloudfoundry-version>
- <org.aspectj-version>1.6.11</org.aspectj-version>
- <org.slf4j.version>1.6.1</org.slf4j.version>
- <log4j.version>1.2.15</log4j.version>
-
-
- </properties>
- <dependencies>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>4.0.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api</artifactId>
- <version>3.0.20100224</version>
- </dependency>
- <dependency>
- <groupId>redis.clients</groupId>
- <artifactId>jedis</artifactId>
- <version>2.0.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.data</groupId>
- <artifactId>spring-data-redis</artifactId>
- <version>1.0.0.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.3.162</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${org.slf4j.version}</version>
-
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${org.slf4j.version}</version>
-
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${org.slf4j.version}</version>
-
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- <exclusions>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jdmk</groupId>
- <artifactId>jmxtools</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jmx</groupId>
- <artifactId>jmxri</artifactId>
- </exclusion>
- </exclusions>
-
- </dependency>
-
- <!-- Spring -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${org.springframework-version}</version>
- <exclusions>
- <!-- Exclude Commons Logging in favor of SLF4j -->
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${org.springframework-version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aspects</artifactId>
- <version>${org.springframework-version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${org.springframework-version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${org.springframework-version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${org.springframework-version}</version>
- </dependency>
-
- <!-- AspectJ -->
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${org.aspectj-version}</version>
- </dependency>
-
-
- <!-- @Inject -->
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
- </dependency>
-
- <!-- Servlet -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- </dependency>
-
- <!-- Spring Data dependencies -->
- <dependency>
- <groupId>org.springframework.data</groupId>
- <artifactId>spring-data-mongodb-cross-store</artifactId>
- <version>${spring.data.mongo.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aspects</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
-
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
-
- </dependency>
-
- <!-- Commons JDBC -->
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- </dependency>
-
-
- </dependencies>
- <repositories>
-
- <repository>
- <id>JBoss Repo</id>
- <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
- <name>JBoss Repo</name>
- </repository>
- </repositories>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java-version}</source>
- <target>${java-version}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>customer-service</warName>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>install</id>
- <phase>install</phase>
- <goals>
- <goal>sources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>aspectj-maven-plugin</artifactId>
- <!-- Have to use version 1.2 since version 1.3 does not appear to work with ITDs -->
- <version>1.2</version>
- <dependencies>
- <!-- You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${org.aspectj-version}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjtools</artifactId>
- <version>${org.aspectj-version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>test-compile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outxml>true</outxml>
- <source>${java-version}</source>
- <target>${java-version}</target>
- <aspectLibraries>
- <aspectLibrary>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aspects</artifactId>
- </aspectLibrary>
- <aspectLibrary>
- <groupId>org.springframework.data</groupId>
- <artifactId>spring-data-mongodb-cross-store</artifactId>
- </aspectLibrary>
- </aspectLibraries>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.8</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>tomcat-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
- </plugin>
- </plugins>
- </build>
-</project>
View
80 core-services-nosql/src/main/resources/batch.sql
@@ -1,80 +0,0 @@
--- Autogenerated: do not edit this file
-
-
-CREATE TABLE BATCH_JOB_INSTANCE (
- JOB_INSTANCE_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- JOB_NAME VARCHAR(100) NOT NULL,
- JOB_KEY VARCHAR(32) NOT NULL,
- constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
-) ;
-
-CREATE TABLE BATCH_JOB_EXECUTION (
- JOB_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- JOB_INSTANCE_ID BIGINT NOT NULL,
- CREATE_TIME TIMESTAMP NOT NULL,
- START_TIME TIMESTAMP DEFAULT NULL ,
- END_TIME TIMESTAMP DEFAULT NULL ,
- STATUS VARCHAR(10) ,
- EXIT_CODE VARCHAR(100) ,
- EXIT_MESSAGE VARCHAR(2500) ,
- LAST_UPDATED TIMESTAMP,
- constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID)
- references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
-) ;
-
-CREATE TABLE BATCH_JOB_PARAMS (
- JOB_INSTANCE_ID BIGINT NOT NULL ,
- TYPE_CD VARCHAR(6) NOT NULL ,
- KEY_NAME VARCHAR(100) NOT NULL ,
- STRING_VAL VARCHAR(250) ,
- DATE_VAL TIMESTAMP DEFAULT NULL ,
- LONG_VAL BIGINT ,
- DOUBLE_VAL DOUBLE PRECISION ,
- constraint JOB_INST_PARAMS_FK foreign key (JOB_INSTANCE_ID)
- references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
-) ;
-
-CREATE TABLE BATCH_STEP_EXECUTION (
- STEP_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY ,
- VERSION BIGINT NOT NULL,
- STEP_NAME VARCHAR(100) NOT NULL,
- JOB_EXECUTION_ID BIGINT NOT NULL,
- START_TIME TIMESTAMP NOT NULL ,
- END_TIME TIMESTAMP DEFAULT NULL ,
- STATUS VARCHAR(10) ,
- COMMIT_COUNT BIGINT ,
- READ_COUNT BIGINT ,
- FILTER_COUNT BIGINT ,
- WRITE_COUNT BIGINT ,
- READ_SKIP_COUNT BIGINT ,
- WRITE_SKIP_COUNT BIGINT ,
- PROCESS_SKIP_COUNT BIGINT ,
- ROLLBACK_COUNT BIGINT ,
- EXIT_CODE VARCHAR(100) ,
- EXIT_MESSAGE VARCHAR(2500) ,
- LAST_UPDATED TIMESTAMP,
- constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID)
- references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
-) ;
-
-CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT (
- STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
- SHORT_CONTEXT VARCHAR(2500) NOT NULL,
- SERIALIZED_CONTEXT LONGVARCHAR ,
- constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID)
- references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID)
-) ;
-
-CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT (
- JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
- SHORT_CONTEXT VARCHAR(2500) NOT NULL,
- SERIALIZED_CONTEXT LONGVARCHAR ,
- constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID)
- references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
-) ;
-
-CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ;
-CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ;
-CREATE SEQUENCE BATCH_JOB_SEQ;
View
6 core-services-nosql/src/main/resources/crm.sql
@@ -1,6 +0,0 @@
-
-CREATE TABLE customer (
- id serial,
- first_name VARCHAR(255) NOT NULL,
- last_name VARCHAR(255) NOT NULL
-);
View
8 core-services-nosql/src/main/resources/log4j.properties
@@ -1,8 +0,0 @@
-
-log4j.rootCategory=INFO, S
-log4j.logger.org.w3c.tidy=FATAL
-log4j.logger.org.springsource.examples.crm.services.jdbc=DEBUG
-
-log4j.appender.S = org.apache.log4j.ConsoleAppender
-log4j.appender.S.layout = org.apache.log4j.PatternLayout
-log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
View
19 ...rvices-nosql/src/main/resources/org/springsource/examples/sawt/services/batch/context.xml
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/batch"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- ">
-
-
- <job id="importData" job-repository="jobRepository">
- <step id="step1">
- <tasklet transaction-manager="transactionManager">
- <chunk reader="reader" processor="processor" writer="writer" commit-interval="2"/>
- </tasklet>
- </step>
- </job>
-
-</beans:beans>
View
30 ...ces-nosql/src/main/resources/org/springsource/examples/sawt/services/customers-schema.xsd
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<xs:schema version="1.0" attributeFormDefault="unqualified"
- elementFormDefault="qualified"
- xmlns:crm="http://samples.springsource.org/sawt/customers/schemas"
- targetNamespace="http://samples.springsource.org/sawt/customers/schemas"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
-
- <xs:element name="customerLookupRequest" type="crm:customerLookupRequest"/>
-
- <xs:element name="customerLookupResponse" type="crm:customerLookupResponse"/>
-
- <xs:complexType name="customer">
- <xs:sequence/>
- <xs:attribute name="id" type="xs:long" use="required"/>
- <xs:attribute name="first-name" type="xs:string"/>
- <xs:attribute name="last-name" type="xs:string"/>
- </xs:complexType>
-
- <xs:complexType name="customerLookupResponse">
- <xs:attribute name="customer" type="crm:customer"/>
- </xs:complexType>
-
- <xs:complexType name="customerLookupRequest">
- <xs:attribute name="id" type="xs:long" use="required"/>
- </xs:complexType>
-
-
-</xs:schema>
-
View
37 ...-nosql/src/main/resources/org/springsource/examples/sawt/services/integration/context.xml
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:int="http://www.springframework.org/schema/integration"
- xmlns:file="http://www.springframework.org/schema/integration/file"
- xmlns:stream="http://www.springframework.org/schema/integration/stream"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
- http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.1.xsd
- http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.1.xsd
- ">
-
- <import resource="../batch/context.xml"/>
-
- <context:component-scan base-package="org.springsource.examples.sawt.services.integration"/>
-
- <context:property-placeholder location="/services.properties"/>
-
- <int:channel id="jobsToLaunch"/>
- <int:channel id="filesReceived"/>
- <int:channel id="jobExecutions"/>
-
- <file:inbound-channel-adapter auto-create-directory="true" channel="filesReceived"
- directory="#{systemProperties['user.home']}/Desktop/in">
- <int:poller fixed-rate="1000"/>
- </file:inbound-channel-adapter>
-
- <int:transformer ref="fileToJobRequestTransformer" input-channel="filesReceived" output-channel="jobsToLaunch"/>
-
- <int:service-activator input-channel="jobsToLaunch" ref="jobMessageHandler" output-channel="jobExecutions"/>
-
- <stream:stdout-channel-adapter id="jobsPrinted" append-newline="true" channel="jobExecutions"/>
-
-</beans>
View
10 core-services-nosql/src/main/resources/sample/a.csv
@@ -1,10 +0,0 @@
-Hoeller,Juergen
-Fisher,Mark
-Syer,Dave
-Johnson,Rod
-Leau,Costin
-Laddad,Ramnivas
-Beams,Chris
-Long,Josh
-Harrop,Rob
-Richardson,Chris
View
18 pom.xml
@@ -9,7 +9,9 @@
<modules>
<!-- <module>advanced-di</module> <module>basic-di</module> <module>core-services</module> <module>core-services-cache</module> <module>web</module> -->
<module>core-services</module>
- <module>core-services-nosql</module>
+ <module>core-services-nosql-mongodb</module>
+ <module>core-services-nosql-redis</module>
+
<module>web</module>
<!--<module>android</module>-->
@@ -56,6 +58,12 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>xpp3</groupId><artifactId>xpp3</artifactId><version>1.1.4c</version>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId><artifactId>xml-apis</artifactId><version>1.3.03</version>
+ </dependency>
<!-- Spring Data dependencies -->
<dependency>
<groupId>org.springframework.data</groupId>
@@ -192,6 +200,9 @@
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
+ <groupId>xpp3</groupId><artifactId>xpp3_min</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -480,6 +491,11 @@
</build>
<repositories>
<repository>
+ <id>JBoss Repo</id>
+ <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
+ <name>JBoss Repo</name>
+ </repository>
+ <repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>

No commit comments for this range

Something went wrong with that request. Please try again.