AnsweredAssumed Answered

Override authenticationService

Question asked by ajv on Jan 27, 2008

I'm trying to override the authenticationService using method injection (I want to change only one method).

So, I configure authentication-services-context.xml like this:

   <bean id="authenticationService" class="">
           <property name="authenticationDao">
               <ref bean="authenticationDao" />
           <property name="ticketComponent">
               <ref bean="ticketComponent" />
           <property name="authenticationComponent">
               <ref bean="authenticationComponent" />
      <replaced-method name="updateAuthentication" replacer="authenticationReplacer" />

   <bean id="authenticationReplacer" class="org.alfresco.custom.AuthenticationServiceImplCustom"/>

The new class implements MethodReplacer interface:

public class AuthenticationServiceImplCustom implements MethodReplacer {
   private static Log s_logger = Functions.createLog(AuthenticationServiceImplCustom.class);
   public Object reimplement (Object target, Method method, Object [] args) throws Throwable {
      try {
         Functions.reportLog(s_logger, "Update Password NEW!!….");
         Functions.reportLog(s_logger, "Params: ");
         for (int i = 0; i < args.length; i++) {
            Functions.reportLog(s_logger, i + ".- " + args[i]);
      } catch (Exception e) {
      return null;


When I change the user password, the updateAuthentication method was not replaced…. :cry:

What am I doing wrong to override this method?
Thanks in advanced (and sorry by my english).