-
1. Re: Mbean example/docs available ?
adrian.brock May 8, 2003 4:58 PM (in response to djharte)Look at user-service.xml for example config
A possible implementation would be
package my.company;
public class MyService extends org.jboss.system.ServiceMBeanSupport
{
String myAttribute;
public String getMyAttribute()
{
return myAttribute;
}
public void setMyAttribute(String myAttribute)
{
this.myAttribute = myAttribute;
}
protected void startService()
throws Exception
{
log.info("Called at startup");
log.info("The attribute has already been set " + myAttribute);
}
protected void stopService()
throws Exception
{
log.info("Called at shutdown");
}
}
package my.company;
public interface MyServiceMBean extends org.jboss.system.ServiceMBean
{
String getMyAttribute();
void setMyAttribute(String myAttrbiute);
}
NOTE: I haven't tested this code so it probably
doesn't compile but you get the idea.
It's fairly trivial.
For more info just look at the JBoss source
or buy Juha's book.
Regards,
Adrian -
2. Re: Mbean example/docs available ?
djharte May 9, 2003 10:33 AM (in response to djharte)Thanks a lot Adrian, that did help, I have it working only I haven't got my depends set up correctly. I want to make it start after all my EJBs have been deployed ....
David -
3. Re: Mbean example/docs available ?
adrian.brock May 11, 2003 4:42 AM (in response to djharte)The easiest way to do that is to put
a dependency on the URLDeployment scanner.
The hard way is to list every ejb in the depends
tag.
You will get a warning saying it is not completly
deployed (which is true - it hasn't started when
the scanner finishes starting). But you can
ignore it.
Do you really want to depend on every EJB?
I suspect what you really want to know is
what ejbs are deployed.
Regards,
Adrian