[infinispan-dev] ResourceDMBean.invoke() should only allow for methods marked with @ManagedOperation to be called from MBeanServer.invoke()

Galder Zamarreno galder.zamarreno at redhat.com
Tue Sep 8 12:58:45 EDT 2009



On 09/08/2009 06:49 PM, Galder Zamarreno wrote:
>
>
> On 09/08/2009 06:41 PM, Galder Zamarreno wrote:
>> Hi again,
>>
>> Another thing I've spotted. I've realised that you can
>> MBeanServer.invoke() to call any method on a class that is exposed as
>> MBean via @MBean annotation because of the logic in ResourceDMBean.invoke().
>>
>> Shouldn't such invocations be limited only to those methods that have
>> been exposed via @ManagedOperation?
>
> Actually, I'm not sure about this. Need to check the spec.

Yeah, this is correct. In a standard MBean, the operation called must be 
part of the MBean interface, otherwise it fails. So, it must be exposed 
somehow. In a required model mbean, the operation must have been defined 
as an MBean method.

So, yeah, ResourceDMBean.invoke() needs to check whether the method 
called is a managed operation or not. I'll create a jira for this asap.

>
>>
>> Cheers,
>

-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the infinispan-dev mailing list