You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by Jared Bunting <ja...@peachjean.com> on 2012/05/19 15:28:57 UTC

JMX Support

As part of a project at my day job, we are adding a fair bit of JMX 
instrumentation to our product.  As a part of this effort, I will be 
creating some MBeans for shiro and I would like to include these in the 
project.  So I have some questions for the community.

1. Would this be of interest?
2. What sort of MBeans would you like to see?  The ones that I would 
like and am thinking of are listed below.
3. Are there any architectural thoughts on how I should go about this?  
My plan right now is to write some MXBean interfaces and then implement 
them.

This is my first pass at what I intend to expose.  I'm sure that I'll 
think of more information as I go.

Beans:

SecurityManagerMXBean
  Attributes:
   authenticators
   authorizers
   session manager
  Operations:
   username/password authentication check (and subsequent subject 
introspection)
   subject permission/role check

SessionDaoMXBean
   Attributes:
     active sessions
   Operations:
     delete session

RealmMXBean (per realm)
   Attributes:
     configuration
   Operations:
     username/password authentication check (and subsequent subject 
introspection)
     subject permission/role check

FilterMXBean (per filter)
   Attributes
     configuration
   Operations:
     enable/disable

FilterChainMXBean
   Attributes:
     filter chains
   Operations:
     whatChainMapsToUrl
     username/password authentication check for a specified url


As you can see, my goals is "introspect and potentially change the 
configuration of objects" and "test assertions about how shiro objects 
behave".

I don't have a timeline for this yet, but I'd like to know your thoughts.

Thanks,
Jared

Re: JMX Support

Posted by Les Hazlewood <lh...@apache.org>.
This seems the most logical approach to me - I just wanted to make
sure that we do it in a clean enough way that we can make it work
across environments.

On Mon, May 21, 2012 at 3:56 PM, Jared Bunting
<ja...@peachjean.com> wrote:
> I'm thinking that the registration will be done separately for each
> injection environment.  Both Spring and Guice expose some sort of
> instantiation listener so it makes sense to me to use those mechanisms.
>  The Guice one should be pretty straightforward, but it's been so long
> since I've worked with Spring, I'll have to do some reading on that one.
>
> -Jared
>
> On Mon 21 May 2012 04:12:17 PM CDT, Les Hazlewood wrote:
>> That makes sense to me.  What about Spring/Guice environments?  Would
>> they use this same mechanism or potentially something different?
>>
>> --
>> Les Hazlewood
>> CTO, Stormpath | http://stormpath.com | 888.391.5282
>> twitter: @lhazlewood | http://twitter.com/lhazlewood
>> blog: http://leshazlewood.com
>> stormpath blog: http://www.stormpath.com/blog
>>
>>
>> On Mon, May 21, 2012 at 1:06 PM, Jared Bunting
>> <ja...@peachjean.com> wrote:
>>> I think that is probably how I am going to go about this.  My only
>>> thought is that I may want to add some sort of "instantiation listener"
>>> to the ini factories that can be called by shiro-jmx to register an
>>> MBean whenever it sees an object instantiated that should have one.
>>>
>>> Thoughts?
>>>
>>> -Jared
>>>
>>> On Mon 21 May 2012 01:01:41 PM CDT, Les Hazlewood wrote:
>>>> I love this idea.  Could you contribute it as a new support module?
>>>> e.g. shiro-jmx?
>>>>
>>>> Looking forward to seeing it!
>>>>
>>>> Best,
>>>>
>>>> --
>>>> Les Hazlewood
>>>> CTO, Stormpath | http://stormpath.com | 888.391.5282
>>>> twitter: @lhazlewood | http://twitter.com/lhazlewood
>>>> blog: http://leshazlewood.com
>>>> stormpath blog: http://www.stormpath.com/blog
>>>>
>>>>
>>>> On Sat, May 19, 2012 at 11:58 PM, jleleu <le...@gmail.com> wrote:
>>>>> Hi Jared,
>>>>>
>>>>> It's a good idea to add JMX support to Shiro as it's always nice to have
>>>>> MBeans to monitor an application.
>>>>> What you propose seems to be pretty complete and sufficient.
>>>>>
>>>>> Nonetheless, I think that you could add some information about performance
>>>>> (to see what is really used and where time is consumed in the application) :
>>>>> - counters on calls (filters, realms, ...)
>>>>> - counters on reads / writes (session...)
>>>>> - time spent in different parts (filters, realms, ...)
>>>>>
>>>>> Best regards,
>>>>> Jérôme
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
>>>>> Sent from the Shiro Developer mailing list archive at Nabble.com.
>>>
>>>
>
>

Re: JMX Support

Posted by Jared Bunting <ja...@peachjean.com>.
I'm thinking that the registration will be done separately for each 
injection environment.  Both Spring and Guice expose some sort of 
instantiation listener so it makes sense to me to use those mechanisms. 
 The Guice one should be pretty straightforward, but it's been so long 
since I've worked with Spring, I'll have to do some reading on that one.

-Jared

On Mon 21 May 2012 04:12:17 PM CDT, Les Hazlewood wrote:
> That makes sense to me.  What about Spring/Guice environments?  Would
> they use this same mechanism or potentially something different?
>
> --
> Les Hazlewood
> CTO, Stormpath | http://stormpath.com | 888.391.5282
> twitter: @lhazlewood | http://twitter.com/lhazlewood
> blog: http://leshazlewood.com
> stormpath blog: http://www.stormpath.com/blog
>
>
> On Mon, May 21, 2012 at 1:06 PM, Jared Bunting
> <ja...@peachjean.com> wrote:
>> I think that is probably how I am going to go about this.  My only
>> thought is that I may want to add some sort of "instantiation listener"
>> to the ini factories that can be called by shiro-jmx to register an
>> MBean whenever it sees an object instantiated that should have one.
>>
>> Thoughts?
>>
>> -Jared
>>
>> On Mon 21 May 2012 01:01:41 PM CDT, Les Hazlewood wrote:
>>> I love this idea.  Could you contribute it as a new support module?
>>> e.g. shiro-jmx?
>>>
>>> Looking forward to seeing it!
>>>
>>> Best,
>>>
>>> --
>>> Les Hazlewood
>>> CTO, Stormpath | http://stormpath.com | 888.391.5282
>>> twitter: @lhazlewood | http://twitter.com/lhazlewood
>>> blog: http://leshazlewood.com
>>> stormpath blog: http://www.stormpath.com/blog
>>>
>>>
>>> On Sat, May 19, 2012 at 11:58 PM, jleleu <le...@gmail.com> wrote:
>>>> Hi Jared,
>>>>
>>>> It's a good idea to add JMX support to Shiro as it's always nice to have
>>>> MBeans to monitor an application.
>>>> What you propose seems to be pretty complete and sufficient.
>>>>
>>>> Nonetheless, I think that you could add some information about performance
>>>> (to see what is really used and where time is consumed in the application) :
>>>> - counters on calls (filters, realms, ...)
>>>> - counters on reads / writes (session...)
>>>> - time spent in different parts (filters, realms, ...)
>>>>
>>>> Best regards,
>>>> Jérôme
>>>>
>>>>
>>>> --
>>>> View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
>>>> Sent from the Shiro Developer mailing list archive at Nabble.com.
>>
>>



Re: JMX Support

Posted by Les Hazlewood <lh...@apache.org>.
That makes sense to me.  What about Spring/Guice environments?  Would
they use this same mechanism or potentially something different?

--
Les Hazlewood
CTO, Stormpath | http://stormpath.com | 888.391.5282
twitter: @lhazlewood | http://twitter.com/lhazlewood
blog: http://leshazlewood.com
stormpath blog: http://www.stormpath.com/blog


