Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-1
    • Component/s: core
    • Labels:
      None
    • Environment:
      all
    • Number of attachments :
      1

      Description

      For components which are not clearly type 1, type 2 or type 3, it can be useful to allow more freeform initialization by supporting scripts.

        Activity

        Hide
        Leo Simons added a comment -

        Adding a simple component adapter factory implementation which will look for a $

        {path-to-class}

        .init.bsh to instantiate a component. Basic testcase attached.

        Show
        Leo Simons added a comment - Adding a simple component adapter factory implementation which will look for a $ {path-to-class} .init.bsh to instantiate a component. Basic testcase attached.
        Leo Simons made changes -
        Field Original Value New Value
        Attachment bshscripted.zip [ 10801 ]
        Aslak Hellesøy made changes -
        Status Unassigned [ 1 ] Assigned [ 2 ]
        Assignee Aslak Hellesoy [ rinkrank ]
        Hide
        Aslak Hellesøy added a comment -

        Applied. This is very very cool stuff. Compact and powerful. And a good showcase that it's easy to plug in most anything into PicoContainer with special Component Adapters. Well done

        Being a pedant, I have done some modifications here and there:

        o Made the adapter look for the script as an URL resource instead of a file.
        o Made the adapter cache the instance. This is required by the "contract" declared in the ComponentAdapter interface.
        o Removed the util class, as it is not needed.
        o Removed dependency on commons-logging, to make the test/example simpler and a bit clearer. And to please Paul, who is on a crusade against logging
        o Simplified the test bean - an interface is not really needed.
        o Made the bsh script do some things that is later asserted in the test case.
        o Changed the license from Jicarilla to BSD.
        o Changed the formatting and coding standard according to the rest of the project.
        o Added some javadocs.
        o Mavenised it.
        o Modified the script variables a tiny bit.
        o Changed the script extension from init.bsh to just .bsh (for the sake of simplicity)
        o Improved exception handling.

        Show
        Aslak Hellesøy added a comment - Applied. This is very very cool stuff. Compact and powerful. And a good showcase that it's easy to plug in most anything into PicoContainer with special Component Adapters. Well done Being a pedant, I have done some modifications here and there: o Made the adapter look for the script as an URL resource instead of a file. o Made the adapter cache the instance. This is required by the "contract" declared in the ComponentAdapter interface. o Removed the util class, as it is not needed. o Removed dependency on commons-logging, to make the test/example simpler and a bit clearer. And to please Paul, who is on a crusade against logging o Simplified the test bean - an interface is not really needed. o Made the bsh script do some things that is later asserted in the test case. o Changed the license from Jicarilla to BSD. o Changed the formatting and coding standard according to the rest of the project. o Added some javadocs. o Mavenised it. o Modified the script variables a tiny bit. o Changed the script extension from init.bsh to just .bsh (for the sake of simplicity) o Improved exception handling.
        Aslak Hellesøy made changes -
        Fix Version/s 1.0-alpha-1 [ 10146 ]
        Resolution Fixed [ 1 ]
        Status Assigned [ 2 ] Closed [ 6 ]

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            Leo Simons
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Remaining Estimate - 1 day
              1d
              Logged:
              Time Spent - Not Specified
              Not Specified