Skip to content

Instantly share code, notes, and snippets.

@sneakybeaky
Created January 15, 2013 20:19
Show Gist options
  • Save sneakybeaky/4541664 to your computer and use it in GitHub Desktop.
Save sneakybeaky/4541664 to your computer and use it in GitHub Desktop.
Example blueprint config for Jedis poolsource
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="dataSource" class="redis.clients.jedis.JedisPool"
destroy-method="destroy">
<argument index="0" ref="jedisConfig"/>
<argument index="1" value="127.0.0.1"/>
<argument index="2" value="6379"/>
</bean>
<bean id="jedisConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="testWhileIdle" value="true"/>
</bean>
<service ref="dataSource" interface="redis.clients.jedis.JedisPool">
<service-properties>
<entry key="osgi.jndi.service.name" value="jedis/redisTest"/>
<entry key="service.pid" value="com.ninedemons.osgi.jedis.ds.ExampleDatasource"/>
</service-properties>
</service>
<bean id="poolSource" class="com.ninedemons.osgi.jedis.simple.SimpleJedisPoolSource">
<argument index="0" ref="dataSource"/>
</bean>
<!-- registers the Redis datasource as a JNDI resource using the key jedis-pool/redisTest -->
<service ref="poolSource" interface="com.ninedemons.osgi.jedis.JedisPoolSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jedis-pool/redisTest"/>
</service-properties>
</service>
</blueprint>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment