This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
By API, do you mean you want to use it programatically? Would XDoclet do the job for you? Have a look at the securitydomain attribute in jbosswebxml task. This task will autogenerate the jboss-web.xml with the security-domain tag in it.