<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:kie="http://drools.org/schema/kie-spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                          http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd">

  <bean id="mock-agenda-listener" class="org.kie.spring.mocks.MockAgendaEventListener"/>
  <bean id="mock-wm-listener" class="org.kie.spring.mocks.MockRuleRuntimeEventListener"/>
  <bean id="mock-process-listener" class="org.kie.spring.mocks.MockProcessEventListener"/>

  <kie:kmodule id="listeners_module">

    <kie:kbase name="drl_kiesample" packages="drl_kiesample">

      <kie:ksession name="ksession1">
        <kie:agendaEventListener>
            <bean class="org.kie.spring.mocks.MockAgendaEventListener"/>
        </kie:agendaEventListener>
      </kie:ksession>

      <kie:ksession name="ksession2">
        <kie:agendaEventListener ref="mock-agenda-listener"/>
        <kie:processEventListener ref="mock-process-listener"/>
        <kie:ruleRuntimeEventListener ref="mock-wm-listener"/>
      </kie:ksession>

      <kie:ksession name="statelessWithGroupedListeners" type="stateless" listeners-ref="debugListeners"/>

    </kie:kbase>

  </kie:kmodule>

  <kie:eventListeners id="debugListeners">
    <kie:agendaEventListener ref="mock-agenda-listener"/>
    <kie:processEventListener ref="mock-process-listener"/>
    <kie:ruleRuntimeEventListener ref="mock-wm-listener"/>
  </kie:eventListeners>

  <bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>

</beans>
