users@glassfish.java.net

Re: Deploy a Trivial mbean

From: jsexton0 <jsexton0_at_gmail.com>
Date: Tue, 20 Oct 2009 15:01:24 -0700 (PDT)

Sorry to keep answering my own question. There isn't a lot of info on this,
so this may help others. In order to be used as a rule action, the MBean
implementation must implement NotificationListener directly. I saw at least
one example where the MBean interface extended NotificationListener, and the
listener class just implemented the resulting MBean interface. This will
deploy in Glassfish as a Custom MBean, but it will not show up as an Action
in Management Rules. The action class must implement NotificationListener
directly.

It works!


jsexton0 wrote:
>
> After several tries, I unchecked the compress option in eclipse, and this
> MBean deployed. It looks normal. However in the management rules area,
> the "Action" drop down list is empty. What does an MBean need to be in
> order to be available for use in a rule?
>
> Thanks
>
>
>
> jsexton0 wrote:
>>
>> I'm working on using an mbean to respond to an event. I'd like to get
>> logged messages eventually. For now, I made an interface:
>>
>> public interface CustomActionMBean extends NotificationListener {
>> }
>>
>> And a class:
>>
>> public class CustomAction implements CustomActionMBean {
>> public void handleNotification(Notification arg0, Object arg1) {
>> }
>> }
>>
>> I jar them up and try to use the admin console to deploy. It fails
>> saying the class does not follow the Standard MBean conventions. What
>> are these conventions other than the class name being the same as the
>> interface name sans "MBean"?
>>
>> Thanks
>>
>
>

-- 
View this message in context: http://www.nabble.com/Deploy-a-Trivial-mbean-tp25980380p25983296.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.