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

OSGI-INF.blueprint.module.xml Maven / Gradle / Ivy

The newest version!
<?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">

	<reference id="settingsService" interface="net.solarnetwork.node.settings.SettingsService"/>

	<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="datumService" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
		<argument ref="bundleContext"/>
		<property name="serviceClassName" value="net.solarnetwork.node.service.DatumService"/>
		<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>

	<bean id="identityService" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
		<argument ref="bundleContext"/>
		<property name="serviceClassName" value="net.solarnetwork.node.service.IdentityService"/>
		<property name="sticky" value="true"/>
	</bean>	
	
	<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>net.solarnetwork.node.datum.bacnet.BacnetDatumDataSource</value>
				<value>net.solarnetwork.node.service.support.ExpressionConfig</value>
				<value>net.solarnetwork.node.service.support.DatumDataSourceSupport</value>
				<value>net.solarnetwork.service.support.BasicIdentifiable</value>
			</list>
		</property>
		<property name="parentMessageSource">
			<bean class="net.solarnetwork.support.PrefixedMessageSource">
				<property name="prefix" value="deviceConfigsItem.propConfigsItem."/>
				<property name="delegate">
					<bean class="org.springframework.context.support.ResourceBundleMessageSource">
						<property name="basenames">
							<list>
								<value>net.solarnetwork.domain.datum.NumberDatumSamplePropertyConfig</value>
							</list>
						</property>
					</bean>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="jobMessageSource" class="net.solarnetwork.support.PrefixedMessageSource">
		<property name="prefix" value="datumDataSource."/>
		<property name="delegate" ref="messageSource"/>
	</bean>

	<bean id="expressionServices" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
		<argument ref="bundleContext"/>
		<property name="serviceClassName" value="net.solarnetwork.service.ExpressionService"/>
	</bean>

	<reference id="taskScheduler" interface="org.springframework.scheduling.TaskScheduler" filter="(function=node)"/>

	<!-- Published Services -->

	<service>
		<interfaces>
			<value>net.solarnetwork.settings.SettingSpecifierProvider</value>
			<value>net.solarnetwork.node.settings.SettingResourceHandler</value>
		</interfaces>
		<bean class="net.solarnetwork.node.datum.bacnet.BacnetCsvConfigurer">
			<argument ref="settingsService"/>
			<argument ref="identityService"/>
			<property name="messageSource">
				<bean class="org.springframework.context.support.ResourceBundleMessageSource">
					<property name="basenames">
						<list>
							<value>net.solarnetwork.node.datum.bacnet.BacnetCsvConfigurer</value>
							<value>net.solarnetwork.service.support.BasicIdentifiable</value>
						</list>
					</property>
				</bean>
			</property>
		</bean>
	</service>

	<service interface="net.solarnetwork.settings.SettingSpecifierProviderFactory">
		<bean class="net.solarnetwork.settings.support.BasicSettingSpecifierProviderFactory">
			<property name="displayName" value="BACnet device"/>
			<property name="factoryUid" value="net.solarnetwork.node.datum.bacnet"/>
			<property name="messageSource" ref="messageSource"/>
		</bean>
	</service>

	<osgix:managed-service-factory factory-pid="net.solarnetwork.node.datum.bacnet"
			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.bacnet.BacnetDatumDataSource">
							<argument>
								<bean class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
									<argument ref="bundleContext"/>
									<property name="serviceClassName" value="net.solarnetwork.node.io.bacnet.BacnetNetwork"/>
									<property name="ignoreEmptyPropertyFilterValues" value="false"/>
									<property name="propertyFilters">
										<map>
											<entry key="uid" value=""/>
										</map>
									</property>
								</bean>
							</argument>
							<property name="datumMetadataService" ref="datumMetadataService"/>
							<property name="messageSource" ref="jobMessageSource"/>
							<property name="datumService" ref="datumService"/>
							<property name="placeholderService" ref="placeholderService"/>
							<property name="taskScheduler" ref="taskScheduler"/>
							<property name="expressionServices" ref="expressionServices"/>
							<property name="datumQueue" ref="datumQueue"/>
						</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>
								</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 - 2024 Weber Informatics LLC | Privacy Policy