Your custom codes may require some major changes. I would suggest you to go through JBossAS7 documentation to know how you can create your own custom modules in JBossAS7 and change your code accordingly.