Uploaded image for project: 'XWork'
  1. XWork
  2. XW-844

ResourceFactory for component interceptor

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-beta1
    • 1.0-beta1
    • Interceptors
    • None

    Description

      add a ResourceFactory interface to the xwork component interceptor framework with two method Object create(Map param) and void dispose(Object resource). This would allow the use of resource that couldn't be instantiated using empty constructor and also free the action of the resource initialization and disposal responsibility.
      A standard bean resource factory should be provided for the simplest case of javabean type of resources.

      For e.g,
      <component>
      <scope>session</scope>
      <enabler>com.opensymphony.webwork.example.counter.CounterAware</enabler>
      <factory name="com.opensymphony.xwork.interceptor.component.BeanResourceFactory">
      <param name="class" value="com.opensymphony.webwork.example.counter.Counter"/>
      </factory>
      </component>

      For a more interesting example, we can make hibernate Session a resource and have the following.

      <component>
      <scope>request</scope>
      <enabler>com.opensymphony.webwork.example.HibernateAware</enabler>
      <factory name="com.opensymphony.webwork.example.HibernateSessionFactory"/>
      </component>

      Attachments

        Activity

          People

            Unassigned Unassigned
            lowhs Low Heng Sin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: