Hi,
 
>1) How can I retrieve the written entry from remote event in notify() method 
>of the listener?
The JavaSpaces API doesn't support such method (you need to call the read 
method to find the Entry).
We in GigaSpaces extended the EventListener  because we realized this is the 
common case. So, the GigaSpaces implementation also allows you to get the Entry 
as part of the RemoteEvent.
See: 
http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-ReceivetheEvent
 
<http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-ReceivetheEvent>
 
 
>2) How can I make sure that the next event will call notify after the previous 
>event data is send to the Servlet response? I tried using flush but invain.
Again this it's not supported by the JavaSpaces API (you should implement such 
pattern).
Again in GigaSpaces found that to be a very common case and added a FIFO 
support providing exactly what you asked.
See: 
http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-FIFOBasedNotifications
 
<http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-FIFOBasedNotifications>
 
 
>3) How can I filter remote events?
Filtering the JavaSpaces is based on the template matching, a more complex 
filtering is not available and such should be implemented by the user.
Funny to say but again this pattern was implemented as part of the GigaSpaces 
extension to the JavaSpaces API, using INotifyDelegatorFilter API.
See: 
http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-FilteringEvents
 
<http://www.gigaspaces.com/wiki/display/XAP7/Session+Based+Messaging+API#SessionBasedMessagingAPI-FilteringEvents>
 
 
Guy Korland
R&D Team Leader
GigaSpaces

________________________________

From: [email protected] [mailto:[email protected]]
Sent: Tue 9/15/2009 12:01 AM
To: [email protected]
Subject: Javaspaces notify and sending event data to client


Hi,

I am developing a stock market platform. I am writing Stock entries to 
javaspace and generating events. The event is notified in EventListener.

Now I want to get the entry written to the space for which the event is 
generated and send the entry data to Servlet response. For servlet response I 
am already passing the HttpResponse object to the EventListener class and is 
available in notify() method.

Questions are as follows:

1) How can i retrieve the written entry from remote event in notify() method of 
the listener?
2) How can i make sure that the next event will call notify after the previous 
event data is send to the Servlet response? I tried using flush but invain.
3) How can i filter remote events?

Any help will be appreciated. Thanks in advance.



Reply via email to