| <?xml version="1.0"?> |
| <!-- |
| Copyright 2004, 2005 The Apache Software Foundation |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <module id="timetracker.db" version="1.0.0" |
| package="org.apache.tapestry.timetracker.jdbc"> |
| |
| <contribution configuration-id="hivemind.SymbolSources"> |
| <source name="SystemProps" before="*" |
| class="org.apache.hivemind.impl.SystemPropertiesSymbolSource" /> |
| </contribution> |
| |
| <service-point id="HsqlConnProxyFactory" |
| interface="org.apache.hivemind.ServiceImplementationFactory" |
| parameters-occurs="none"> |
| Core service implementation factory that constructs dynamic |
| proxies to dbcp connection pools |
| <invoke-factory service-id="hivemind.BuilderFactory"> |
| <construct class="DataSourceProxyFactory" autowire-services="false"> |
| <set-service property="dataSource" service-id="HsqlDataSource" /> |
| <set-service property="installer" service-id="DatabaseInstaller" /> |
| </construct> |
| </invoke-factory> |
| </service-point> |
| |
| <service-point id="HsqlDataSource" |
| interface="org.apache.commons.dbcp.BasicDataSource" |
| parameters-occurs="none"> |
| |
| Basic apache database pool service. |
| <invoke-factory service-id="hivemind.BuilderFactory"> |
| <construct |
| class="org.apache.commons.dbcp.BasicDataSource"> |
| <set property="driverClassName" |
| value="org.hsqldb.jdbcDriver" /> |
| <set property="url" |
| value="jdbc:hsqldb:file:tapestry-timetrackerdb" /> |
| <set property="initialSize" value="1" /> |
| <set property="maxActive" value="2" /> |
| <set property="maxWait" value="40000" /> |
| <set property="username" value="sa" /> |
| <set property="poolPreparedStatements" value="true" /> |
| <set property="maxOpenPreparedStatements" value="20" /> |
| </construct> |
| </invoke-factory> |
| </service-point> |
| |
| <service-point id="HsqlConnection" interface="java.sql.Connection"> |
| DB Connection for derby database |
| <invoke-factory service-id="HsqlConnProxyFactory" model="threaded" /> |
| </service-point> |
| |
| <service-point id="DatabaseInstaller" interface="DatabaseInstaller"> |
| Ensures the database has been created/initialised. |
| <invoke-factory service-id="hivemind.BuilderFactory"> |
| <construct class="DatabaseInstaller" autowire-services="true" > |
| <set-service property="globals" service-id="tapestry.globals.ApplicationGlobals" /> |
| <set property="filePath" value="WEB-INF/createDatabase.sql" /> |
| </construct> |
| </invoke-factory> |
| </service-point> |
| |
| </module> |