[jboss-svn-commits] JBL Code SVN: r28908 - labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 11 17:28:49 EDT 2009


Author: whitingjr
Date: 2009-08-11 17:28:49 -0400 (Tue, 11 Aug 2009)
New Revision: 28908

Removed:
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningAspectImpl.java
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningFieldAspect.java
Log:
Dumped these two classes. They were migrated to the Annotations module.

Deleted: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningAspectImpl.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningAspectImpl.java	2009-08-11 21:28:12 UTC (rev 28907)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningAspectImpl.java	2009-08-11 21:28:49 UTC (rev 28908)
@@ -1,82 +0,0 @@
-/*
- * JBoss, the OpenSource J2EE webOS
- * 
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package uk.ac.ncl.sdia.a8905943.aspects;
-
-import org.apache.log4j.Logger;
-import org.jboss.aop.joinpoint.FieldWriteInvocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-
-import uk.ac.ncl.sdia.a8905943.factory.TransactionFactory;
-import uk.ac.ncl.sdia.a8905943.spec.VersioningAspect;
-
-/**
- * The purpose of this object is to delegate to the concurrency control framework
- * versioning behaviour when an MVCCSTMEntity has been modified.
- * 
- * @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
- * @version $Revision: 1.1 $
- * @deprecated do not use this, instead use the field annotation
- */
-public class VersioningAspectImpl implements VersioningAspect
-{
-   private static final Logger logger = Logger.getLogger(VersioningAspectImpl.class); 
-   
-   @Override
-   public Object version(FieldWriteInvocation fieldWriteInvocation)
-      throws Throwable
-   {
-      // TODO:jrw complete implementation of this method
-      if (logger.isInfoEnabled())
-      {
-         logger.info("Versioning aspect called for field write invocation");
-      }
-      // TODO: jrw do something
-      return fieldWriteInvocation.invokeNext();
-   }
-   
-   public Object read(MethodInvocation methodInvocation)
-      throws Throwable
-   {
-      // TODO:jrw complete implementation of this method
-      if (logger.isInfoEnabled())
-      {
-         logger.info("Versioning aspect called for field getter invocation");
-      }
-      // TODO: jrw do something
-      // check whether a transaction is running
-      
-      final Object readable = TransactionFactory.getCurrentTransaction().readField();
-      
-      // set the field with the value
-      if (null == readable)
-      {
-         
-      }
-      else
-      {
-         
-      }
-      
-      // delegate following operations
-      // notify the scheduler a read operation is being attempted.
-      // depending on the transaction status and level (top/...) get either the shared visible value or, the isolated value associated with this transaction.
-      // if no transaction exists, do I start one or expect there one to exist already ? 
-      return methodInvocation.invokeNext();
-   }
-   public Object write(MethodInvocation methodInvocation)
-      throws Throwable
-   {
-   // TODO:jrw complete implementation of this method
-      if (logger.isInfoEnabled())
-      {
-         logger.info("Versioning aspect called for field setter invocation");
-      }
-      // TODO: jrw do something
-      return methodInvocation.invokeNext();
-   }
-
-}

Deleted: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningFieldAspect.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningFieldAspect.java	2009-08-11 21:28:12 UTC (rev 28907)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/aspects/VersioningFieldAspect.java	2009-08-11 21:28:49 UTC (rev 28908)
@@ -1,75 +0,0 @@
-/*
- * JBoss, the OpenSource J2EE webOS
- * 
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package uk.ac.ncl.sdia.a8905943.aspects;
-
-import java.lang.reflect.Field;
-
-import org.apache.log4j.Logger;
-import org.jboss.aop.joinpoint.FieldReadInvocation;
-
-import uk.ac.ncl.sdia.a8905943.factory.TransactionFactory;
-import uk.ac.ncl.sdia.a8905943.handle.FieldUtils;
-import uk.ac.ncl.sdia.a8905943.handle.HandleUtils;
-import uk.ac.ncl.sdia.a8905943.spec.STMTransaction;
-
-/**
- * A VersioningFieldAspect.
- * 
- * @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
- * @version $Revision: 1.1 $
- * @deprecated do not use this, a separate module for aspects should be used
- */
-public final class VersioningFieldAspect
-{
-   private static final Logger logger = Logger.getLogger(VersioningFieldAspect.class);
-
-   public Object readField( FieldReadInvocation readInvocation)
-      throws Throwable
-   {
-      Object returnValue = null;
-   // TODO:jrw complete implementation of this method
-      if (logger.isInfoEnabled())
-      {
-         logger.info("Versioning aspect called for field read invocation");
-      }
-      // TODO: jrw do something
-      FieldUtils fieldUtils = new FieldUtils();
-      HandleUtils handleUtils = new HandleUtils();
-      Field idField = fieldUtils.findIdField(readInvocation.getTargetObject().getClass());
-      Long id = fieldUtils.getValue(idField, readInvocation.getTargetObject() );
-      long handle = handleUtils.getHandle(readInvocation.getTargetObject().getClass(), id, idField.getName());
-      // check whether a transaction is running, if not start one
-
-      STMTransaction transaction =   TransactionFactory.getCurrentTransaction();
-      
-      if (null == transaction)
-      {
-         if (logger.isDebugEnabled())
-         {
-            logger.debug("This entity has been accessed outside of the STM system. Will default to regular non-transaction POJO behaviour");
-         }
-         returnValue = readInvocation.invokeNext();
-      }
-      else
-      {
-         if (logger.isDebugEnabled())
-         {
-            logger.debug("Entity field accessed in transactional context.");
-         }
-         final Object readable = transaction.readField();
-         //TODO: jrw check here for NullReference object returned from the transactional system.
-         returnValue = readable;
-      }
-      
-      // delegate following operations
-      // notify the scheduler a read operation is being attempted.
-      // depending on the transaction status and level (top/...) get either the shared visible value or, the isolated value associated with this transaction.
-      // if no transaction exists, do I start one or expect there one to exist already ? 
-       
-      return returnValue;
-   }
-}



More information about the jboss-svn-commits mailing list