[jboss-cvs] JBossAS SVN: r75857 - projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 15 22:11:54 EDT 2008
Author: flavia.rainone at jboss.com
Date: 2008-07-15 22:11:53 -0400 (Tue, 15 Jul 2008)
New Revision: 75857
Modified:
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerConstructorInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerMethodInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByConInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByMethodInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructionInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructorInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/FieldInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/JoinPointInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByConInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByMethodInfo.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodInfo.java
Log:
[JBAOP-509] The infos are required to set the new advisor during a copy procedure. Previously, this was being
done after it.
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -469,7 +469,8 @@
* this includes all the annotation names.
*
* @param constructor the advised constructor
- * @return the metadata tags applied to the advised constructor
+ * @return the metadata tags applied to the advised constructor. This collection
+ * can be edited
*/
public Collection<String> getMetaDataTags(Constructor constructor)
{
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerConstructorInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerConstructorInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerConstructorInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -56,9 +56,9 @@
/*
* For copying
*/
- protected CallerConstructorInfo(CallerConstructorInfo other)
+ protected CallerConstructorInfo(CallerConstructorInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.constructor = other.constructor;
this.callingClass = other.callingClass;
this.wrappingMethod = other.wrappingMethod;
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerMethodInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerMethodInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/CallerMethodInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -53,9 +53,9 @@
/*
* For copying
*/
- protected CallerMethodInfo(CallerMethodInfo other)
+ protected CallerMethodInfo(CallerMethodInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.callingClass = other.callingClass;
this.calledClass = other.calledClass;
this.method = other.method;
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByConInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByConInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByConInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -28,7 +28,6 @@
import org.jboss.aop.joinpoint.ConstructorCallByConstructor;
import org.jboss.aop.joinpoint.ConstructorCalledByConstructorJoinpoint;
import org.jboss.aop.joinpoint.Joinpoint;
-import org.jboss.aop.pointcut.Pointcut;
/**
*
@@ -56,11 +55,12 @@
/*
* For copying
*/
- private ConByConInfo(ConByConInfo other)
+ private ConByConInfo(ConByConInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.callingIndex = other.callingIndex;
this.calling = other.getCallingConstructor();
+ this.setAdvisor(advisor);
registry.register(this);
}
@@ -69,9 +69,10 @@
return new ConstructorCalledByConstructorJoinpoint(getCallingConstructor(), getConstructor());
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new ConByConInfo(this);
+ return new ConByConInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByMethodInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByMethodInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConByMethodInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -56,9 +56,9 @@
/*
* For copying
*/
- protected ConByMethodInfo(ConByMethodInfo other)
+ protected ConByMethodInfo(ConByMethodInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.callingMethodHash = other.callingMethodHash;
this.callingMethod = other.callingMethod;
registry.register(this);
@@ -69,9 +69,10 @@
return new ConstructorCalledByMethodJoinpoint(callingMethod, getConstructor());
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new ConByMethodInfo(this);
+ return new ConByMethodInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructionInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructionInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructionInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -67,9 +67,9 @@
/*
* For copying
*/
- private ConstructionInfo(ConstructionInfo other)
+ private ConstructionInfo(ConstructionInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.constructor = other.constructor;
this.index = other.index;
registry.register(this);
@@ -80,9 +80,10 @@
return new ConstructorJoinpoint(constructor);
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new ConstructionInfo(this);
+ return new ConstructionInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructorInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructorInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/ConstructorInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -94,9 +94,9 @@
/*
* For copying
*/
- private ConstructorInfo(ConstructorInfo other)
+ private ConstructorInfo(ConstructorInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.constructor = other.constructor;
this.index = other.index;
this.wrapper = other.wrapper;
@@ -108,9 +108,10 @@
return new ConstructorJoinpoint(constructor);
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new ConstructorInfo(this);
+ return new ConstructorInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/FieldInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/FieldInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/FieldInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -99,9 +99,9 @@
/*
* For copying
*/
- private FieldInfo(FieldInfo other)
+ private FieldInfo(FieldInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.index = other.index;
this.advisedField = other.advisedField;
this.wrapper = other.wrapper;
@@ -114,9 +114,10 @@
return new FieldJoinpoint(advisedField);
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new FieldInfo(this);
+ return new FieldInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -161,8 +161,7 @@
*/
protected MethodInfo copyInfoFromClassAdvisor(MethodInfo info)
{
- MethodInfo copy = (MethodInfo)info.copy();
- copy.setAdvisor(this);
+ MethodInfo copy = (MethodInfo)info.copy(this);
addMethodInfo(copy);
return copy;
}
@@ -172,8 +171,7 @@
*/
protected FieldInfo copyInfoFromClassAdvisor(FieldInfo info)
{
- FieldInfo copy = (FieldInfo)info.copy();
- copy.setAdvisor(this);
+ FieldInfo copy = (FieldInfo)info.copy(this);
// TODO Flavia
// if (copy.isRead())
// {
@@ -191,8 +189,7 @@
*/
protected ConByConInfo copyInfoFromClassAdvisor(ConByConInfo info)
{
- ConByConInfo copy = (ConByConInfo)info.copy();
- copy.setAdvisor(this);
+ ConByConInfo copy = (ConByConInfo)info.copy(this);
return copy;
}
@@ -201,8 +198,7 @@
*/
protected MethodByConInfo copyInfoFromClassAdvisor(MethodByConInfo info)
{
- MethodByConInfo copy = (MethodByConInfo)info.copy();
- copy.setAdvisor(this);
+ MethodByConInfo copy = (MethodByConInfo)info.copy(this);
return copy;
}
@@ -211,8 +207,7 @@
*/
protected ConByMethodInfo copyInfoFromClassAdvisor(ConByMethodInfo info)
{
- ConByMethodInfo copy = (ConByMethodInfo)info.copy();
- copy.setAdvisor(this);
+ ConByMethodInfo copy = (ConByMethodInfo)info.copy(this);
return copy;
}
@@ -221,8 +216,7 @@
*/
protected MethodByMethodInfo copyInfoFromClassAdvisor(MethodByMethodInfo info)
{
- MethodByMethodInfo copy = (MethodByMethodInfo)info.copy();
- copy.setAdvisor(this);
+ MethodByMethodInfo copy = (MethodByMethodInfo)info.copy(this);
return copy;
}
@@ -1072,8 +1066,7 @@
*/
public Object createAndRebindJoinPointForInstance(JoinPointInfo info)
{
- JoinPointInfo newinfo = info.copy();
- newinfo.setAdvisor(this);
+ JoinPointInfo newinfo = info.copy(this);
return rebindJoinPointWithInstanceInformation(newinfo);
}
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/JoinPointInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/JoinPointInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/JoinPointInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -63,9 +63,8 @@
* For copying
*/
@SuppressWarnings("deprecation")
- protected JoinPointInfo(JoinPointInfo other)
+ protected JoinPointInfo(JoinPointInfo other, Advisor advisor)
{
- this.advisor = other.advisor;
this.clazz = other.clazz;
if (other.interceptors != null)
{
@@ -73,6 +72,7 @@
System.arraycopy(other.interceptors, 0, this.interceptors, 0, other.interceptors.length);
}
if (other.interceptorChain != null)this.interceptorChain.addAll(interceptorChain);
+ this.setAdvisor(advisor);
}
@SuppressWarnings("deprecation")
@@ -96,7 +96,7 @@
return clazz.get();
}
- public void setAdvisor(Advisor advisor)
+ protected void setAdvisor(Advisor advisor)
{
this.advisor = new WeakReference<Advisor>(advisor);
if (getClazz() == null && advisor != null)
@@ -183,7 +183,7 @@
}
protected abstract Joinpoint internalGetJoinpoint();
- public abstract JoinPointInfo copy();
+ public abstract JoinPointInfo copy(Advisor advisor);
public Object resolveClassMetaData(Object key, Object attr)
{
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByConInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByConInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByConInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -57,9 +57,9 @@
/*
* For copying
*/
- private MethodByConInfo(MethodByConInfo other)
+ private MethodByConInfo(MethodByConInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.callingIndex = other.callingIndex;
this.calling = other.calling;
registry.register(this);
@@ -70,9 +70,10 @@
return new MethodCalledByConstructorJoinpoint(calling, getMethod());
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new MethodByConInfo(this);
+ return new MethodByConInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByMethodInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByMethodInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodByMethodInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -49,9 +49,9 @@
/*
* For copying
*/
- private MethodByMethodInfo(MethodByMethodInfo other)
+ private MethodByMethodInfo(MethodByMethodInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.callingMethodHash = other.callingMethodHash;
this.callingMethod = other.callingMethod;
registry.register(this);
@@ -62,9 +62,10 @@
return new MethodCalledByMethodJoinpoint(callingMethod, getMethod());
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new MethodByMethodInfo(this);
+ return new MethodByMethodInfo(this, advisor);
}
public String toString()
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodInfo.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodInfo.java 2008-07-16 02:09:18 UTC (rev 75856)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/MethodInfo.java 2008-07-16 02:11:53 UTC (rev 75857)
@@ -71,9 +71,9 @@
* For copying
*/
@SuppressWarnings("deprecation")
- private MethodInfo(MethodInfo other)
+ private MethodInfo(MethodInfo other, Advisor advisor)
{
- super(other);
+ super(other, advisor);
this.advisedMethod = other.advisedMethod;
this.unadvisedMethod = other.unadvisedMethod;
this.hash = other.hash;
@@ -85,9 +85,10 @@
return new MethodJoinpoint(advisedMethod);
}
- public JoinPointInfo copy()
+ @Override
+ public JoinPointInfo copy(Advisor advisor)
{
- return new MethodInfo(this);
+ return new MethodInfo(this, advisor);
}
@Deprecated
@@ -131,6 +132,7 @@
StringBuffer sb = new StringBuffer("Method");
sb.append("[");
sb.append("method=" + advisedMethod);
+ sb.append(", ").append(this.getAdvisor());
sb.append("]");
return sb.toString();
}
More information about the jboss-cvs-commits
mailing list