Browse Source

synchronization joinpoints: aspectjrt changes

tags/V1_5_2rc1
aclement 18 years ago
parent
commit
40cbd9f1d4

+ 2
- 0
runtime/src/org/aspectj/lang/JoinPoint.java View 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";


+ 18
- 0
runtime/src/org/aspectj/lang/reflect/LockSignature.java View File

@@ -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 {

}

+ 19
- 0
runtime/src/org/aspectj/lang/reflect/UnlockSignature.java View File

@@ -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 {

}

+ 34
- 0
runtime/src/org/aspectj/runtime/reflect/Factory.java View 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)
{

+ 41
- 0
runtime/src/org/aspectj/runtime/reflect/LockSignatureImpl.java View File

@@ -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;
}
}

+ 40
- 0
runtime/src/org/aspectj/runtime/reflect/UnlockSignatureImpl.java View File

@@ -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;
}
}

Loading…
Cancel
Save