<?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">
	
	<!-- ========================================================================================================================== -->
	
    <!-- Enables the usage of @GigaSpaceContext annotation based injection. -->
    <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"/>

    <!-- OpenSpaces simplified space API built on top of IJSpace/JavaSpace. -->
    <os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager"/>

    <!-- Defines a local Jini transaction manager. -->
    <os-core:local-tx-manager id="transactionManager" space="space"/>
	
	
	<!-- The normalOrderEvent validator bean -->
    <bean id="normalOrderEventValidator" class="com.gigaspaces.examples.tutorials.queries.validator.NormalOrderEventValidator"/>
    
    <!-- The insecureRiskyOrderEvent Counter bean -->
    <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=&apos;Normal&apos; and status=&apos;New&apos;" 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"> <!-- perform-take-on-notify="true" ignore-event-on-null-take="true">-->
		<os-events:tx-support tx-manager="transactionManager"/>
		<os-core:sql-query where="type=&apos;Insecure&apos; and status=&apos;New&apos;" 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>
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence