Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Lippert2009-04-30 21:40:04 +0000
committerMartin Lippert2009-04-30 21:40:04 +0000
commitffcb08add3c0b65593facb70d1e8b7dce5798676 (patch)
tree83d5493d670abe134f4ecbf62f1be834b14c8754
parent9c6314ef54016178bf5f7af82b6f935aeae8fad6 (diff)
downloadrt.equinox.bundles-ffcb08add3c0b65593facb70d1e8b7dce5798676.tar.gz
rt.equinox.bundles-ffcb08add3c0b65593facb70d1e8b7dce5798676.tar.xz
rt.equinox.bundles-ffcb08add3c0b65593facb70d1e8b7dce5798676.zip
Bug 274410 - [aspects] introduce a new header to avoid weaver creationv200904302341
-rw-r--r--bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/AspectAdmin.java20
-rw-r--r--bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/AspectResolver.java11
2 files changed, 25 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/AspectAdmin.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/AspectAdmin.java
index 883001655..bcc1d2fc8 100644
--- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/AspectAdmin.java
+++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/AspectAdmin.java
@@ -28,6 +28,20 @@ import org.osgi.framework.Bundle;
public interface AspectAdmin {
/**
+ * Header for aspect bundle manifest files to indicate whether a bundle is
+ * readily compiled with AJDT, for example. This tells Equinox Aspects that
+ * the bundle does not need to be woven if it refers to just its own
+ * aspects.
+ */
+ public static final String AOP_BUNDLE_FINISHED_HEADER = "Eclipse-AspectBundle"; //$NON-NLS-1$
+
+ /**
+ * The value for the aspect bundle header to indicate that there is no
+ * weaving necessary to finish the aspects of the bundle itself
+ */
+ public static final String AOP_BUNDLE_FINISHED_VALUE = "finished"; //$NON-NLS-1$
+
+ /**
* This is the default value for the location of the aop.xml file inside a
* bundle
*/
@@ -141,7 +155,8 @@ public interface AspectAdmin {
*
* @param bundle The bundle from which the given package is imported
* @param packageName The name of the package that is imported
- * @param applyAspects the policy for applying visible aspects for weaving
+ * @param applyAspectsPolicy the policy for applying visible aspects for
+ * weaving
* @return The set of aspects that should be woven from the given imported
* package
*/
@@ -154,7 +169,8 @@ public interface AspectAdmin {
*
* @param bundle The bundle which is required and might export aspects that
* should be woven
- * @param applyAspects the policy for applying visible aspects for weaving
+ * @param applyAspectsPolicy the policy for applying visible aspects for
+ * weaving
* @return The set of aspects that should be woven from the given required
* bundle
*/
diff --git a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/AspectResolver.java b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/AspectResolver.java
index ba221cda3..f6df097ea 100644
--- a/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/AspectResolver.java
+++ b/bundles/org.eclipse.equinox.weaving.aspectj/src/org/eclipse/equinox/weaving/aspectj/loadtime/AspectResolver.java
@@ -239,15 +239,18 @@ public class AspectResolver {
}
// this bundle
- if (result.size() > 0) {
- aspects = aspectAdmin.getAspectDefinition(bundle);
- if (aspects != null) {
+ aspects = aspectAdmin.getAspectDefinition(bundle);
+ if (aspects != null) {
+ final String finishedValue = (String) bundle.getHeaders().get(
+ AspectAdmin.AOP_BUNDLE_FINISHED_HEADER);
+ if (finishedValue == null
+ || !AspectAdmin.AOP_BUNDLE_FINISHED_VALUE
+ .equals(finishedValue)) {
result.add(aspects);
fingerprintElements.add(bundle.getSymbolicName() + ":" //$NON-NLS-1$
+ bundleDescription.getVersion().toString());
}
}
-
}
return result;

Back to the top