MODE-1784 - Added a <webapp/> element to the ModeShape AS7 subsystem which allows any web application packaged under the "deployments" folder of the ModeShape main module, to be deployed by the subsystem. This replaces the previous "static" way of copying web applications directly from the kit in the servers "deployments" directory.
MODE-1858 Building query results should work when nodes are concurrently removed

When the query results are being processed/produced, any node that is not
found is simply ignored (treated as non-existant from the perspective
of the query). However, in certain cases, the timing of a removal could
occur within the method that obtains the document from the cache, causing
an exception. This was rectified to return null in such cases. Thus,
the existing code in the BasicTupleCollector that handles null nodes
will continue to work in all cases.

I was not able to come up with a test case able to replicate this scenario,
however. That's because the failure occurs within a single WorkspaceCache
method, after the SchematicEntry is obtained but before the SchematicEntry's
content document can be obtained. A test case cannot reliably ensure
this condition occurs (without adding junk code within the WorkspaceCache).
MODE-1860 - Moved the location of the ModeShape modules back to the "modules" folder. To make this easier to change in the future, a root property was added which controls the location.
MODE-1852 Correct deserialization of events over JGroups channel

JGroups needs to know about the classloader that loads the ModeShape
event classes. The easiest way to do this is to extend ObjectInputStream
to supply and use a classloader for deserialization. This is especially
important in AS7/EAP and OSGi, where a single classloader is not used
for all the components.
MODE-1856 Attempt to index changes only when there are real changes

The internal session nodes that track transient changes were not
correctly recording how a property was removed. If a property were
added and immediately removed (all before saving), the add was
cleared from the transient state but the remove was still kept.
(This was due to the fact that it's more difficult to track removes,
since we're using a single structure to track adds and sets, so
it's not really easy to tell when a property was added and then
removed.) This change works around that constraint by using the
persisted state of the node to determine if any added/set property
already exists in the persisted state. If not, then the remove
is considered to undo the prior add/set.

A single test was added to perform the add/remove prior to a save.
However, due to the eventing mechanism, it's not possible for the
test to verify that the node was not re-indexed. (Simple debugging
and trace logging was used to verify that such changes no longer
cause an update to the node's indexes. If there are better ideas
for how the test can verify, please say so.)
MODE-1861 Database binary store is more adaptable to different DBMSes

Changed how the DatabaseBinaryStore configures and uses the database,
so that the various SQL statements (both DDL and DML) are read from
property files rather than be dynamically created. This means that it
is far easier to see and understand exactly the kinds of statements
that are issued for a given DBMS. It also allows the database table
and statements to be altered slightly for specific DBMSes.

Several DBMS-specific property files (containing the SQL statements)
were added to accommodate the variations in the previously-generated
statements. There is a fair amount of duplication, but each file
is self-contained, is very readable, and can be customized as needed
(including by the user, since additional property files can be created
to override those ModeShape provides out-of-the-box).
IMO, these benefits outweigh the negative aspects of the duplication.

Since several DBMSes (including MySQL, PostgreSQL, Sybase
and SQLServer) consider 'usage' to be a reserved keyword, the 'usage'
column was renamed to 'usage_flag' in the create-table and other
statements for all of the DBMSes. (This shouldn't be a problem,
since the use of reserved words should have prevented creation
of the table in the first place). The statements for the other DBMSes
still use 'usage', but these DBMSes don't consider 'usage' to be a
reserved keyword.

This change also reduced the amount of "general-purpose" JDBC-oriented
code, such as eliminating the SQLBuilder code.

Finally, the Database class now creates PreparedStatement objects
during initialization, and these are reused throughout the lifetime
of the DatabaseBinaryStore. This will increase performance compared
with creating a PreparedStatement every time one is needed.
MODE-1852 Removed unused imports to correct compiler warnings
MODE-1861 Improved error handling and ensured result sets are always closed
MODE-1859 - Fixed the removal of ModeShape services when a repository is removed. Refactored the general remove & recover operations, as they are very similar.
MODE-1854 - Fixed indexing during user transactions: previously, the indexing operations were submitted on a transaction in state COMMITTED, causing Hibernate Search to no see an active transaction.
MODE-1854 - Changes count should only be dispatched & statistics updated if the transaction is successful.