jbossas/jboss-as — pull request #2774 by fharms (2012-07-31 21:11:39+00:00)
Title: [AS7-1370]  Domain Management - Add support for database authentication.

Added support for database authentication and authorization both in standalone and domain mode. For standalone mode both the configuration with using data source and jdbc outbound connection works, and for the domain mode only the jdbc outbound configuration is valid, by defining a database connection based on the module name, driver name, url, username and password.

For enable the database authentication add following xml to either standalone.xml or host.xml

'

For creating table that match the configuration use the sql statement below :

For starting H2 in server mode call the modules/com/h2database/h2/main/java -cp *.jar org.h2.tools.Server

CREATE TABLE USERS(user VARCHAR(32) PRIMARY KEY, password VARCHAR(255));
CREATE TABLE ROLES(user VARCHAR(32) PRIMARY KEY, role VARCHAR(255));

Please take a look on the SimpleAttributeDefinition for DatabaseConnectionResourceDefinition, DatabaseAuthenticationResourceDefinition and DatabaseAuthorizationResourceDefinition I'm bit unsure if I got them 100% correct
The DatabaseConnectionManagerService has 3 values MAX_WAIT_FOR_LOCK = 60000, MAX_WAIT_FOR_UNUSED_CONNECTIONS = 60000 and MAX_DELAY_FOR_REPEAER_REQUEST = 300000 this might need an extra review.