[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[aspectj-users] AspectJ inter-Class issue
|
- From: Irum Godil <softwarengineer2004@xxxxxxxxx>
- Date: Sun, 23 Jan 2005 15:56:20 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=hp0NfsmqsFGbAYuMVcwyZXJbLZykB+P7T0PEeGWgmBxH5uUdlfz3810dvTEDSUJPQUqjfZZlbai4ZBBMJg09fJXfXHlLLgeSF4whWPB+ZrT1uuvC7HorrQxWFKGuEZ+uoVbYd7phYXa+Z+5CjeWN4E/kjaOwAigqXdpiLUcmzwI= ;
Hi,
I am trying to refactor some code using AspectJ. Basically I have an interface "TransactionSubscriber" with an API "receive(Date, Transaction)". Now, there is another class PrevaylerImpl inside which the implementation of above is given as follows:
private TransactionSubscriber subscriber() {
return new TransactionSubscriber() {
public void receive(Transaction transaction, Date executionTime) {
...
}
};
}
I want to replace the function receive(Transaction, Date) by receive(Transaction) in the PrevaylerImpl class; and I want to move the function receive(Transaction, Date) into an aspect. So, the function receive(Transaction, Date) is only defined for TransactionSubscriber when the aspect is included.
This is how I have tried to refactor the code. First of all I changed the above code in PrevaylerImpl to be:
public class Subscriber implements TransactionSubscriber {
public void receive(Transaction transaction) {
.. }
}
}
private TransactionSubscriber subscriber() {
return new Subscriber();
}
Next, I define in my aspect the following:
public void PrevaylerImpl.Subscriber.receive(Transaction transaction, Date executionTime) {
}
The problem is that the above receive API uses some local variables of the PrevaylerImpl class. When I define the above API in my aspect, I keep getting an error that the specific field cannot be resolved. I am not sure what to do to see the PrevaylerImpl variable inside the PrevaylerImpl.Subscriber.receive API.
Can someone help please. I will appreciate your response.
thanks.
Sincerely,
Irum Godil.
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'