|
October 2005
[
avasseur
]
11:22, Thursday, 20 October 2005
It's there !
I am very pleased to announce the prototype version of JRockit that includes our AOP API is available. It will drive you far far away from current bytecode instrumentation techniques to a world of plain Java API, complete runtime control for hot deployment and undeployment, agnostic from the programming model you like for your aspects.
If you are involved in the AOP field, bytecode instrumentation field, APM field, and did not heard from us recently, please drop me an email and I 'll consider your participation in evaluating this technology to help us drive it to reality.
You can read the official announcement and some background information in our BEA dev2dev dedicated forum.
[
avasseur
]
13:30, Monday, 10 October 2005
Back in July Jonas suggested some semantics for a synchronized block join point. The discussion was interesting but I am wondering if we actually came up with the right question.
What if we simply think in terms of "is this type listening to locking events ?" instead of trying to come up with a pointcut expression that defines the semantics of a synchronized block - as done in Jonas discusion?
Lets draft some code:
Consider the program: class Bar { synchronized void foo() { .. } static synchronized void statfoo() { .. } void stuff() { .. synchronized(bar) { .. } } }
interface Lockable { void waiting(); void acquired(); void released(); } @Introduce("Bar")
class LockableNOOP implements Lockable {
void waiting() {}
void acquired() {}
void released() {}
}Replace all synchronized blocks like that: Given synchronized(stuff) {
..
}if (stuff instanceof Lockable) { Lockable lockable = (Lockable)stuff; lockable.waiting(); synchronized(stuff) { lockable.acquired(); ..// unchanged body } lockable.released(); } else { synchronized(stuff) { ..// unchanged body } } You can now access the enclosing static join point information if you need - which gives you if you really need it, the rich semantics Jonas was looking for: call(Lockable.waiting()) && withincode(....) && target(t) && cflow(...) .....
// t is the locked object
There are two interesting things to solve now:
|