Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] notifyAll exception

Hi,
I have a synchronized function which has a call to notifyAll. I want to put both the synchronized keyword and the call to notifyAll into an aspect. I have done the following:
 

pointcut writeObjectExec(DurableOutputStream stream) : target(stream) &&
                                execution(int writeObject(Object) throws IOException);
 

int around(DurableOutputStream stream) : writeObjectExec(stream) {
      synchronized(stream) {
      return proceed(stream);      
  }
 }

This gets rid of the "synchronized" keyword. Now I do the following:
 
pointcut writeObjectCut() : withincode(private int writeObject(Object) throws IOException)
 && within(DurableOutputStream) && set(int DurableOutputStream._objectsWritten);
 
after() : writeObjectCut() {
     notifyAll();
 }
 
However, I keep getting the exception "Current Thread not owner". The exception is happening around the "notifyAll" call. Can someone please help me as to what to do here?
 
Thanks.
Sincerely,
Irum Godil.


Do you Yahoo!?
The all-new My Yahoo! – What will yours do?

Back to the top