OSGI-INF.blueprint.module.xml Maven / Gradle / Ivy
<?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" xmlns:ctx="http://www.springframework.org/schema/context" xmlns:osgix="http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium/gemini-blueprint-compendium.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> <!-- References --> <bean id="datumMetadataService" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker"> <argument ref="bundleContext"/> <property name="serviceClassName" value="net.solarnetwork.node.service.DatumMetadataService"/> <property name="sticky" value="true"/> </bean> <bean id="datumQueue" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker"> <argument ref="bundleContext"/> <property name="serviceClassName" value="net.solarnetwork.node.service.DatumQueue"/> <property name="sticky" value="true"/> </bean> <bean id="placeholderService" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker"> <argument ref="bundleContext"/> <property name="serviceClassName" value="net.solarnetwork.node.service.PlaceholderService"/> <property name="sticky" value="true"/> </bean> <!-- Services --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <array> <value>net.solarnetwork.node.datum.battery.mock.MockBatteryDatumDataSource</value> <value>net.solarnetwork.node.service.support.DatumDataSourceSupport</value> <value>net.solarnetwork.service.support.BasicIdentifiable</value> </array> </property> </bean> <bean id="jobMessageSource" class="net.solarnetwork.support.PrefixedMessageSource"> <property name="prefix" value="datumDataSource."/> <property name="delegate" ref="messageSource"/> </bean> <service interface="net.solarnetwork.settings.SettingSpecifierProviderFactory"> <bean class="net.solarnetwork.settings.support.BasicSettingSpecifierProviderFactory"> <property name="displayName" value="Mock Battery"/> <property name="factoryUid" value="net.solarnetwork.node.datum.battery.mock"/> <property name="messageSource" ref="messageSource"/> </bean> </service> <osgix:managed-service-factory factory-pid="net.solarnetwork.node.datum.battery.mock" autowire-on-update="true" update-method="configurationChanged"> <osgix:interfaces> <beans:value>net.solarnetwork.node.job.ManagedJob</beans:value> </osgix:interfaces> <bean class="net.solarnetwork.node.job.SimpleManagedJob" init-method="serviceDidStartup" destroy-method="serviceDidShutdown"> <argument> <bean class="net.solarnetwork.node.job.DatumDataSourcePollManagedJob"> <property name="datumMetadataService" ref="datumMetadataService"/> <property name="datumQueue" ref="datumQueue"/> <property name="datumDataSource"> <bean class="net.solarnetwork.node.datum.battery.mock.MockBatteryDatumDataSource"> <property name="messageSource" ref="jobMessageSource"/> <property name="placeholderService" ref="placeholderService"/> </bean> </property> </bean> </argument> <argument value="0 * * * * ?"/> <property name="serviceProviderConfigurations"> <map> <entry key="datumDataSource"> <bean class="net.solarnetwork.node.job.SimpleServiceProviderConfiguration"> <property name="interfaces"> <list> <value>net.solarnetwork.node.service.DatumDataSource</value> <value>net.solarnetwork.node.service.NodeControlProvider</value> <value>net.solarnetwork.node.reactor.InstructionHandler</value> </list> </property> <property name="properties"> <map> <entry key="datumClassName" value="net.solarnetwork.domain.datum.EnergyStorageDatum"/> <entry key="instruction"> <list> <value>SetControlParameter</value> </list> </entry> </map> </property> </bean> </entry> </map> </property> </bean> </osgix:managed-service-factory> </blueprint>