aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-03-15 15:11:16 +0000
committeracolyer <acolyer>2004-03-15 15:11:16 +0000
commit2ed4c9f470df51b8621edda4451ad1768c36c1d5 (patch)
tree88c417ea4dab864f82c3155d4c35cd259d8ea04a /weaver
parent40680b6fe4d28b2d061fc4cf9b3efa6640c12f44 (diff)
downloadaspectj-2ed4c9f470df51b8621edda4451ad1768c36c1d5.tar.gz
aspectj-2ed4c9f470df51b8621edda4451ad1768c36c1d5.zip
move weaving to inside of the compiler.compile loop.
ensure messages are associated with source wherever possible
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/IClassFileProvider.java36
-rw-r--r--weaver/src/org/aspectj/weaver/IWeaveRequestor.java38
2 files changed, 74 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/IClassFileProvider.java b/weaver/src/org/aspectj/weaver/IClassFileProvider.java
new file mode 100644
index 000000000..73700e0bb
--- /dev/null
+++ b/weaver/src/org/aspectj/weaver/IClassFileProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.weaver;
+
+import java.util.Iterator;
+
+/**
+ * @author colyer
+ *
+ * Clients implementing the IClassFileProvider can have a set of class files under
+ * their control woven by a weaver, by calling the weave(IClassFileProvider source) method.
+ * The contract is that a call to getRequestor().acceptResult() is providing a result for
+ * the class file most recently returned from the getClassFileIterator().
+ */
+public interface IClassFileProvider {
+
+ /**
+ * Answer an iterator that can be used to iterate over a set of UnwovenClassFiles to
+ * be woven. During a weave, this method may be called multiple times.
+ * @return iterator over UnwovenClassFiles.
+ */
+ Iterator getClassFileIterator();
+
+ /**
+ * The client to which the woven results should be returned.
+ */
+ IWeaveRequestor getRequestor();
+}
diff --git a/weaver/src/org/aspectj/weaver/IWeaveRequestor.java b/weaver/src/org/aspectj/weaver/IWeaveRequestor.java
new file mode 100644
index 000000000..f61a9793e
--- /dev/null
+++ b/weaver/src/org/aspectj/weaver/IWeaveRequestor.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.weaver;
+
+import org.aspectj.weaver.bcel.UnwovenClassFile;
+
+/**
+ * @author colyer
+ *
+ * This interface is implemented by clients driving weaving through the
+ * IClassFileProvider interface. It is used by the weaver to return woven
+ * class file results back to the client. The client can correlate weave
+ * results with inputs since it knows the last UnwovenClassFile returned by
+ * its iterator.
+ */
+public interface IWeaveRequestor {
+
+ /*
+ * A class file resulting from a weave (yes, even though the type name
+ * says "unwoven"...).
+ */
+ void acceptResult(UnwovenClassFile result);
+
+ // various notifications to the requestor about our progress...
+ void processingReweavableState();
+ void addingTypeMungers();
+ void weavingAspects();
+ void weavingClasses();
+ void weaveCompleted();
+}