Announcement Announcement Module
No announcement yet.
spring as a plugin framework Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring as a plugin framework

    A plugin scenario is something like this:
    1. i have an application with a navigation bar
    2. i want to enable clients to add items to the navigation bar
    a. let them write some specification for the item (specify it as a menu item, display name, url etc.)
    b. package it
    c. "deploy" it (put it in some predefined directory)
    3. the navigation bar componet then does something like:
    Collection plugins = getPlugins(menuItemPluginId);
    // iterate over the plugins, creating a menu item for each

    ... basically, what Eclipse has.

    How can I acheive this with Spring?
    - I don't want the client to modify my internal configuration files (e.g., the xxx-servlet.xml file)
    - deployment / undeployment should be on-line (not shutting down the application)


  • #2
    A lot of new features like context reloading (essential for plugins) are scheduled for 1.3 release which is not far in the future. Check out JIRA for more information.
    I think that is your starting point - probably there is already something on the CVS which you can use.


    • #3
      sorry, i couldn't find anything in jira, could you please point me to the relevant posts?

      and also, if using springs terms, i'd expect a user to be able to write an xml file with *his* beans, but reference the *predefined* beans (written in some other xml, which is part of the application, and not customized). something like:
      <bean id="myMenu".../>

      <bean ref="navigationBar"> <!-- already defined somewhere else (main configuration)-->
      <list add="true"> <!-- not to override other plugins -->
      <ref ref="myMenu"/>

      even nicer, with the example i have, i don't realy need a backing java bean. i can manage by:
      <bean id="myMenu" mock="true"> <!-- mock means just a set of properties -->
      <prop key="display">New Item</prop>
      <prop key="url">http://myapp/path</prop>

      maybe allow a mixture- a backing bena, but some properties in the xml.

      of course, i'm just writing from the top of my head, mabye current mechanisms in spring give the same end result.



      • #4
        Context reloading :