Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:33:29+00:00 2026-06-01T06:33:29+00:00

I need to intercept the calls to all the method calls to an Interface.

  • 0

I need to intercept the calls to all the method calls to an Interface. I’ve gone through the Java Dynamic Proxies however that will not help me. I’m not even sure whether this can be achieved, but thought of confirming.

So basically lets say i have an interface as follows:

public interface Foo {        
   public String getValue();
}

I would like to intercept all the calls to getValue() from whichever implementations of Foo. Problem is i do not have control over the different implementations of Foo, because of which i cant use Dynamic Proxies.

Is there a way i can do this?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:33:31+00:00Added an answer on June 1, 2026 at 6:33 am

    AOP might help, but as you’ve discovered, it all gets much easier if you’re in control of the object creation (even if only through a DI framework like Spring or Guice).

    Another alternative is compile-time byte-code weaving – that is, finding all implementations and altering them to have your interception code in them at compile time.

    A third alternative would be to look at using either an agent or a custom classloader to do weaving as the classes are loaded into the system. This is load-time weaving. But if you’re in, say, a web container where you’re not fully in charge of the classloaders, this might be tricky.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to transfer packets through the internet whose length should be dynamic. struct
I am architecting a solution that will use WCF to make all the computers
Where can I intercept reads and updates for scaffolded tables? I need to make
Does the phone need to be connected to the internet all the time, so
So, I have a page that loads and through jquery.get makes several requests to
I desperately need some help on this one. I've created a <script> that closely
I have a statusbar in a Swing application that continuously prints status. All objects
I need to implement a Windows Virtual Disk that is visible as a separate
I am building a fairly simple CMS. I need to intercept requests for the
i want to intercept method from a non-proxied object. I have a class instance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.