Hello Forks,
I'm trying to do is kicking some action(MBean) by creating management rule.
I wrte codes below.
--------- MBean for checking -------------------------------
package mbean1;
public class GFMBean1 implements GFMBean1MBean {
public GFMBean1() {}
private String message = "sample";
@Override
public String getMessage() {
return this.message;
}
@Override
public void setMessage(String msg) {
this.message = msg;
}
}
------------ MBean for Action -------------------------------------------
package mbean1;
import javax.management.Notification;
import javax.management.NotificationListener;
import java.util.logging.Logger;
public class GFMAction implements GFMActionMBean, NotificationListener {
Logger log = Logger.getLogger("GFMAction");
public GFMAction() {}
@Override
public synchronized void handleNotification(Notification notification, Object handback) {
log.info("**** Recieved Notification *****");
}
}
I use asadmin to create mbean. It successfully ends.
create-mbean --user admin --name GFMBean1 mbean1.GFMBean1
create-mbean --user admin --name GFMAction mbean1.GFMActionBean
I use admin console to create a rule.
The log says SGMT0017 IrregalArgument is specified.
Event type: monitor
MBean: user:impl-class-name=mbean1.GFMBean1,name=GFMBean1,server=server
Check Period: 1000msec
Check type: String
Triger: Equals
Value: MAJIMA
I use Jconsole to set Message MAJIMA. There is **** Recieved Notification **** in server.log.
I'm confused because SGMT0017 is in the log but it works like I think.
Pointing out what argument is wrong helps me.
Could someone let me know why SGMT0017 occuers?
Thanks in advance,
Susumu Majima