Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Is it possible to have two event listeners

Hello,
I have a polling container with a template and event listener. When the template is received, the listener starts, proceeds the template bean and saves it into space. Everything works.
Now I have to add another listener which should process the same bean but selected by different criteria.
Something like this:

<os-events:polling-container id="dataProcessorPollingEventContainer" giga-space="gigaSpace">
        <os-events:tx-support tx-manager="transactionManager"/>
        <os-core:template>
            <bean class="my.template.Bean">
                <property name="prop" value="EMPTY"/>
            </bean>
        </os-core:template>
        <os-events:listener>
            <os-events:annotation-adapter write-lease="1000">
                <os-events:delegate ref="simpleListener1"/>

            </os-events:annotation-adapter>
        </os-events:listener>
</os-events:polling-container>

This is the second listener, I have to add:
<os-core:template>
            <bean class="my.template.Bean">
                <property name="anotherProp" value="false"/>
            </bean>
        </os-core:template>
        <os-events:listener>
            <os-events:annotation-adapter update-or-write="false" update-timeout="1000" write-lease="1000">
                <os-events:delegate ref="simpleListener2"/>

            </os-events:annotation-adapter>
</os-events:listener>

Is that possible? Can you provide me some links with information?
I'm using XAP Community 7.1.1 with space:
 <os-core:space id="space"
            url="/./processorSpace" schema="persistent"
            external-data-source="hibernateDataSource">
            <os-core:lru-cache-policy/>
</os-core:space>

Thanks

This thread was imported from the previous forum.
For your reference, the original is available here

asked 2010-12-06 10:12:13 -0500

jeni_m gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

Jeni,

A polling container or notify container could have only one template. If you need multiple event handlers you will need to create another polling container or notify container. If you use multiple polling containers make sure the different templates does not overlap each other.

Shay

answered 2010-12-06 10:23:47 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks, Shay

jeni_m gravatar imagejeni_m ( 2010-12-06 10:43:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2010-12-06 10:12:13 -0500

Seen: 191 times

Last updated: Dec 06 '10