Hi Les,
Yes, in my first post I didn't want to overwhelm you with irrelevant details
so it was a bit short... ;)
Our app currently uses Shiro in the standard web servlet way, that is, I
have IniShiroFilter in my web.xml file and all incoming http requests are
intercepted by Shiro. In my shiro.ini, I don't specify a securityManager
class, so it decides to instantiate a DefaultWebSecurityManager on its own,
which is fine.
For our deamon processes, we have a web filter and within its init() method,
we instantiate some objects, including a singleton, initialize our scheduler
and then process to kick off Java threads here and there. In my deamon
task, when I call getSecurityManager(), it can't find any threadlocal
information (which I expect). Then it tries the static secuirtyManager which
also returns null so the exception is thrown.
(We don't do anything special with classloading.)
If I could "discover" a reference to the DefaultWebSecurityManger instance,
I could then call setSecurityManager() and that I believe would work. OR...
if my deamon thread could "register" itself with threadlocal info, then that
might work also. In either case, perhaps you can comment on how you would
recommend this should be approached.
BTW, I don't think it's possible, but it would be cool if I could construct
a Subject with certain roles, such as: new
Subject.Builder().withRole("deamon").buildSubject().
Thanks a lot,
Dan
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/Daemon-Task-tp6292830p6292929.html
Sent from the Shiro User mailing list archive at Nabble.com.