<?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="beanFactory" class="net.sourceforge.atunes.BeanFactory"/>

	<bean class="net.sourceforge.atunes.ApplicationStarter" scope="prototype"/>
	<bean id="applicationPropertiesLogger" class="net.sourceforge.atunes.ApplicationPropertiesLogger" scope="prototype"/>
	<bean id="multipleInstancesCheck" class="net.sourceforge.atunes.MultipleInstancesCheck" scope="prototype"/>
	<bean id="applicationArgumentsSender" class="net.sourceforge.atunes.ApplicationArgumentsSender" scope="prototype"/>

	<bean id="kernel" class="net.sourceforge.atunes.kernel.Kernel"/>

	<bean id="applicationArguments" class="net.sourceforge.atunes.ApplicationArguments"/>
	
	<bean id="errorReportCreator" class="net.sourceforge.atunes.ErrorReportCreator"/>
	<bean id="errorReporter" class="net.sourceforge.atunes.MailErrorReporter">
		<property name="url" value="http://www.atunes.org/bug_report_post.php"/>
	</bean>
	
	<bean id="applicationStateGenerator" class="net.sourceforge.atunes.ApplicationStateGenerator"/>

	<bean id="statePlaylist" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStatePlaylist" />
	<bean id="stateRadio" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateRadio" />
	<bean id="stateUI" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateUI" />
	<bean id="stateRepository" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateRepository" />
	<bean id="statePlayer" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStatePlayer" />
	<bean id="stateCore" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateCore" />
	<bean id="stateContext" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateContext" />
	<bean id="stateNavigation" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateNavigation" />
	<bean id="stateRipper" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateRipper" />
	<bean id="stateDevice" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStateDevice" />
	<bean id="statePodcast" class="net.sourceforge.atunes.kernel.modules.state.ApplicationStatePodcast" />
	<bean id="stateStore" class="net.sourceforge.atunes.kernel.modules.state.PreferencesCache">
		<constructor-arg ref="osManager"/>
		<constructor-arg value="/settings/ehcache-preferences.xml" />
	</bean>
	
	<bean id="localeBeanFactory" class="net.sourceforge.atunes.kernel.modules.state.LocaleBeanFactory"/>
	<bean id="proxyBeanFactory" class="net.sourceforge.atunes.kernel.modules.state.ProxyBeanFactory"/>



	<bean id="applicationLifeCycleListeners" class="net.sourceforge.atunes.kernel.ApplicationLifeCycleListeners"/>
	<bean id="deviceListeners" class="net.sourceforge.atunes.kernel.DeviceListeners"/>
	<bean id="favoritesListeners" class="net.sourceforge.atunes.kernel.FavoritesListeners"/>
	<bean id="playbackStateListeners" class="net.sourceforge.atunes.kernel.PlaybackStateListeners" init-method="initialize"/>
	<bean id="playListEventListeners" class="net.sourceforge.atunes.kernel.PlayListEventListeners"/>
	<bean id="stateChangeListeners" class="net.sourceforge.atunes.kernel.StateChangeListeners"/>

	<bean id="preferencesPanels" class="java.util.ArrayList">
		<constructor-arg>
			<list>
				<ref bean="generalPreferencesPanel"/>
				<ref bean="repositoryPreferencesPanel"/>
				<ref bean="playerPreferencesPanel"/>				
				<ref bean="navigatorPreferencesPanel"/>
				<ref bean="playListPreferencesPanel"/>
				<ref bean="osdPreferencesPanel"/>
				<ref bean="contextPreferencesPanel"/>
				<ref bean="internetPreferencesPanel"/>
				<ref bean="lastfmPreferencesPanel"/>
				<ref bean="devicePreferencesPanel"/>
				<ref bean="radioPreferencesPanel"/>
				<ref bean="podcastFeedPreferencesPanel"/>
				<ref bean="importPreferencesPanel"/>
				<ref bean="exportPreferencesPanel"/>
			</list>
		</constructor-arg>
	</bean>

	<bean id="generalPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.GeneralPanel" scope="prototype" init-method="initialize"/>
	<bean id="repositoryPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.RepositoryPanel" scope="prototype" init-method="initialize"/>
	<bean id="playerPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.PlayerPanel" scope="prototype" init-method="initialize"/>
	<bean id="navigatorPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.NavigatorPanel" scope="prototype" init-method="initialize"/>
	<bean id="playListPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.PlayListPrefPanel" scope="prototype"/>
	<bean id="osdPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.OSDPanel" scope="prototype" init-method="initialize"/>
	<bean id="contextPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.ContextPanel" scope="prototype" init-method="initialize"/>
	<bean id="internetPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.InternetPanel" scope="prototype" init-method="initialize"/>
	<bean id="lastfmPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.LastFmPanel" scope="prototype" init-method="initialize"/>	
	<bean id="devicePreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.DevicePanel" scope="prototype" init-method="initialize"/>
	<bean id="radioPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.RadioPanel" scope="prototype"/>
	<bean id="podcastFeedPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.PodcastFeedPanel" scope="prototype" init-method="initialize"/>
	<bean id="importPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.ImportPanel" scope="prototype" init-method="initialize"/>
	<bean id="exportPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.ExportPanel" scope="prototype" init-method="initialize"/>
	<bean id="pluginsPreferencesPanel" class="net.sourceforge.atunes.kernel.modules.state.PluginsPanel" scope="prototype" init-method="initialize"/>
	
	<bean id="editPreferencesDialogController" class="net.sourceforge.atunes.kernel.modules.state.EditPreferencesDialogController" scope="prototype" init-method="initialize">
		<constructor-arg ref="editPreferencesDialog"/>
	</bean>
	
	
	<bean class="net.sourceforge.atunes.kernel.StartCounter" init-method="initialize">
		<property name="counterFile" value="counter.properties"/>
		<property name="counterProperty" value="counter"/>
		<property name="counterLevelNeededToFireAction" value="2"/>
		<property name="actionToFire" ref="makeDonationAction"/>
		<property name="dontFireActionProperty" value="dontFireActionAgain"/>
	</bean>

	<bean id="searchableObject" class="net.sourceforge.atunes.kernel.modules.search.AbstractCommonAudioFileSearchableObject" abstract="true"/>	


	<bean id="notificationEngine" class="net.sourceforge.atunes.kernel.modules.notify.CommonNotificationEngine" abstract="true"/>
	<bean id="defaultNotificationEngine" class="net.sourceforge.atunes.kernel.modules.notify.DefaultNotifications" parent="notificationEngine"/>
	<bean id="growlNotificationEngine" class="net.sourceforge.atunes.kernel.modules.notify.GrowlNotificationEngine" parent="notificationEngine"/>
	<bean id="libnotifyNotificationEngine" class="net.sourceforge.atunes.kernel.modules.notify.LibnotifyNotificationEngine" parent="notificationEngine"/>
	
	<bean class="net.sourceforge.atunes.kernel.modules.tags.EditTagDialogController" scope="prototype" init-method="initialize">
		<constructor-arg ref="editTagDialog"></constructor-arg>
	</bean>




    <!-- EXCEPTION HANDLER WITH ALL KNOWN EXCEPTIONS THAT DON'T WANT TO SHOW TO USER -->
	<bean class="net.sourceforge.atunes.UncaughtExceptionHandler">
		<property name="knownExceptions">
			<list>
				<bean class="net.sourceforge.atunes.KnownException">
				    <!-- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6933331 -->
					<property name="exceptionClass" value="java.lang.IllegalStateException"/>
					<property name="message" value="Buffers have not been created"/>
				</bean>
			</list>
		</property>
	</bean>
	
	
	<!-- JVM STATISTICS -->
	<bean class="net.sourceforge.atunes.utils.JavaCommittedHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaCommittedNonHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaGarbageCollectionCountStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaInitialHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaInitialNonHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaLoadedClassesCountStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaMaxHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaMaxNonHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaOsNameStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaRuntimeStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaThreadCountStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaTotalLoadedClassesCountStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaUnloadedClassesCountStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaUptimeStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaUsedHeapSpaceStatistic"/>
	<bean class="net.sourceforge.atunes.utils.JavaUsedNonHeapSpaceStatistic"/>
	

	
</beans>
