[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-27 Thread vitor_b
Hey genman

Thanks for your reply. 

1. I know everything i need now :)

2. In this case that is not a very big problem, merge file is not big. Better 
think that even when we have to write merge files, often we don't have to write 
all we need ourselves, anly a part. But hmm... not in this case.

3. Your answer to my question is clear for me. And i see the difference now, 
after removing line from my jboss-service.xml file:

attribute name=JndiNameResourceName/attribute
  | 

This line was the reason why i couldnt see persistence in action. Everytime i 
deployed my xmbean my attribute got a default value. 

But still i need a small clarification or confirmation: Persistence applies 
only to situation when we redeploy our mbean or restart server?

And where jboss stores persistence state for mbeans? I stopped my server and 
deleted all files from 'server'/tmp/deploy drectory, but after started server 
again the attribute of my mbean had exactly the same value like before.

Best regards
vitor_b



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4022979#4022979

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022979
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-27 Thread vitor_b
One more thing:

Standard MBean has three default attributes:
- StateString
- State
- Name

My XMBean has only attributes i created. So if i want to provide these 
attributes for my XMBean what should i do? Is there any way to enable them, or 
i should create attributes myself and change their values personally? I mean, 
do i have to do things like this?:

public class MyService  extends ServiceMBeanSupport {
  | 
  |private String StateString;
  |private int State;
  | 
  |public void start() throws Exception {
  |   //some work
  |   ...
  |   this.State = MBeanSupport.STARTED;
  |   this.StateString = MBeanSupport.states[MBeanSupport.STARTED];
  |}
  | 
  |//other methods here
  | }

Thanks in advance

vitor_b

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4022988#4022988

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022988
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-27 Thread jiwils
vitor_b wrote : But still i need a small clarification or confirmation: 
Persistence applies only to situation when we redeploy our mbean or restart 
server?

I am not sure that your question is clear.  Based on the persistence policy you 
select, it will do different things.  MBean redeployment and/or server restart 
really isn't related.

vitor_b wrote : And where jboss stores persistence state for mbeans?

JBOSS_HOME/server/SERVER_NAME/data/xmbean-attrs is the default location.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023090#4023090

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023090
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-27 Thread jiwils
vitor_b wrote : One more thing:
  | 
  | Standard MBean has three default attributes:
  | - StateString
  | - State
  | - Name
  | 
  | My XMBean has only attributes i created. So if i want to provide these 
attributes for my XMBean what should i do?

Don't use the code in your post.  If you extend ServiceMBeanSupport, you have 
that functionality already.

XMBeans are based on the XML deployment descriptor as the model, so you have to 
specify these attributes in it.  Fortunately, the DTD for the XMBean deployment 
descriptor makes this easy enough.

After making sure you specify the document type like so:

!DOCTYPE mbean PUBLIC
  |-//JBoss//DTD JBOSS XMBEAN 1.2//EN
  |http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd;
  | 

Add the following to your XML in the same section as your other attributes:

defaultAttributes;

You can use the following to add the lifecycle operations as well:

defaultOperations;

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023103#4023103

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023103
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-27 Thread vitor_b
Hey

Thank you for the reply. 
defaltAttributes and defaultOperations work fine with xml using dtd file 
version 1.2.

But unfortunately i cannot force my ant task to generate proper xml file for my 
xmbean (dtd version 1.0, cannot merge etc.). But that is a completely different 
story.

And once again persistence. I believe (after some experiments) that persistence 
for mbean means: stored attribute values for this proper mbean. So it is not 
important what persistence strategy is when our mbean is deployed. We can 
change values of some of attributes and everything works fine. 
Difference is only when we undeploy our mbean, and later deploy again. When an 
attribute of our mbean has no default value (in jboss-service.xml) value of 
this attribute will be initialized with value taken from file containing stored 
values for attributes.
I haven't seen other influence of persistence strategy on mbean.
And my question was: is there any influence on mbean, different from described 
above?

Best regards

vitor_b

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4023263#4023263

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023263
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions

2007-02-26 Thread genman
1. You should be exposing start/stop/destroy etc. methods from ServiceMBean. If 
your XMBean .xml file does not have them, JBoss cannot call them.

2. I'm not an XDoclet expert, but I do know that merging files is an annoyance.

3. The point of persistence is when you change the attributes of an MBean, they 
are saved. The policies are: OnUpdate (save when changed), NoMoreOftenThan 
(save when changed, but only every so often), Never (no), OnTimer (save 
peridocially.) I'm not sure on JBoss treats these.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4022848#4022848

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022848
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user