<?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:os-core="http://www.openspaces.org/schema/core"
xmlns:os-events="http://www.openspaces.org/schema/events"
xmlns:os-remoting="http://www.openspaces.org/schema/remoting"
xmlns:os-sla="http://www.openspaces.org/schema/sla"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.openspaces.org/schema/core http://www.openspaces.org/schema/core/openspaces-core.xsd
http://www.openspaces.org/schema/events http://www.openspaces.org/schema/events/openspaces-events.xsd
http://www.openspaces.org/schema/remoting http://www.openspaces.org/schema/remoting/openspaces-remoting.xsd
http://www.openspaces.org/schema/sla http://www.openspaces.org/schema/sla/openspaces-sla.xsd">
<os-core:giga-space-context/>
<!-- A bean representing a space (an IJSpace implementation).
Note, we do not specify here the cluster topology of the space. It is declared outside of
the processing unit or within the SLA bean. -->
<os-core:space id="space" url="jini://*/*/spaceQueries"/>
<os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager"/>
<os-core:local-tx-manager id="transactionManager" space="space"/>
<bean id="normalOrderEventValidator" class="com.gigaspaces.examples.tutorials.queries.validator.NormalOrderEventValidator"/>
<bean id="insecureRiskyOrderEventCounter" class="com.gigaspaces.examples.tutorials.queries.validator.InsecureRiskyOrderEventCounter"/>
<!-- A polling event container that performs (by default) polling take operations against
the space using the provided query template (in this case, the new normal orderEvents objects).
Once a match is found, the orderEvent validator bean event listener is triggered using the
annotation adapter, the listener method is annotated inside the bean with the @SpaceDataEvent
annotation. -->
<os-events:polling-container id="orderEventValidatorPollingEventContainer" giga-space="gigaSpace">
<os-events:tx-support tx-manager="transactionManager"/>
<os-core:sql-query where="type='Normal' and status='New'" class="com.gigaspaces.examples.tutorials.queries.common.OrderEvent"/>
<os-events:listener>
<os-events:annotation-adapter>
<os-events:delegate ref="normalOrderEventValidator"/>
</os-events:annotation-adapter>
</os-events:listener>
</os-events:polling-container>
<!-- The notification container, registers for notification on every orderEvent write (notify
on write is default) that satisfies the query (in this case with type="Insecure" and status="New").
Upon notification invokes the insecureRiskyOrderEventCounter listner on a copy of the object that
triggered the event. -->
<os-events:notify-container id="orderEventNotifyContainer" giga-space="gigaSpace"> -->
<os-events:tx-support tx-manager="transactionManager"/>
<os-core:sql-query where="type='Insecure' and status='New'" class="com.gigaspaces.examples.tutorials.queries.common.OrderEvent"/>
<os-events:listener>
<os-events:annotation-adapter>
<os-events:delegate ref="insecureRiskyOrderEventCounter"/>
</os-events:annotation-adapter>
</os-events:listener>
</os-events:notify-container>
</beans>