[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] Point Cut gambling
|
A simplification would be to write:
public pointcut remoteAuthOperations(AddressBookManagerRemote iro, AddressBookDO ado):
target(iro)
&& args(ado, *)
&& (call (public void AddressBookManagerRemote.addParty (AddressBookDO, PartyDO)) ||
call (public void AddressBookManagerRemote.removeParty(AddressBookDO, PartyDO)));
>
> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx
> [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Gregor Kiczales
> Sent: Thursday, October 21, 2004 1:40 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] Point Cut gambling
>
>
> add ", PartyDO" after "ado" in the args
>
> as you have it, the args pointcut is args ( ado ). Its saying
> to only match one
> argument join points, where the first argument is of type
> AddressBookDO. But all
> the call pointcuts pick out two argument calls. The
> intersection of one argument
> join points and two argument calls is empty.
>
>
> > 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
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
>
>
>
> > -----Original Message-----
> > From: aspectj-users-admin@xxxxxxxxxxx
> > [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Franz
> Prilmeier
> > Sent: Thursday, October 21, 2004 1:28 PM
> > To: aspectj-users@xxxxxxxxxxx
> > Subject: [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
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>