<commit_before><!--

    Copyright (C) 2010-2011 LShift Ltd.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<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-3.1.xsd">


  <!--
    ========================
      Lifecycle Management
    ========================
  -->

  <bean id="notificationCentre" class="net.lshift.diffa.kernel.lifecycle.NotificationCentre" />
  <bean class="net.lshift.diffa.agent.context.AgentLifecycleHelper">
    <constructor-arg ref="notificationCentre" />
  </bean>

  <!--
    ============
      Policies
    ============
  -->
  <bean id="versionPolicyManager" class="net.lshift.diffa.kernel.differencing.VersionPolicyManager"/>

  <bean id="registerSamePolicy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="versionPolicyManager"/>
    <property name="targetMethod" value="registerPolicy"/>
    <property name="arguments">
      <list>
        <value>same</value>
        <bean class="net.lshift.diffa.kernel.differencing.SameVersionPolicy">
            <constructor-arg ref="versionCorrelationStoreFactory" />
            <constructor-arg ref="differencesManager" />
            <constructor-arg ref="diagnosticsManager" />
          </bean>
      </list>
    </property>
  </bean>

  <bean id="registerCorrelatedPolicy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="versionPolicyManager"/>
    <property name="targetMethod" value="registerPolicy"/>
    <property name="arguments">
      <list>
        <value>correlated</value>
        <bean class="net.lshift.diffa.kernel.differencing.CorrelatedVersionPolicy">
          <constructor-arg ref="versionCorrelationStoreFactory" />
          <constructor-arg ref="differencesManager" />
          <constructor-arg ref="diagnosticsManager" />
        </bean>
      </list>
    </property>
  </bean>

  <!--
    ============
      Matching
    ============
  -->
  <bean id="matchingManager" class="net.lshift.diffa.kernel.matching.LocalEventMatchingManager" destroy-method="close">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
  </bean>

  <!--
    ==============
      Scheduling
    ==============
  -->
  <bean id="scanScheduler" class="net.lshift.diffa.kernel.scheduler.QuartzScanScheduler" destroy-method="close">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
    <constructor-arg ref="pairActorSupervisor" />
    <constructor-arg value="DiffaScanScheduler" />
  </bean>

  <!--
    ============
      Sessions
    ============
  -->
  <bean id="differencesManager" class="net.lshift.diffa.kernel.differencing.DefaultDifferencesManager">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
    <constructor-arg ref="domainDifferenceStore" />
    <constructor-arg ref="matchingManager" />
    <constructor-arg ref="participantFactory" />
    <constructor-arg ref="notificationCentre" />
  </bean>
  <bean id="domainDifferenceStore" class="net.lshift.diffa.kernel.differencing.JooqDomainDifferenceStore">
    <constructor-arg ref="jooqDatabaseFacade" />
    <constructor-arg ref="hazelcastCacheProvider" />
    <constructor-arg ref="hazelcastSequenceProvider" />
    <constructor-arg ref="hookManager" />
  </bean>

  <bean id="sweeper" class="net.lshift.diffa.kernel.util.Sweeper" init-method="start" destroy-method="shutdown">
    <constructor-arg value="5" />
    <constructor-arg ref="domainDifferenceStore" />
  </bean>

  <!--<commit_msg>Force dependency on sesison factory for testing purposes<commit_after><!--

    Copyright (C) 2010-2011 LShift Ltd.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<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-3.1.xsd">


  <!--
    ========================
      Lifecycle Management
    ========================
  -->

  <bean id="notificationCentre" class="net.lshift.diffa.kernel.lifecycle.NotificationCentre" />
  <bean class="net.lshift.diffa.agent.context.AgentLifecycleHelper">
    <constructor-arg ref="notificationCentre" />
  </bean>

  <!--
    ============
      Policies
    ============
  -->
  <bean id="versionPolicyManager" class="net.lshift.diffa.kernel.differencing.VersionPolicyManager"/>

  <bean id="registerSamePolicy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="versionPolicyManager"/>
    <property name="targetMethod" value="registerPolicy"/>
    <property name="arguments">
      <list>
        <value>same</value>
        <bean class="net.lshift.diffa.kernel.differencing.SameVersionPolicy">
            <constructor-arg ref="versionCorrelationStoreFactory" />
            <constructor-arg ref="differencesManager" />
            <constructor-arg ref="diagnosticsManager" />
          </bean>
      </list>
    </property>
  </bean>

  <bean id="registerCorrelatedPolicy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" ref="versionPolicyManager"/>
    <property name="targetMethod" value="registerPolicy"/>
    <property name="arguments">
      <list>
        <value>correlated</value>
        <bean class="net.lshift.diffa.kernel.differencing.CorrelatedVersionPolicy">
          <constructor-arg ref="versionCorrelationStoreFactory" />
          <constructor-arg ref="differencesManager" />
          <constructor-arg ref="diagnosticsManager" />
        </bean>
      </list>
    </property>
  </bean>

  <!--
    ============
      Matching
    ============
  -->
  <bean id="matchingManager" class="net.lshift.diffa.kernel.matching.LocalEventMatchingManager" destroy-method="close">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
  </bean>

  <!--
    ==============
      Scheduling
    ==============
  -->
  <bean id="scanScheduler" class="net.lshift.diffa.kernel.scheduler.QuartzScanScheduler" destroy-method="close">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
    <constructor-arg ref="pairActorSupervisor" />
    <constructor-arg value="DiffaScanScheduler" />
  </bean>

  <!--
    ============
      Sessions
    ============
  -->
  <bean id="differencesManager" class="net.lshift.diffa.kernel.differencing.DefaultDifferencesManager">
    <constructor-arg ref="systemConfigStore" />
    <constructor-arg ref="domainConfigStore" />
    <constructor-arg ref="domainDifferenceStore" />
    <constructor-arg ref="matchingManager" />
    <constructor-arg ref="participantFactory" />
    <constructor-arg ref="notificationCentre" />
  </bean>
  <bean id="domainDifferenceStore" class="net.lshift.diffa.kernel.differencing.JooqDomainDifferenceStore" depends-on="diffaSessionFactory">
    <constructor-arg ref="jooqDatabaseFacade" />
    <constructor-arg ref="hazelcastCacheProvider" />
    <constructor-arg ref="hazelcastSequenceProvider" />
    <constructor-arg ref="hookManager" />
  </bean>

  <bean id="sweeper" class="net.lshift.diffa.kernel.util.Sweeper" init-method="start" destroy-method="shutdown">
    <constructor-arg value="5" />
    <constructor-arg ref="domainDifferenceStore" />
  </bean>

  <!--
{'fraction_non_alphanumeric': 0.16425785730672174, 'fraction_numerical': 0.004588208304657031, 'mean_word_length': 3.733441910966341, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7386354', 'n_tokens_mistral': 2536, 'n_tokens_neox': 2423, 'n_words': 440}