tomasbilek / gwteventservice

Automatically exported from code.google.com/p/gwteventservice
Other
0 stars 0 forks source link

Help Required - User Specific Domain/Events #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I have GWT application with Textbox,Textarea and button.
1) Open application in browser tab(firefox) and click button with string 
"Hello" in textbox should display "hello" in textarea.
2) Open same application in another tab (firefox) and click button with string 
"Hi' should display "Hi" in textarea.
Note : Instead, both tab display strings "Hi" and "Hello".

Client Snippet:
 1.Domain DOMAIN = DomainFactory.getDomain("my_domain");
 2.Add Listener
        theRemoteEventService.addListener(DOMAIN,My Listener() 
                public void onMyEvent(MyEvent event) {  
            textarea.setText(textarea.getText()+"\n"+event.getMessage());                
              }
          });

 3.theRemoteEventHandlerFactory.requestClientHandler(new AsyncCallback<ClientHandler>(){
    @Override
    public void onSuccess(ClientHandler result) {
        theRemoteEventHandlerFactory.registerClientSpecificHandler((ServiceDefTarget)greetingService, result);
          }
     }); 

Server Snippet:
   getEventExecutorService().addEvent(DOMAIN, new MyEvent(line));

What is the expected output? What do you see instead?
Each tab should receive the events based on client request.

What version of the product are you using? On what operating system?
GWTEventService 1.2.1
fc13.i686

Please provide any additional information below.
1.When i create USER_SPECIFIC_DOMAIN ,listener is not receiving any events.
    Domain DOMAIN = DomainFactory.USER_SPECIFIC_DOMAIN
2.I have added eventservice.properties file to conf folder and placed in war 
folder.

Original issue reported on code.google.com by susmitha...@gmail.com on 15 Nov 2013 at 12:50

GoogleCodeExporter commented 8 years ago
Add

# Generator for unique client ids
eventservice.connection.id.generator=de.novanic.eventservice.service.connection.
id.SessionExtendedConnectionIdGenerator

to eventservice.properties file

This allows you to have multiple conversations with the same HttpSession and 
Domain.
I hope this can help
Regards

Original comment by vlui...@tiscali.it on 16 Nov 2013 at 10:07

GoogleCodeExporter commented 8 years ago

Thanks for your response

Yes, that's right.i have added the above line in eventservice.properties file 
but still i am facing the issue.

In my case ,each tab will have unique request and accepts unique response from 
server.
Tab1 should not receive string "Hi" and tab2 should not receive string "Hello" 

How do i filter events based on client request?

Original comment by susmitha...@gmail.com on 18 Nov 2013 at 5:43

Attachments:

GoogleCodeExporter commented 8 years ago
If I understand correctly, then you should open two conversations with two 
DOMAINS, in order to take separate conversations and then the server side 
distributing selectively and separately by the two domains the respective 
events.

To better understand your problem I would need to know more.

Regards
Vittorio

Original comment by vlui...@tiscali.it on 18 Nov 2013 at 9:52

GoogleCodeExporter commented 8 years ago
No,Please do refer the first line in Client Snippet.
Here,I have created a domain "my_domain" and registered both the events in same 
domain.

I have also tried USER_SPECIFIC_EVENTS by setting domain
     Domain DOMAIN=DomainFactroy.USER_SPECIFIC_DOMAIN
Server Snippet:
   getEventExecutorService().addEventUserSpecific(new MyEvent(line));
But, in this case i didn't receive events from server.  

I have attached sample implementation code for your reference.

Regards,

Original comment by susmitha...@gmail.com on 20 Nov 2013 at 5:10

Attachments: