Spring Conext Initializer Property Source in OSGi

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Spring Conext Initializer Property Source in OSGi

peter.berkman
in the "normal" app-server case, I register a new PropertySource in the ConfigiurableWebApplicationContext using the following in the web.xml:

    <context-param>
    	<param-name>contextInitializerClasses</param-name>
    	<param-value>com.nextgate.ms.core.SpringContextInitializer</param-value>
    </context-param>

Then, in my SpringContextInitializer I can register my PropertySource like this:

    public void initialize(ConfigurableWebApplicationContext ctx) { 

        ctx.getEnvironment().getPropertySources().addFirst(new SpringContextInitializerPropertySource("NGMSPropertiesRoute")); 
    } 

This allows me to use properties within the Spring xml files like this:

       <import resource="${nextgate.ms.hl7v3.pdq.endpointfile}"/>

okay, so now the question:  I'm converting some of the services and Spring routes over to OSGi.  However, I can't find any reference on how to do something similar when running in the OSGi container.

any help would be greatly appreciated!