]> source.dussan.org Git - aspectj.git/commitdiff
synchronization joinpoints: aspectjrt changes
authoraclement <aclement>
Wed, 24 May 2006 07:18:16 +0000 (07:18 +0000)
committeraclement <aclement>
Wed, 24 May 2006 07:18:16 +0000 (07:18 +0000)
runtime/src/org/aspectj/lang/JoinPoint.java
runtime/src/org/aspectj/lang/reflect/LockSignature.java [new file with mode: 0644]
runtime/src/org/aspectj/lang/reflect/UnlockSignature.java [new file with mode: 0644]
runtime/src/org/aspectj/runtime/reflect/Factory.java
runtime/src/org/aspectj/runtime/reflect/LockSignatureImpl.java [new file with mode: 0644]
runtime/src/org/aspectj/runtime/reflect/UnlockSignatureImpl.java [new file with mode: 0644]

index e6f3b50924fbc63382f00a794dbd0ae80202571e..105d8698d0929277f9d3e79a42f718193a121e6e 100644 (file)
@@ -176,6 +176,8 @@ public interface JoinPoint {
     static String PREINITIALIZATION = "preinitialization";
     static String INITIALIZATION = "initialization";
     static String EXCEPTION_HANDLER = "exception-handler";
+    static String SYNCHRONIZATION_LOCK = "lock";
+    static String SYNCHRONIZATION_UNLOCK = "unlock";
 
     static String ADVICE_EXECUTION = "adviceexecution"; 
 
diff --git a/runtime/src/org/aspectj/lang/reflect/LockSignature.java b/runtime/src/org/aspectj/lang/reflect/LockSignature.java
new file mode 100644 (file)
index 0000000..9ef5034
--- /dev/null
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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/epl-v10.html
+ * 
+ * Contributors:
+ *     Andy Clement - initial implementation
+ *******************************************************************************/
+
+package org.aspectj.lang.reflect;
+
+import org.aspectj.lang.Signature;
+
+public interface LockSignature extends Signature {
+
+}
diff --git a/runtime/src/org/aspectj/lang/reflect/UnlockSignature.java b/runtime/src/org/aspectj/lang/reflect/UnlockSignature.java
new file mode 100644 (file)
index 0000000..ba0ce9f
--- /dev/null
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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/epl-v10.html
+ * 
+ * Contributors:
+ *     Andy Clement - initial implementation
+ *******************************************************************************/
+
+
+package org.aspectj.lang.reflect;
+
+import org.aspectj.lang.Signature;
+
+public interface UnlockSignature extends Signature {
+
+}
index 95c9de06803ea64fee7e02104b6481175aeb1231..c81060230ecb9b5359bdaeb0e1b6139d62282c33 100644 (file)
@@ -341,6 +341,40 @@ public final class Factory {
         return ret;            
     }
     
+    public LockSignature makeLockSig(String stringRep) {
+        LockSignatureImpl ret = new LockSignatureImpl(stringRep);
+        ret.setLookupClassLoader(lookupClassLoader);
+        return ret;
+    }
+    public LockSignature makeLockSig() {
+       Class declaringTypeClass = makeClass("Ljava/lang/Object;",lookupClassLoader);
+       LockSignatureImpl ret = new LockSignatureImpl(declaringTypeClass);
+               ret.setLookupClassLoader(lookupClassLoader);
+       return ret;
+    }
+    public LockSignature makeLockSig(Class declaringType) {
+       LockSignatureImpl ret = new LockSignatureImpl(declaringType);
+        ret.setLookupClassLoader(lookupClassLoader);
+        return ret;            
+    }
+    
+    public UnlockSignature makeUnlockSig(String stringRep) {
+       UnlockSignatureImpl ret = new UnlockSignatureImpl(stringRep);
+        ret.setLookupClassLoader(lookupClassLoader);
+        return ret;
+    }
+    public UnlockSignature makeUnlockSig() {
+       Class declaringTypeClass = makeClass("Ljava/lang/Object;",lookupClassLoader);
+       UnlockSignatureImpl ret = new UnlockSignatureImpl(declaringTypeClass);
+               ret.setLookupClassLoader(lookupClassLoader);
+       return ret;
+    }
+    public UnlockSignature makeUnlockSig(Class declaringType) {
+       UnlockSignatureImpl ret = new UnlockSignatureImpl(declaringType);
+        ret.setLookupClassLoader(lookupClassLoader);
+        return ret;            
+    }
+    
 
     public SourceLocation makeSourceLoc(int line, int col)
     {
diff --git a/runtime/src/org/aspectj/runtime/reflect/LockSignatureImpl.java b/runtime/src/org/aspectj/runtime/reflect/LockSignatureImpl.java
new file mode 100644 (file)
index 0000000..605966d
--- /dev/null
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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/epl-v10.html
+ * 
+ * Contributors:
+ *     Andy Clement - initial implementation
+ *******************************************************************************/
+
+
+package org.aspectj.runtime.reflect;
+
+import java.lang.reflect.Modifier;
+
+import org.aspectj.lang.reflect.LockSignature;
+
+class LockSignatureImpl extends SignatureImpl implements LockSignature {
+    private Class parameterType;
+    
+    LockSignatureImpl(Class c) {
+        super(Modifier.STATIC, "lock", c);
+        parameterType = c;
+    }
+    
+    LockSignatureImpl(String stringRep) {
+        super(stringRep);
+    }
+    
+    protected String createToString(StringMaker sm) {
+        if (parameterType == null) parameterType = extractType(3);
+        return "lock("+sm.makeTypeName(parameterType)+")";
+    }    
+
+    public Class getParameterType() {
+        if (parameterType == null) parameterType = extractType(3);
+        return parameterType;
+    }
+    
+}
diff --git a/runtime/src/org/aspectj/runtime/reflect/UnlockSignatureImpl.java b/runtime/src/org/aspectj/runtime/reflect/UnlockSignatureImpl.java
new file mode 100644 (file)
index 0000000..afc02f6
--- /dev/null
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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/epl-v10.html
+ * 
+ * Contributors:
+ *     Andy Clement - initial implementation
+ *******************************************************************************/
+
+
+package org.aspectj.runtime.reflect;
+
+import java.lang.reflect.Modifier;
+
+import org.aspectj.lang.reflect.UnlockSignature;
+
+class UnlockSignatureImpl extends SignatureImpl implements UnlockSignature {
+    private Class parameterType;
+    
+    UnlockSignatureImpl(Class c) {
+        super(Modifier.STATIC, "unlock", c);
+        parameterType = c;
+    }
+    
+    UnlockSignatureImpl(String stringRep) {
+        super(stringRep);
+    }
+
+    protected String createToString(StringMaker sm) {
+        if (parameterType == null) parameterType = extractType(3);
+        return "unlock("+sm.makeTypeName(parameterType)+")";
+    }    
+
+    public Class getParameterType() {
+        if (parameterType == null) parameterType = extractType(3);
+        return parameterType;
+    }
+}