Announcement Announcement Module
Collapse
No announcement yet.
Esoteric integration with legacy code Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Esoteric integration with legacy code

    Hello, spr-frwk community.

    I have this requirement to integrate my project with legacy code. This code comes in the form of a JAR dependency that has this registerSyncListeners(Class clasz) method. This method uses reflection to instantiate the class passed as argument, but I wish the instance obtained to be the singleton I already have in my App Ctx. I have thought of strange alternatives like overriding the constructor and do an ApplicationContext.getBean(), but this would be useless in a constructor save for setting it as a member variable. I've also looked around to see if Spring AOP is able to intercept constructor calls, but apparently it can't. Any thoughts, discussion, suggestions or disqualifications on the approach to this esoteric requirement would be greatly appreciated.

    Cheers.

    J.
Working...
X