Results 1 to 2 of 2

Thread: Interceptor to add argument to method

  1. #1
    Join Date
    Aug 2004
    Location
    Hong Kong
    Posts
    18

    Default Interceptor to add argument to method

    Does anyone know if it is possible to write a interceptor can help adding argument to a method call transparently?

    e.g. xxxMethod(Arg 1)

    finally return, it is

    xxxMethod(Arg 1, Arg 2)

    Anyone can give me some hints?

    Thanks a million! :oops:
    Beginner of Spring!

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    You can redirect a method call from one method to another, returning the value of the target method. So you could redirect from foo(String) to foo(String, int). However, the foo(String, int) method must exist - a MethodInterceptor wll not allow you to add new methods to an object.

    You can make an object implement additional methods defined on a interface using introductions. See section 5.3.2.5 for more info on introductions.

    Rob

Similar Threads

  1. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  2. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  3. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •