Jared Bunting created SHIRO-369:
-----------------------------------

             Summary: Guice integration property setting doesn't always work
                 Key: SHIRO-369
                 URL: https://issues.apache.org/jira/browse/SHIRO-369
             Project: Shiro
          Issue Type: Bug
    Affects Versions: 1.2.0
            Reporter: Jared Bunting
            Assignee: Jared Bunting


The mechanism to allow the setting of arbitrary properties on shiro objects in 
Guice doesn't always work and sometimes require a workaround.  The workaround 
is to explicitly bind the class that you want the property to be set upon in 
the ShiroModule.  This is less than ideal.

I believe that the issue is because the type listener that does the property 
setting is bound in the private module, meaning that it only affects beans 
bound in that private module.  However, when bindings to classes aren't made 
specifically in the private module, they occur as just-in-time bindings, which 
are effectively bound at the root binder.  Therefore, the type listener never 
gets to see these bindings.

I believe that the solution is to bind all shiro objects in the ShiroModule 
(and ShiroWebModule as appropriate).  This will cause them to always be bound 
within the private module.  To ensure that this is effective, we will also 
require a test case that scans the classpath for implementations of particular 
interfaces and ensures that they are bound.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to