hatsch1209
Jul 9th, 2007, 06:08 AM
Hi all,
I searched this forum but unfortunately I couldn't find an approritate answer for my simple problem.
I have an Account class and for each method of this class authentication is needed.
I want to use a before Advice with the schema definition. But I have no idea how I can pass the account object to the advice. In the documentation I read that "this" should work in this case, but it does not. 'account' is not found. If I change "..this(account)" to "this(banking.Account)" there is no error, but I cannot access the account-object from within the advice.
<bean class="banking.Account" id="account"></bean>
<bean id="authentication" class="authentication.Authentication"></bean>
<aop:config>
<aop:aspect ref="authentication">
<aop:before method="authenticate"
pointcut="execution(* banking.Account.*(..)) and this(account) "
arg-names="account" />
</aop:aspect>
</aop:config>
thx in advance, Hatsch
I searched this forum but unfortunately I couldn't find an approritate answer for my simple problem.
I have an Account class and for each method of this class authentication is needed.
I want to use a before Advice with the schema definition. But I have no idea how I can pass the account object to the advice. In the documentation I read that "this" should work in this case, but it does not. 'account' is not found. If I change "..this(account)" to "this(banking.Account)" there is no error, but I cannot access the account-object from within the advice.
<bean class="banking.Account" id="account"></bean>
<bean id="authentication" class="authentication.Authentication"></bean>
<aop:config>
<aop:aspect ref="authentication">
<aop:before method="authenticate"
pointcut="execution(* banking.Account.*(..)) and this(account) "
arg-names="account" />
</aop:aspect>
</aop:config>
thx in advance, Hatsch