-
1. Re: deploy mbean from code on runtime?
starksm64 Mar 12, 2006 12:58 PM (in response to gmeroz)Yes.
-
2. Re: deploy mbean from code on runtime?
plutus Mar 16, 2006 12:42 PM (in response to gmeroz)Hi,
have a look here:
JSR-000003 JavaTM Management
http://jcp.org/aboutJava/communityprocess/final/jsr003/index3.html
download
jmx_1.2_spec.pdf
page 122 "Registration of MBeans"
or here:
http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html
ObjectInstance registerMBean(Object object,
ObjectName name)
throws InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException;
sample code to get mbean server inside jboss (e.g. inside a stateless session bean, jboss has one and only one jmx server):
List servers = MBeanServerFactory.findMBeanServer(null);
if (servers.size() != 1)
throw new EJBException("Not exactly one server found");
MBeanServer mbeanServer = (MBeanServer) servers.get(0);
hth,
Marcel -
3. Re: deploy mbean from code on runtime?
gmeroz Mar 19, 2006 1:27 AM (in response to gmeroz)i used the following code to do this:
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss(); mbeanServer.registerMBean(new MyMBeanImpl(), MyMBeanImpl.OBJECT_NAME);