Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Problema class nested
Problema class nested [message #73479] Fri, 13 March 2009 18:24 Go to next message
Hitalo is currently offline HitaloFriend
Messages: 4
Registered: July 2009
Junior Member
public class StandardDrawingView ...{

....


protected void handleMouseEventException(Throwable t) {
JOptionPane.showMessageDialog(
this,
t.getClass().getName() + " - " + t.getMessage(),
"Error",
JOptionPane.ERROR_MESSAGE);
t.printStackTrace();
}

public class DrawingViewMouseListener extends MouseAdapter {
/**
* Handles mouse down events. The event is delegated to the
* currently active tool.
*/
public void mousePressed(MouseEvent e) {
try {
//throw Throwable
}
catch (Throwable t) {
handleMouseEventException(t);
}

}

}

...

}

AEW,

the problem is:
my aim is: extract the exception handler to aspect's without changing
the original code of the application. But I'm not able to make this
scenario above. I can not get the reference class StandardDrawingView to
use the method handleMouseEventException (t) in the treatment of exccacao.
Is there any way to do this?
Take the reference class DrawingViewMouseListener is easy, just use TARGET
or THIS. The problem is to take the class most external
StandardDrawingView.

Since already thank ...public class StandardDrawingView ...{

....


protected void handleMouseEventException(Throwable t) {
JOptionPane.showMessageDialog(
this,
t.getClass().getName() + " - " + t.getMessage(),
"Error",
JOptionPane.ERROR_MESSAGE);
t.printStackTrace();
}

public class DrawingViewMouseListener extends MouseAdapter {
/**
* Handles mouse down events. The event is delegated to the
* currently active tool.
*/
public void mousePressed(MouseEvent e) {
try {
//throw Throwable
}
catch (Throwable t) {
handleMouseEventException(t);
}

}

}

...

}

AEW,

the problem is:
my aim is: extract the exception handler to aspect's without changing
the original code of the application. But I'm not able to make this
scenario above. I can not get the reference class StandardDrawingView to
use the method handleMouseEventException (t) in the treatment of exccacao.
Is there any way to do this?
Take the reference class DrawingViewMouseListener is easy, just use TARGET
or THIS. The problem is to take the class most external
StandardDrawingView.

Since already thank ...
Re: Problema class nested [message #73516 is a reply to message #73479] Sat, 14 March 2009 17:05 Go to previous message
Eclipse UserFriend
Originally posted by: andrew.eisenberg.springsource.com

I think what you are trying to do is to advise calls to
handleMouseEventException so that your code will run instead of the regular
code. Assuming this is what you want to do, you can try:

void around (Throwable t) : execution ( protected void
full.package.path.StandardDrawingView. handleMouseEventException(Throwable)
&& args(t) {
// do your stuff
if (condition) {
proceed(t);
}
}

However, I think something else is going on. It looks like you are trying
to weave into a third party library. Make sure that this library is on the
aspect path of your project.
Re: Problema class nested [message #599777 is a reply to message #73479] Sat, 14 March 2009 17:05 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 77
Registered: July 2009
Member
I think what you are trying to do is to advise calls to
handleMouseEventException so that your code will run instead of the regular
code. Assuming this is what you want to do, you can try:

void around (Throwable t) : execution ( protected void
full.package.path.StandardDrawingView. handleMouseEventException(Throwable)
&& args(t) {
// do your stuff
if (condition) {
proceed(t);
}
}

However, I think something else is going on. It looks like you are trying
to weave into a third party library. Make sure that this library is on the
aspect path of your project.
Previous Topic:No advice markers or cross references
Next Topic:can't compile anymore pointcut with generic after upgrade
Goto Forum:
  


Current Time: Fri Apr 19 01:45:57 GMT 2024

Powered by FUDForum. Page generated in 0.02413 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top