Announcement Announcement Module
Collapse
No announcement yet.
"ResourceAware" bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "ResourceAware" bean

    Hi,

    is there a way to make a bean aware of its defining resource ?

    Example: bean A is defined in a.xml, bean B in b.xml.
    When accessing bean A, there should be a way got get back "a.xml". Is there something similar like BeanNameAware or BeanFactoyAware to get back the resource?

    My idea behind that is to have a couple of similarly structured jars acting as plugins in a main application. The main application reads the configuration of each plugin using a single "classpath*:definition.xml". The beans inside each definition.xml reference a velocity template residing inside the plugin jar. Two plugins might contain a different template having the same name. In order to avoid name clashes, the beans must be aware of its defining resource.

    I hope this was clear enough to understand the problem.

    Regards,
    Stefan

  • #2
    Almost ; http://www.springframework.org/docs/...textAware.html

    Comment


    • #3
      Solved

      Thanks, thats exactly what I needed.

      Comment


      • #4
        Originally posted by darthvader
        Thanks, thats exactly what I needed.
        Glad to help

        Comment

        Working...
        X