[jboss-svn-commits] JBL Code SVN: r26474 - in labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR: .settings and 24 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue May 12 15:18:11 EDT 2009


Author: whitingjr
Date: 2009-05-12 15:18:11 -0400 (Tue, 12 May 2009)
New Revision: 26474

Added:
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.classpath
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.project
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.eclipse.jdt.core.prefs
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.maven.ide.eclipse.prefs
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/build.xml
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/pom.xml
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/ac/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/ac/ncl/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/ac/ncl/sdia/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/ac/ncl/sdia/a8905943/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/uk/ac/ncl/sdia/a8905943/scripts/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/update_person.clj
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/bridge/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/bridge/PersonModifier.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/AbstractMVCCEvent.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCLoadEventListener.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCSaveOrUpdateEvent.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/resources/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/bridge/
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/bridge/JUTestPersonManager.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/target/
Log:
added to svn

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.classpath
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.classpath	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.classpath	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="src" path="src/main/clj"/>
+	<classpathentry kind="src" path="src/main/test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="lib" path="/clojure/clojure-1.1.0-alpha-SNAPSHOT.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.project
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.project	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.project	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>MVCCHibIntegrationJAR</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+	</natures>
+</projectDescription>

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.eclipse.jdt.core.prefs	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,5 @@
+#Mon May 11 17:27:57 BST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/.settings/org.maven.ide.eclipse.prefs	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,9 @@
+#Mon May 11 17:27:46 BST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/build.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/build.xml	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/build.xml	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="mvcc.hib.integration.jar" basedir="." default="usage">
+	
+	<target name="build">
+		<echo>Java module build task was executed.</echo>
+		
+		<javac destdir="${build.dir}/classes" classpathref="COMPILE_DEPENDENCIES" debug="true" target="1.6">
+			<src path="${basedir}/src/main/java"/>
+		</javac>
+		
+		<jar jarfile="${artifact-target}/MVCCHibIntegrationJAR.jar" manifest="${basedir}/src/main/resources/META-INF/MANIFEST.MF">
+			<fileset dir="${build.dir}/classes">
+				<include name="uk/ac/ncl/sdia/**"/>
+				<patternset refid="testcase.filename.patternset"/>
+			</fileset>
+			
+			<metainf dir="${basedir}/src/main/resources/META-INF">
+				<include name="*"/>
+			</metainf>
+			
+		</jar>
+	</target>
+	
+
+	<target name="usage">
+		<echo>Please do not call this build file directly. Use master build script in ../MVCCSample-build directory.</echo>
+	</target>
+</project>
\ No newline at end of file

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/pom.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/pom.xml	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/pom.xml	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,26 @@
+<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>uk.ac.ncl.sdia.a8905943</groupId>
+	<artifactId>MVCCHibIntegrationJAR</artifactId>
+	<packaging>jar</packaging>
+	<version>0.0.1-SNAPSHOT</version>
+	<parent>
+		<artifactId>MVCCSample</artifactId>
+		<groupId>uk.ac.ncl.sdia.a8905943</groupId>
+		<version>0.0.1-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>1.1.1</version>
+			<scope>provided</scope>
+		</dependency>
+<dependency>
+      <groupId>uk.ac.ncl.sdia.a8905943</groupId>
+      <artifactId>MVCCSampleEJB</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/update_person.clj
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/update_person.clj	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/clj/update_person.clj	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,5 @@
+; update_person.clj
+(ns person)
+
+(defn increment-age [person]
+	(str "What a nice " person "you are"))

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/bridge/PersonModifier.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/bridge/PersonModifier.java	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/bridge/PersonModifier.java	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package uk.ac.ncl.sdia.mvcc.bridge;
+
+import org.apache.log4j.Logger;
+
+import clojure.lang.RT;
+import clojure.lang.Var;
+
+import uk.ac.ncl.sdia.mvcc.model.Person;
+
+/**
+ * The purpose of this object is to modify a person object.
+ * Take a Person object and modify the person using clojure
+ * interop within the context of a transaction.
+ * This class uses a pojo outside of a container to attempt
+ * getting things to work with single thread.
+ * 
+ * @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersonModifier
+{
+   private static final String PERSON_MODIFY = "update_person.clj";
+   private static final Logger logger = Logger.getLogger(PersonModifier.class);
+   public Object incrementAge(Person _person)
+      throws Exception
+   {
+      if (logger.isDebugEnabled())
+      {
+         logger.debug("Executing person modifier method to increment age");
+      }
+      RT.loadResourceScript(PERSON_MODIFY);
+      Var script = RT.var("person", "increment-age");
+      Object something = script.invoke(_person);
+      
+      logger.info("What came back was ["+something+"]");
+      
+      return something;
+   }
+}

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/AbstractMVCCEvent.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/AbstractMVCCEvent.java	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/AbstractMVCCEvent.java	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,16 @@
+package uk.ac.ncl.sdia.mvcc.hibernate.events;
+
+import org.codehaus.multiverse.multiversionedstm.MultiversionedStm;
+
+public abstract class AbstractMVCCEvent {
+
+	private static MultiversionedStm stm = null;
+	static{
+		stm = new MultiversionedStm();
+	}
+	
+	public MultiversionedStm getStm()
+	{
+		return stm;
+	}
+}

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCLoadEventListener.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCLoadEventListener.java	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCLoadEventListener.java	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,39 @@
+package uk.ac.ncl.sdia.mvcc.hibernate.events;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.engine.EntityKey;
+import org.hibernate.engine.SessionImplementor;
+import org.hibernate.event.LoadEvent;
+import org.hibernate.event.LoadEventListener;
+import org.hibernate.event.def.DefaultLoadEventListener;
+import org.hibernate.persister.entity.EntityPersister;
+
+
+public class MVCCLoadEventListener extends DefaultLoadEventListener {
+
+	private static final long serialVersionUID = 5162596964232539158L;
+	private static final Log log = LogFactory.getLog(MVCCLoadEventListener.class);
+
+	protected Object loadFromDatasource(
+			final LoadEvent event,
+			final EntityPersister persister,
+			final EntityKey keyToLoad,
+			final LoadEventListener.LoadType options) throws HibernateException
+	{
+	   final SessionImplementor source = event.getSession();
+       Object entity = persister.load(
+               event.getEntityId(),
+               event.getInstanceToLoad(),
+               event.getLockMode(),
+               source
+       );
+
+       if ( event.isAssociationFetch() && source.getFactory().getStatistics().isStatisticsEnabled() ) {
+           source.getFactory().getStatisticsImplementor().fetchEntity( event.getEntityClassName() );
+       }
+
+       return entity;
+	}
+}

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCSaveOrUpdateEvent.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCSaveOrUpdateEvent.java	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/java/uk/ac/ncl/sdia/mvcc/hibernate/events/MVCCSaveOrUpdateEvent.java	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,19 @@
+package uk.ac.ncl.sdia.mvcc.hibernate.events;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.event.SaveOrUpdateEvent;
+import org.hibernate.event.SaveOrUpdateEventListener;
+
+public class MVCCSaveOrUpdateEvent extends AbstractMVCCEvent implements SaveOrUpdateEventListener {
+
+	private static final long serialVersionUID = 1368413908515690348L;
+	private static final Log log = LogFactory.getLog(MVCCSaveOrUpdateEvent.class);
+
+	public void onSaveOrUpdate(SaveOrUpdateEvent event)
+			throws HibernateException {
+	}
+	
+
+}

Added: labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/bridge/JUTestPersonManager.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/bridge/JUTestPersonManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCHibIntegrationJAR/src/main/test/uk/ac/ncl/sdia/mvcc/bridge/JUTestPersonManager.java	2009-05-12 19:18:11 UTC (rev 26474)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package uk.ac.ncl.sdia.mvcc.bridge;
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import clojure.lang.APersistentSet;
+import clojure.lang.IPersistentSet;
+
+import uk.ac.ncl.sdia.mvcc.ejb.servicelocator.ServiceLocator;
+import uk.ac.ncl.sdia.mvcc.model.Person;
+import uk.ac.ncl.sdia.mvcc.spec.PersonManager;
+
+public class JUTestPersonManager
+{
+
+   @Test
+   public void testCheckPersonChange()
+   {
+      try
+      {
+         Person person = new Person();
+         person.setAge(2l);
+         person.setName("Jeremy");
+         person.setId(1l);
+         PersonModifier modifier = new PersonModifier();
+         Object object = modifier.incrementAge(person);
+         Assert.assertNotNull(object);
+      } 
+      catch (Exception e)
+      {
+         Assert.fail(e.getMessage());
+      }
+   }
+   
+   @Ignore
+   public void testSeeWhatHappensWithPersistentSet()
+   {
+      
+   }
+   
+   
+}




More information about the jboss-svn-commits mailing list