Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Point Cut gambling

I am having troubles with pointcuts, yet again. It seems to me it lies in the favour of the aspectj gods whether a point cut matches or not.

These are the participating files in my application (Packages and irrelevant methods stripped away):
public interface IRemoteObject extends javax.ejb.EJBObject {
public boolean changeOperationAllowed ( AbstractDO ado ) throws java.rmi.RemoteException;
}

public interface PersonManagerRemote extends IRemoteObject {
public PersonDO createPerson ( PersonDO p ) throws java.rmi.RemoteException;
   public void changePerson ( PersonDO p ) throws java.rmi.RemoteException;
   public void removePerson ( PersonDO p ) throws java.rmi.RemoteException;
}

public interface AddressBookManagerRemote extends IRemoteObject {
public void addParty ( AddressBookDO ado, PartyDO pdo ) throws java.rmi.RemoteException; public void removeParty ( AddressBookDO ado, PartyDO pdo ) throws java.rmi.RemoteException;
}

public class AbstractDO { /* ejb value object */ }
public class PartyDO extends AbstractDO { /* ejb value object */ }
public class AddressBookDO extends AbstractDO { /* ejb value object */ }
public class PersonDO extends PartyDO { /* ejb value object */ }

This point cut matches perfectly:
public pointcut remoteAuthOperations ( IRemoteObject iro, PersonDO ado ) :
       target ( PersonManagerRemote ) && target ( iro ) && args ( ado ) &&
       (
call ( public void PersonManagerRemote.createPerson ( PersonDO ) ) || call ( public void PersonManagerRemote.changePerson ( PersonDO ) ) || call ( public void PersonManagerRemote.removePerson ( PersonDO ) )
       );

This point cut doesn't match, but it isn't very different from the one above: public pointcut remoteAuthOperations ( AddressBookManagerRemote iro, AddressBookDO ado ) : target ( AddressBookManagerRemote ) && target ( iro ) && args ( ado ) &&
       (
call ( public void AddressBookManagerRemote.addParty ( AddressBookDO, PartyDO ) ) || call ( public void AddressBookManagerRemote.removeParty ( AddressBookDO, PartyDO ) )
       );

Where is the difference? Why doesn't it match?

I am now trying for two days to get this point cut to match. It's kind of frustrating.

Franz


Back to the top