Added new code for attaching to JBoss AS 7 and Wildfly AS 8