All Downloads are FREE. Search and download functionalities are using the official Maven repository.

OSGI-INF.blueprint.datum-data-source.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">

	<bean id="datumDataSourceMessageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>net.solarnetwork.node.datum.stabiliti30c.Stabiliti30CDatumDataSource</value>
				<value>net.solarnetwork.node.io.modbus.support.ModbusDataDatumDataSourceSupport</value>
				<value>net.solarnetwork.node.io.modbus.support.ModbusDeviceSupport</value>
				<value>net.solarnetwork.service.support.BasicIdentifiable</value>
			</list>
		</property>
	</bean>
	
	<bean id="datumDataSourceJobMessageSource" class="net.solarnetwork.support.PrefixedMessageSource">
		<property name="prefix" value="multiDatumDataSource."/>
		<property name="delegate" ref="datumDataSourceMessageSource"/>
	</bean>	

	<!-- Published Services -->
	
	<service interface="net.solarnetwork.settings.SettingSpecifierProviderFactory">
		<bean class="net.solarnetwork.settings.support.BasicSettingSpecifierProviderFactory">
			<property name="displayName" value="Stabiliti 30C Power Control Data Source"/>
			<property name="factoryUid" value="net.solarnetwork.node.control.stabiliti30c.DatumDataSource"/>
			<property name="messageSource" ref="datumDataSourceMessageSource"/>
		</bean>
	</service>
	
	<osgix:managed-service-factory factory-pid="net.solarnetwork.node.control.stabiliti30c.DatumDataSource" autowire-on-update="true">
		<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="multiDatumDataSource">
						<bean class="net.solarnetwork.node.datum.stabiliti30c.Stabiliti30CDatumDataSource">
							<property name="messageSource" ref="datumDataSourceJobMessageSource"/>
							<property name="modbusNetwork">
								<bean class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
									<argument ref="bundleContext"/>
									<property name="serviceClassName" 
										value="net.solarnetwork.node.io.modbus.ModbusNetwork"/>
									<property name="propertyFilters">
										<map>
											<entry key="uid" value="Modbus Port"/>
										</map>
									</property>
								</bean>	
							</property>
						</bean>
					</property>
				</bean>
			</argument>
			<argument value="5 * * * * ?"/>
			<property name="serviceProviderConfigurations">
				<map>
					<entry key="multiDatumDataSource">
						<bean class="net.solarnetwork.node.job.SimpleServiceProviderConfiguration">
							<property name="interfaces">
								<list>
									<value>net.solarnetwork.node.service.MultiDatumDataSource</value>
								</list>
							</property>
							<property name="properties">
								<map>
									<entry key="datumClassName" value="net.solarnetwork.node.domain.datum.NodeDatum"/>
								</map>
							</property>
						</bean>
					</entry>
				</map>
			</property>
		</bean>
	</osgix:managed-service-factory>

</blueprint>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy