You might want to do like Jetty.
They have one MBean that speaks JBoss,
i.e. it is a JBoss Service with all the lifecycle methods.
This MBean then registers/unregisters the others.
You will probably need one MBean for each appserver.
Alternatively, look at Dynamic/ModelMBeans. It should be
possible to expose different management interfaces
depending on the AppServer.
How you determine which server you are on is left as an
exercise to the reader. MBeanServer.getDefaultDomain()?
I had the same requirement, to write some MBeans that have no vendor specific code in them. The way I did this is to write an additional MBean that does have JBoss specific code. I added code in the jboss.jcml file to load only this additional MBean. The startService() then instantiates my non JBoss MBeans and registers them with the server. Everything seems to work OK.