You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Kit Plummer <ki...@gmail.com> on 2010/11/12 22:22:44 UTC

Config into Blueprint Definition...

			Hey guys.I'm struggling to figure out how to get properties from a config file I dropped into the etc/ subdirectory into my Blueprint definition.I know my .cfg is getting picked up - saw it with 'config:list' - but, am stuck beyond that. Any help?I dinked around <cm:property/> - tho only got more lost.TIA,Kit
			
		
        

Re: Config into Blueprint Definition...

Posted by Kit Plummer <ki...@gmail.com>.
        
        Hey Chris...yeh, am back into it again.  :)  Thanks.  As typical as soon as I posted in despair I found another thread with the solution.  My problem was with the cm: namespace pointing to Geronimo instead of Aries:xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"All is well.For reference here's my Blueprint config that shows the right namespace and config mapping:<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">    <reference id="cf" interface="javax.jms.ConnectionFactory" />    <reference id="ms"        interface="com.opsysinc.snap.messaging.MessagingService"/>    <bean id="pacemaker" class="com.opsysinc.snap.pacemaker.HeartBeater"        init-method="start" destroy-method="stop">        <property name="delta" value="${snap.heartbeat.delta}"/>        <property name="messagingService" ref="ms"/>    </bean>    <cm:proper
 ty-place
holder persistent-id="com.opsysinc.snap">        <cm:default-properties>            <cm:property name="snap.heartbeat.delta" value="4000" />        </cm:default-properties>    </cm:property-placeholder></blueprint>
        
        
		
		
        On Friday, November 12, 2010 at 3:25 PM, Chris Custine wrote:
        
            Hi Kit,Long time no see  :-)  Yeah this is a bit whacky at the moment becausethis part of Blueprint Spec was dropped from the final OSGi 4.2 EEspec.  Both Spring-DM and Aries Blueprint have nearly identicalimplementations based on the draft, but each has a custom namespace.If you are using the latest Karaf builds, you can look athttp://svn.apache.org/repos/asf/karaf/trunk/shell/ssh/src/main/resources/OSGI-INF/blueprint/shell-ssh.xmlfor a simple example of how the properties frometc/org.apache.karaf.shell.cfg are mapped into a blueprint xml.The Spring project has fairly good docs because the draft spec wasbased on this code.  I think most of the syntax is identical to theAries impl.  http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/compendium.html#compendium:cmLet us know if you run into specific issues.  Hope to see you back on#karaf IRC soon  :-)Chris--Chris CustineFuseSource - Open Source Integration:: http://fusesource.comMy Blog :: http://blog.
 organice
lement.comOn Fri, Nov 12, 2010 at 14:22, Kit Plummer <ki...@gmail.com> wrote: Hey guys. I'm struggling to figure out how to get properties from a config file I dropped into the etc/ subdirectory into my Blueprint definition. I know my .cfg is getting picked up - saw it with 'config:list' - but, am stuck beyond that. Any help? I dinked around  - tho only got more lost. TIA, Kit
			
			
			
			
        
		
		
    


Re: Config into Blueprint Definition...

Posted by Chris Custine <ch...@gmail.com>.
Hi Kit,
Long time no see  :-)  Yeah this is a bit whacky at the moment because
this part of Blueprint Spec was dropped from the final OSGi 4.2 EE
spec.  Both Spring-DM and Aries Blueprint have nearly identical
implementations based on the draft, but each has a custom namespace.

If you are using the latest Karaf builds, you can look at
http://svn.apache.org/repos/asf/karaf/trunk/shell/ssh/src/main/resources/OSGI-INF/blueprint/shell-ssh.xml
for a simple example of how the properties from
etc/org.apache.karaf.shell.cfg are mapped into a blueprint xml.

The Spring project has fairly good docs because the draft spec was
based on this code.  I think most of the syntax is identical to the
Aries impl.  http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/compendium.html#compendium:cm

Let us know if you run into specific issues.  Hope to see you back on
#karaf IRC soon  :-)

Chris

--
Chris Custine
FuseSource - Open Source Integration:: http://fusesource.com
My Blog :: http://blog.organicelement.com





On Fri, Nov 12, 2010 at 14:22, Kit Plummer <ki...@gmail.com> wrote:
> Hey guys.
> I'm struggling to figure out how to get properties from a config file I
> dropped into the etc/ subdirectory into my Blueprint definition.
> I know my .cfg is getting picked up - saw it with 'config:list' - but, am
> stuck beyond that. Any help?
> I dinked around <cm:property/> - tho only got more lost.
> TIA,
> Kit
>
>
>