Regarding ModeShape & AS7 - the only way you can configure a repository, is via JBoss's subsystem - either XML directly or via CLI. The reason why this is required, is that unlike the "embedded JSON" mode, ModeShape needs to "hook into" JBoss's Infinispan, JDNI, JGroups etc subsystems (as opposed to starting its own, independent instances of each).
As far as embedding ModeShape in Tomcat/other web/application servers, we don't have any running examples yet, although we will create such examples in the future. In the meantime, since running in another server is pretty similar to running in standalone, embedded mode, I can point you to the following links:
- https://docs.jboss.org/author/display/MODE/ModeShape+in+Java+applications and https://docs.jboss.org/author/display/MODE/ModeShape+in+web+applications - our documentation page
- https://github.com/ModeShape/modeshape-examples/tree/master/modeshape-embedded-example - is a standalone, embedded, example but the code itself is pretty close to the code you would write in an "independent war" file,
- https://github.com/ModeShape/modeshape-examples/tree/master/modeshape-web-example - is a Servlet example that was built for AS7, but you can see different ways of accessing a repository from Servlet code.