Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-370

Allow for a more type-safe way to set properties when using Guice integration

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Currently, setting properties when using Guice integration is somewhat hacky. We're just binding constants to strings, and hoping that the names match up with method calls. I would prefer something more guicey, that provides us with the typesafety that I tend to expect from Guice.

      My thought is to allow methods, similar to the @Provides methods, on the ShiroModule and ShiroWebModule with a @Configures annotation. These methods would then be essentially wrapped in a MembersInjector and setup to be passed a particular object just after its instantiation.

      The goal would be to allow something like this in the module:

      @Configures
      public void configureSessionManager(DefaultWebSessionManager webSessionManager, Cookie cookie)

      { webSessionManager.setSessionIdCookie(cookie); webSessionManager.setGlobalSessionTimeout(5000L); }

      The DefaultWebSessionManager would be the bean being injected, while the Cookie would simply be treated as an injected dependency, much like the arguments in a @Provides method.

      Attachments

        Activity

          People

            deraj123 Jared Bunting
            deraj123 Jared Bunting
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: