Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Blueprint and property-placeholders
Blueprint and property-placeholders [message #1238455] Sat, 01 February 2014 11:56 Go to next message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 92
Registered: July 2009
Location: France
Member
Hi,

I am trying to load this blueprint configuration into Virgo:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
<ext:property-placeholder />
<bean id...></bean>
<service ref="processEngine">...</service>
</blueprint>


If I understand correctly ext:property-placeholder is an Aries extension that will try to get the value from the System properties.
Being in Virgo I would like to use Gemini, and to load property values from configuration artifacts.

To get there I have replaced the XML header with this:

<?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">


Again this loads fine... except I don't have a placeholder element to play with anymore. All Virgo examples show placeholders in Spring context files (with the
<beans xmlns="http://www.springframework.org/schema/beans" ...
root element).

Is there anyway to achieve Virgo property substitution in blueprint files?

Thanks!

Re: Blueprint and property-placeholders [message #1238887 is a reply to message #1238455] Sun, 02 February 2014 19:33 Go to previous message
Scott Brand is currently offline Scott BrandFriend
Messages: 6
Registered: December 2011
Junior Member
Yes, in Virgo 3.6 and above and maybe 3.5, it works like the example below.
I am actually using Virgo 3.7.0.M1.
The properties are stored in a external file named "server2.conf" in this example.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
  xmlns:cm="http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium"
  xmlns:bp="http://www.eclipse.org/gemini/blueprint/schema/blueprint"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:ctx="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
    http://www.osgi.org/xmlns/blueprint/v1.0.0 
    http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.eclipse.org/gemini/blueprint/schema/blueprint
    http://www.eclipse.org/gemini/blueprint/schema/blueprint/gemini-blueprint.xsd
    http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium 
    http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium/gemini-blueprint-compendium.xsd">

 

    <cm:cm-properties id="dbProps" persistent-id="gvap.metadata.database"/>
 
    <ctx:property-placeholder properties-ref="dbProps" location="file:/apps/dwdata/server2.conf"/>
    
	
 
 	<!--
 	 // Create our metadata Datasource first. 
 	 -->
	<bean id="MetaDataDS" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
		<property name="driverClassName" value="${md.db.driverClass}"/>
		<property name="url" value="${md.db.metadata_url}"/>
		<property name="username" value="${md.db.userName}"/>
		<property name="password" value="${md.db.password}"/>
		<property name="initSQL" value="${md.db.setSchema}"/>
		<property name="maxActive" value="10"/>
		<property name="maxIdle" value="10"/>
		<property name="minIdle" value="2"/>
		<property name="initialSize" value="2"/>
		<property name="testOnBorrow" value="true"/>
		<property name="validationQuery" value="select 1 from sysibm.sysdummy1"/>
	</bean>

</blueprint>
Previous Topic:Where to download the virgo form tags sample?
Next Topic:virgo servie with Apache Daemon (prunsrv.exe)
Goto Forum:
  


Current Time: Wed Apr 24 23:56:02 GMT 2024

Powered by FUDForum. Page generated in 0.02858 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top