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:osgix="http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:ctx="http://www.springframework.org/schema/context"
	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="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>net.solarnetwork.node.control.bacnet.BacnetControl</value>
				<value>net.solarnetwork.service.support.BasicIdentifiable</value>
			</list>
		</property>
		<property name="parentMessageSource">
			<bean class="net.solarnetwork.support.PrefixedMessageSource">
				<property name="prefix" value="propConfigsItem."/>
				<property name="delegate" ref="propConfigMessageSource"/>
			</bean>	
  		</property>
	</bean>
	
	<bean id="propConfigMessageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basename" value="net.solarnetwork.node.control.bacnet.BacnetWritePropertyConfig"/>
	</bean>

	<bean id="eventAdmin" class="net.solarnetwork.common.osgi.service.DynamicServiceTracker">
		<argument ref="bundleContext"/>
		<property name="serviceClassName" value="org.osgi.service.event.EventAdmin"/>
	</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>	
	
	<!-- Published Services -->
	
	<service>
		<interfaces>
			<value>net.solarnetwork.settings.SettingSpecifierProvider</value>
			<value>net.solarnetwork.node.settings.SettingResourceHandler</value>
		</interfaces>
		<bean class="net.solarnetwork.node.control.bacnet.BacnetControlCsvConfigurer">
			<argument ref="settingsService"/>
			<argument ref="identityService"/>
			<property name="messageSource">
				<bean class="org.springframework.context.support.ResourceBundleMessageSource">
					<property name="basenames">
						<list>
							<value>net.solarnetwork.node.control.bacnet.BacnetControlCsvConfigurer</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 Control"/>
			<property name="factoryUid" value="net.solarnetwork.node.control.bacnet"/>
			<property name="messageSource" ref="messageSource"/>
		</bean>
	</service>
	
	<osgix:managed-service-factory factory-pid="net.solarnetwork.node.control.bacnet"
			autowire-on-update="true" update-method="configurationChanged">
		<osgix:interfaces>
			<beans:value>net.solarnetwork.node.service.NodeControlProvider</beans:value>
			<beans:value>net.solarnetwork.node.reactor.InstructionHandler</beans:value>
			<beans:value>net.solarnetwork.settings.SettingSpecifierProvider</beans:value>
		</osgix:interfaces>
		<osgix:service-properties>
			<beans:entry key="settingPid" value="net.solarnetwork.node.control.bacnet"/>
			<beans:entry key="instruction">
				<beans:list>
					<beans:value>SetControlParameter</beans:value>
				</beans:list>
			</beans:entry>
		</osgix:service-properties>
		<bean id="controller" class="net.solarnetwork.node.control.bacnet.BacnetControl">
			<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="messageSource" ref="messageSource"/>
			<property name="eventAdmin" ref="eventAdmin"/>
		</bean>
	</osgix:managed-service-factory>
	
</blueprint>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy