<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
	
	default-autowire="byName" default-lazy-init="true">
	
	
	
	<bean id="osType" class="net.sourceforge.atunes.kernel.OperatingSystemDetector" factory-method="getOperatingSystem"/>
	
	<bean id="linux" class="net.sourceforge.atunes.model.OperatingSystem" factory-method="getLinux"/>
	<bean id="windows" class="net.sourceforge.atunes.model.OperatingSystem" factory-method="getWindows"/>
	<bean id="macosx" class="net.sourceforge.atunes.model.OperatingSystem" factory-method="getMacOSX"/>
	<bean id="solaris" class="net.sourceforge.atunes.model.OperatingSystem" factory-method="getSolaris"/>
	
	<bean id="operatingSystems" class="java.util.HashMap">
		<constructor-arg>
			<map>
				<entry key-ref="linux" value-ref="linuxAdapter"/>
				<entry key-ref="windows" value-ref="windowsAdapter"/>
				<entry key-ref="macosx" value-ref="macosxAdapter"/>
				<entry key-ref="solaris" value-ref="solarisAdapter"/>
			</map>
		</constructor-arg>
	</bean>
	
	<bean id="operatingSystemAdapter" factory-bean="operatingSystems" factory-method="get">
		<constructor-arg ref="osType"/>
	</bean>
	
	<bean id="osManager" class="net.sourceforge.atunes.kernel.modules.os.OsManager">
		<property name="adapter" ref="operatingSystemAdapter"/>
	</bean>
	
	<bean id="operatingSystem" class="net.sourceforge.atunes.kernel.modules.os.OperatingSystemAdapter" abstract="true"/>
	
	<bean id="linuxAdapter" class="net.sourceforge.atunes.kernel.modules.os.LinuxOperatingSystem" parent="operatingSystem" scope="prototype"/>
	<bean id="macosxAdapter" class="net.sourceforge.atunes.kernel.modules.os.MacOSXOperatingSystem" parent="operatingSystem" scope="prototype"/>
	<bean id="solarisAdapter" class="net.sourceforge.atunes.kernel.modules.os.SolarisOperatingSystem" parent="operatingSystem" scope="prototype"/>
	<bean id="windowsAdapter" class="net.sourceforge.atunes.kernel.modules.os.WindowsOperatingSystem" parent="operatingSystem" scope="prototype"/>

	<bean id="trayIcons" class="java.util.HashMap">
		<constructor-arg>
			<map>
				<entry key-ref="linux" value-ref="commonTrayIcon"/>
				<entry key-ref="windows" value-ref="commonTrayIcon"/>
				<entry key-ref="macosx" value-ref="macOsTrayIcon"/>
				<entry key-ref="solaris" value-ref="commonTrayIcon"/>
			</map>
		</constructor-arg>
	</bean>
	
	<bean id="trayIcon" factory-bean="trayIcons" factory-method="get">
		<constructor-arg ref="osType"/>
	</bean>



	<bean id="macOsApplication" class="net.sourceforge.atunes.kernel.modules.os.MacOSXApplication" scope="prototype"/>
	<bean id="macOsDockMenu" class="net.sourceforge.atunes.kernel.modules.os.MacOSXDockMenu" scope="prototype"/>
	<bean id="macOsInitializer" class="net.sourceforge.atunes.kernel.modules.os.MacOSXInitializer" scope="prototype"/>

</beans>
