All Downloads are FREE. Search and download functionalities are using the official Maven repository.

OSGI-INF.blueprint.datasource-derby.xml Maven / Gradle / Ivy

There is a newer version: 8.0.1.R2024-05-RT
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Service Activity Monitoring :: Datasource-derby
  %%
  Copyright (C) 2011 - 2012 Talend Inc.
  %%
  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.
  #L%
  -->

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
    default-activation="lazy">

    <cm:property-placeholder persistent-id="org.talend.esb.datasource.derby" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="datasource.server" value="localhost"/>
            <cm:property name="datasource.port" value="1527"/>
            <cm:property name="datasource.database" value="db"/>
            <cm:property name="datasource.create" value="create"/>
            <cm:property name="datasource.username" value="test"/>
            <cm:property name="datasource.password" value="test"/>
            <cm:property name="datasource.pool.maxActive" value="20"/>
            <cm:property name="datasource.pool.maxIdle" value="5"/>
            <cm:property name="datasource.pool.maxWait" value="-1"/>
        </cm:default-properties>
    </cm:property-placeholder>


    <bean id="derbyDataSource" class="org.apache.derby.jdbc.ClientConnectionPoolDataSource">
        <property name="serverName" value="${datasource.server}"/>
        <property name="portNumber" value="${datasource.port}"/>
        <property name="databaseName" value="${datasource.database}"/>
        <property name="createDatabase" value="${datasource.create}" />
        <property name="user" value="${datasource.username}"/>
        <property name="password" value="${datasource.password}"/>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.datasources.SharedPoolDataSource" destroy-method="close">
        <property name="connectionPoolDataSource" ref="derbyDataSource"/>
        <property name="maxActive" value="${datasource.pool.maxActive}"/>
        <property name="maxIdle" value="${datasource.pool.maxIdle}"/>
        <property name="maxWait" value="${datasource.pool.maxWait}"/>
    </bean>

    <service ref="dataSource" interface="javax.sql.DataSource">
        <service-properties>
            <entry key="org.talend.esb.datasource.name" value="ds-derby"/>
            <entry key="osgi.jndi.service.name" value="jdbc/sam"/>
        </service-properties>
    </service>

</blueprint>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy