<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN"
	"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    <!-- Remote authentication service. -->
    <bean id="authenticationService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
        <property name="serviceUrl">
            <value>rmi://localhost:50500/authentication</value>
        </property>
        <property name="serviceInterface">
            <value>org.alfresco.service.cmr.security.AuthenticationService</value>
        </property>
        <property name="refreshStubOnConnectFailure">
            <value>true</value>
        </property>
    </bean>

    <!-- Client Ticket Holder Bean. -->
    <bean id="clientTicketHolder" class="org.alfresco.repo.remote.ClientTicketHolderGlobal"/>

	<!-- Remote interface for AVM. -->
	<bean id="avmRemote" class="org.alfresco.repo.remote.AVMRemoteImpl">
	    <property name="avmRemoteTransport">
	        <ref bean="avmRemoteTransport"/>
	    </property>
	    <property name="clientTicketHolder">
	        <ref bean="clientTicketHolder"/>
	    </property>
	</bean>

	<!-- RMI Proxy bean for avmRemoteTransport -->
	<bean id="avmRemoteTransport" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
		<property name="serviceUrl">
			<value>rmi://localhost:50500/avm</value>
		</property>
		<property name="serviceInterface">
			<value>org.alfresco.service.cmr.remote.AVMRemoteTransport</value>
		</property>
		<property name="refreshStubOnConnectFailure">
			<value>true</value>
		</property>
	</bean>

	<bean id="avmSyncService" class="org.alfresco.repo.remote.AVMSyncServiceRemote">
	    <property name="avmSyncServiceTransport">
	    	<ref bean="avmSyncServiceTransport"/>
	    </property>
	    <property name="clientTicketHolder">
	        <ref bean="clientTicketHolder"/>
	    </property>
	</bean>

    <bean id="avmSyncServiceTransport" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
        <property name="serviceUrl">
            <value>rmi://localhost:50500/avmsync</value>
        </property>
        <property name="serviceInterface">
            <value>org.alfresco.service.cmr.remote.AVMSyncServiceTransport</value>
        </property>
        <property name="refreshStubOnConnectFailure">
            <value>true</value>
        </property>
    </bean>
    
    
    <!-- NameMatcher beans for filtering what shows up as different in compares. -->
    <bean id="excludeRegexMatcher" class="org.alfresco.util.RegexNameMatcher">
        <property name="patterns">
            <!--
            NOTE:  Regexes are implicitly anchored with ^ and $ in this context.
            -->
            <list>
                <value>.*/#[^/]*</value>    <!-- A leaf starting with '#' -->
            </list>
        </property>
    </bean>

    <bean id="excludeExtensionMatcher" class="org.alfresco.repo.avm.util.FileExtensionNameMatcher">
        <property name="extensions">
            <list>
                <value>.o</value>
                <value>.bak</value>
                <value>.tmp</value>
                <value>~</value>
            </list>
        </property>
    </bean>
    
    <bean id="globalPathExcluder" class="org.alfresco.util.OrCompositeNameMatcher">
        <property name="matchers">
            <list>
                <ref bean="excludeExtensionMatcher"/>
                <ref bean="excludeRegexMatcher"/>
            </list>
        </property>
    </bean>
    
</beans>
