Shiro
  1. Shiro
  2. SHIRO-217

Create JndiObjectFactory to allow JNDI object acquisition during configuration

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: Configuration
    • Labels:
      None

      Description

      During configuration, it would be nice to acquire objects from JNDI and use the returned objects as properties on other configured objects (e.g. in INI config).

      There is a JndiRealmFactory that already supports looking up entire Realms from JNDI, but it is more likely that lower-level objects would be acquired from JNDI instead (e.g. DataSources) and the Realms would be configured in INI and use those objects.

      This would be pretty easy to support: there is already a Shiro Factory interface and an AbstractFactory class. A new JndiObjectFactory subclass could be created that uses a JndiLocator to look up and acquire objects.

      The ReflectionBuilder implementation would need to be changed to handle encountering Factory objects - if an object in configuration specifies a Factory as a property, the builder needs to call the factory's getInstance method instead of using the Factory directly. I think this could be done in the ReflectionBuilder#resolveReference method without touching any other code.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        420d 6h 5m 1 Les Hazlewood 05/Jan/12 01:01
        Resolved Resolved Closed Closed
        19d 9m 1 Les Hazlewood 24/Jan/12 01:11
        Les Hazlewood made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Les Hazlewood added a comment -

        Closing with the 1.2.0 release.

        Show
        Les Hazlewood added a comment - Closing with the 1.2.0 release.
        Les Hazlewood made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Les Hazlewood added a comment -

        Looks good to me!

        Show
        Les Hazlewood added a comment - Looks good to me!
        Hide
        Jared Bunting added a comment -

        Les - if you are satisfied, I believe that this ticket can be resolved.

        Show
        Jared Bunting added a comment - Les - if you are satisfied, I believe that this ticket can be resolved.
        Jared Bunting made changes -
        Field Original Value New Value
        Assignee Jared Bunting [ deraj123 ]
        Les Hazlewood created issue -

          People

          • Assignee:
            Jared Bunting
            Reporter:
            Les Hazlewood
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development