Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Beware finalize (was Beware abstract classes of declare parents)




Bjoern,

I would strongly advise against using finalize() unless you have native
code. You cannot guarantee finalizers will be run and they can delay GC. I
would hate to see a new technology like AOP being used to revive a legacy
of C++.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

Bjoern Seebeck <Bjoern.Seebeck@xxxxxx>@eclipse.org on 10/09/2005 13:45:07

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-bounces@xxxxxxxxxxx


To:    aspectj-users@xxxxxxxxxxx
cc:
Subject:    [aspectj-users] Beware abstract classes of declare parents


Hi!

I´m relatively new to AOP and AspectJ, so please excuse me, if question
is too stupid...

Following Problem:
I want to do static crosscutting for all classes in a package.
More specific, I want all the classes to implement an interface
named Finalize which declares the finalize method to do something
at the end of object livetime.

For this I coded following aspect:

public aspect A {
        declare parents:
        (foo.x.y..*) implements Finalize;
}

Now, I don´t want to introduce this implementation to abstract classes.
Is there a way to make this declaring? I thought of something
like this, but (of course) it does not work:

public aspect A {
        declare parents:
        (foo.x.y..*) &&
        (!abstract foo.x.y..*) implements Finalize;
}

Regardz,
Bjoern
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top