On Mon, May 21, 2012 at 1:06 PM, Jared Bunting
<ja...@peachjean.com> wrote:
> I think that is probably how I am going to go about this.  My only
> thought is that I may want to add some sort of "instantiation listener"
> to the ini factories that can be called by shiro-jmx to register an
> MBean whenever it sees an object instantiated that should have one.
>
> Thoughts?
>
> -Jared
>
> On Mon 21 May 2012 01:01:41 PM CDT, Les Hazlewood wrote:
>> I love this idea.  Could you contribute it as a new support module?
>> e.g. shiro-jmx?
>>
>> Looking forward to seeing it!
>>
>> Best,
>>
>> --
>> Les Hazlewood
>> CTO, Stormpath | http://stormpath.com | 888.391.5282
>> twitter: @lhazlewood | http://twitter.com/lhazlewood
>> blog: http://leshazlewood.com
>> stormpath blog: http://www.stormpath.com/blog
>>
>>
>> On Sat, May 19, 2012 at 11:58 PM, jleleu <le...@gmail.com> wrote:
>>> Hi Jared,
>>>
>>> It's a good idea to add JMX support to Shiro as it's always nice to have
>>> MBeans to monitor an application.
>>> What you propose seems to be pretty complete and sufficient.
>>>
>>> Nonetheless, I think that you could add some information about performance
>>> (to see what is really used and where time is consumed in the application) :
>>> - counters on calls (filters, realms, ...)
>>> - counters on reads / writes (session...)
>>> - time spent in different parts (filters, realms, ...)
>>>
>>> Best regards,
>>> Jérôme
>>>
>>>
>>> --
>>> View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
>>> Sent from the Shiro Developer mailing list archive at Nabble.com.
>
>

Re: JMX Support

Posted by Jared Bunting <ja...@peachjean.com>.
I think that is probably how I am going to go about this.  My only 
thought is that I may want to add some sort of "instantiation listener" 
to the ini factories that can be called by shiro-jmx to register an 
MBean whenever it sees an object instantiated that should have one.

Thoughts?

-Jared

On Mon 21 May 2012 01:01:41 PM CDT, Les Hazlewood wrote:
> I love this idea.  Could you contribute it as a new support module?
> e.g. shiro-jmx?
>
> Looking forward to seeing it!
>
> Best,
>
> --
> Les Hazlewood
> CTO, Stormpath | http://stormpath.com | 888.391.5282
> twitter: @lhazlewood | http://twitter.com/lhazlewood
> blog: http://leshazlewood.com
> stormpath blog: http://www.stormpath.com/blog
>
>
> On Sat, May 19, 2012 at 11:58 PM, jleleu <le...@gmail.com> wrote:
>> Hi Jared,
>>
>> It's a good idea to add JMX support to Shiro as it's always nice to have
>> MBeans to monitor an application.
>> What you propose seems to be pretty complete and sufficient.
>>
>> Nonetheless, I think that you could add some information about performance
>> (to see what is really used and where time is consumed in the application) :
>> - counters on calls (filters, realms, ...)
>> - counters on reads / writes (session...)
>> - time spent in different parts (filters, realms, ...)
>>
>> Best regards,
>> Jérôme
>>
>>
>> --
>> View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
>> Sent from the Shiro Developer mailing list archive at Nabble.com.



Re: JMX Support

Posted by Les Hazlewood <lh...@apache.org>.
I love this idea.  Could you contribute it as a new support module?
e.g. shiro-jmx?

Looking forward to seeing it!

Best,

--
Les Hazlewood
CTO, Stormpath | http://stormpath.com | 888.391.5282
twitter: @lhazlewood | http://twitter.com/lhazlewood
blog: http://leshazlewood.com
stormpath blog: http://www.stormpath.com/blog


On Sat, May 19, 2012 at 11:58 PM, jleleu <le...@gmail.com> wrote:
> Hi Jared,
>
> It's a good idea to add JMX support to Shiro as it's always nice to have
> MBeans to monitor an application.
> What you propose seems to be pretty complete and sufficient.
>
> Nonetheless, I think that you could add some information about performance
> (to see what is really used and where time is consumed in the application) :
> - counters on calls (filters, realms, ...)
> - counters on reads / writes (session...)
> - time spent in different parts (filters, realms, ...)
>
> Best regards,
> Jérôme
>
>
> --
> View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
> Sent from the Shiro Developer mailing list archive at Nabble.com.

Re: JMX Support

Posted by jleleu <le...@gmail.com>.
Hi Jared,

It's a good idea to add JMX support to Shiro as it's always nice to have
MBeans to monitor an application.
What you propose seems to be pretty complete and sufficient.

Nonetheless, I think that you could add some information about performance
(to see what is really used and where time is consumed in the application) :
- counters on calls (filters, realms, ...)
- counters on reads / writes (session...)
- time spent in different parts (filters, realms, ...)

Best regards,
Jérôme


--
View this message in context: http://shiro-developer.582600.n2.nabble.com/JMX-Support-tp7566899p7567612.html
Sent from the Shiro Developer mailing list archive at Nabble.com.