Switched to use new project layout; updated build; moved files around

This commit is contained in:
Thomas Risberg
2010-10-07 12:14:39 -04:00
parent 06b5ceff15
commit 0f7984a331
67 changed files with 4000 additions and 168 deletions

View File

@@ -0,0 +1,54 @@
package org.springframework.persistence.support;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.persistence.RelatedEntity;
/**
* Abstract superaspect to advise field read and write
* and introduce a mixin interface.
*
* @param <N> type of introduced interface
*
* @author Rod Johnson
*/
privileged abstract public aspect AbstractMixinFields<N> {
protected final Log log = LogFactory.getLog(getClass());
//-------------------------------------------------------------------------
// ITDs to add behavior and state to classes
//-------------------------------------------------------------------------
// Enable Spring DI for all mixed-in objects
declare @type: N+: @Configurable;
//-------------------------------------------------------------------------
// Advice for field get/set to delegate to backing Node.
//-------------------------------------------------------------------------
protected pointcut entityFieldGet(N entity) :
get(* N+.*) &&
this(entity) &&
!(get(@RelatedEntity * *)
|| get(* N.*)
|| getsNotToAdvise());
/**
* Never matches. Subclasses can override to exempt certain field reads from advice
*/
protected pointcut getsNotToAdvise();
protected pointcut entityFieldSet(N entity, Object newVal) :
set(* N+.*) &&
this(entity) &&
args(newVal) &&
!(set(@RelatedEntity * *) ||
set(* N.*) ||
setsNotToAdvise());
/**
* Never matches. Subclasses can override to exempt certain field writes from advice
*/
protected pointcut setsNotToAdvise();
}

View File

@@ -0,0 +1,21 @@
package org.springframework.persistence.support;
import java.lang.annotation.Annotation;
/**
* Abstract superaspect for aspects that advice
* field access with a mixin for all types annotated with
* a given annotation.
*
* @param <ET> annotation on entity
* @param <N> type of introduced interface
*
* @author Rod Johnson
*/
privileged abstract public aspect AbstractTypeAnnotatingMixinFields<ET extends Annotation, N>
extends AbstractMixinFields<N> {
// ITD to introduce N state to Annotated objects
declare parents : (@ET *) implements N;
}