Hello there! I've created MBeans several times on jboss, and I can't find what am I missing here.
I'm developing a DatabaseRecordProcessor, it's start method looks like this:
public void start() throws Exception{ try { MBeanServer server = MBeanServerLocator.locate(); ManagedEndpointRegistryMBean registry = (ManagedEndpointRegistryMBean)MBeanProxyExt.create(ManagedEndpointRegistryMBean.class, "jboss.ws:service=EndpointRegistry"); Set<ObjectName> names = registry.getEndpoints(); for(ObjectName o : names){ ((ManagedEndpointMBean)MBeanProxyExt.create(ManagedEndpointMBean.class, o)).addRecordProcessor(this); } } catch (Exception e) { e.printStackTrace(); } }
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean name="bobsam:service=DatabaseRecordProcessor" code="com.furiousbob.management.DatabaseRecordProcessor"> <depends>jboss.ws:service=EndpointRegistry</depends> </mbean> </server>