-
1. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 13, 2005 9:32 AM (in response to traveldoo2)Since your deployment contains mbeans, it should be named:
snapshots-service.xml -
2. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 13, 2005 11:06 AM (in response to traveldoo2)Thank you very much, the deployment is now ok.
By the way, as the Reccording attribute is read-only, I had to remove it from my xml.
But I'm having another problem now : I want the Snapshot to be started automagically, thus needing to execute startSnapshot() after deployment.
How can I do that ? Is it possible ?
Thanks in advance. -
3. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 13, 2005 12:04 PM (in response to traveldoo2)You can't automagically call startSnapshot() :(
And especially for SnapshotRecordingMonitorMBean I see, there is no method
void setEnabled(boolean start);
This one exists in the other 3 monitors and would cause the effect you want, so I guess somebody forgot to add it... -
4. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 17, 2005 3:25 AM (in response to traveldoo2)Well we could assume that as snapshots can generate big loads of data if improperly configured, one has not implemented it in order to force people starting them manually.
Anyway, thanks for your answers. One thing I don't understand why I could have invoked setEnabled() and not startSnapshot() ? -
5. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 17, 2005 9:12 AM (in response to traveldoo2)setEnabled(boolean) can be called because this is an 'attribute' in terms of JMX, and not an operation.
Attributes can be set at deployment time, using:
...
true
... -
6. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 17, 2005 9:13 AM (in response to traveldoo2)(lost the xml elements...)
... <mbean code="..." name="..."> attribute name="Enabled">true</attribute> </mbean> ...
-
7. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 17, 2005 10:22 AM (in response to traveldoo2)"dimitris@jboss.org" wrote:
setEnabled(boolean) can be called because this is an 'attribute' in terms of JMX, and not an operation.
Attributes can be set at deployment time, using:
...
<mbean code="..." name="...">
<attribute name="Enabled">true</attribute>
</mbean>
...
Well in this case I should be able to change the Recording attribute (Enabled-equivalent I think), as setRecording() exists. But on deployment I am told that this is a read-only attribute (note : I'm using Jboss 4.0.0)public boolean isRecording() { return recording; } public void setRecording(boolean start) { if (start == recording) return; recording = start; if (start) { startMonitorThread(); } }
Whatever, nothing keeps me from modifying the class, am I right ? In our case, implementing recording as a read-write Attribute should be enough ?
So I only need to implement getRecording() and setRecording() properly for JBoss to consider Recording as a read/write attribute and allowing me to set it upon deployment...
Please tell me if I'm wrong. Does JBoss use only the methods signatures to know what is and what isn't an attribute ? -
8. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 17, 2005 2:33 PM (in response to traveldoo2)Recognizing what makes an attribute and what an operation is part of the JMX specification for Standard mbeans.
get();
void set();
It would be simple to just copy the implementation and make your own class. Preferably you would make a patch and post it to a JIRA case as a reminder for us to change it in the code, eventually. -
9. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 17, 2005 2:34 PM (in response to traveldoo2)<type> get<AttrName>(); void set<AttrName>(<type>);
-
10. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 18, 2005 9:18 AM (in response to traveldoo2)Thank you very much for your help, I get it to work.
I first tried to make a new class. Also it's compiling well, the Webconsole applet don't list my custom snapshots, as it is listing only the original-type objects.
Yes it could be possible to modify the viewing applet also, but I don't really have the time to do it so I just modified sources this way :/*SnapshotRecordingMonitorMBean.java*/ /* defining get and set method for the attribute in the MBean interface. */ void setRecording(boolean start); boolean getRecording();
/*SnapshotRecordingMonitor.java*/ /* implementing the get method for the attribute. Note : setRecording is already defined */ public boolean getRecording() { return recording; }
then deploying is fairly simple :<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.monitor.SnapshotRecordingMonitor" name="jboss.monitor:service=SnapshotFreeMemory"> <attribute name="MonitorName">Snapshot memoire libre</attribute> <attribute name="ObservedObject">jboss.system:type=ServerInfo</attribute> <attribute name="ObservedAttribute">FreeMemory</attribute> <attribute name="Period">30000</attribute> <attribute name="Recording">true</attribute> </mbean> </server>
As to post it to a JIRA case, how can I do that ? -
11. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 18, 2005 6:55 PM (in response to traveldoo2)goto jira.jboss.com and open a task on the application server with minor priority, for the management module. Include a link to this forum post.
http://jira.jboss.com/jira/secure/CreateIssue!default.jspa
you probably need to register there first. -
12. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 19, 2005 3:44 AM (in response to traveldoo2)Done. The case is here :
http://jira.jboss.com/jira/browse/JBWEB-25
Thanks for your help. -
13. Re: WebConsole : making snapshots persisted - issues with de
dimitris May 19, 2005 4:54 AM (in response to traveldoo2)Could you actually close this and re-open it in the JBAS (JBoss application server) project? JBWEB is the tomcat integration.
Thanks! -
14. Re: WebConsole : making snapshots persisted - issues with de
traveldoo2 May 19, 2005 5:14 AM (in response to traveldoo2)My mistake.
Here is the new task :
http://jira.jboss.com/jira/browse/JBAS-1832
But I didn't find out how to close the first one. Are you sure I can ?
I edited it in order to warn the reader.