Which version of JBoss AS?
I'm using Jboss 4.2.3 GA
I was going to point you to the documentation, but it is thoroughly confusing (uses an unknown ant script). Instead, look at the ServiceBindingManager MBean in server/xxx/conf/jboss-service.xml. The comments for the mbean explain how it works.