Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Invalid thread access thrown when calling TreeViewer.refresh()(Invalid thread access thrown when calling TreeViewer.refresh())
Invalid thread access thrown when calling TreeViewer.refresh() [message #902146] Thu, 16 August 2012 06:41 Go to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Hi,

I am very new to RAP. I built a simple application for testing RAP features as part of evaluation process. My applicaiton was just a simple application displaying a simple tree strcutrue model through JFace TreeeViewer as well as having a delete action that delete a tree member, and then simply called TreeViewer.refresh() to update the presentation layer. (To be more specific, my application is based on Hyperbola example from one of Eclipse RCP books)

Well, the applicatoin was running fine in either Eclipse IDE or Web Broser(IE); but not both! When I opened the application in Eclipse IDE and IE at the same time, and then tried delete action, then "Invalid thread access" exception was thrown from TreeViewer.refresh(). I have tried some techniques I found from google like Job, Display.asyncExec, UICallback, etc. They didn't help. I couldn't figure out how to solve the problem.

Can anybody please help. Thank you in advance.

!ENTRY org.eclipse.rap.ui 4 0 2555-08-16 13:10:30.139
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:3531)
at org.eclipse.swt.SWT.error(SWT.java:3454)
at org.eclipse.swt.SWT.error(SWT.java:3425)
at org.eclipse.swt.widgets.Widget.error(Widget.java:962)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:902)
at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:660)
at org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:256)
at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:344)
at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2458)
at org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1751)
at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2907)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1432)
at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1386)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1488)
at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:536)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1447)
at org.example.rap.hyperbola.contact.ContactView$1.consume(ContactView.java:37)
at org.example.evenbus.InMemoryEvenBus.broadCast(InMemoryEvenBus.java:61)
at org.example.rap.hyperbola.contact.DeleteContactAction.run(DeleteContactAction.java:83)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:493)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:646)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:90)
at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)
at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)
at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)
at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at org.example.rap.hyperbola.Application.start(Application.java:20)
at org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
at java.lang.Thread.run(Unknown Source)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)

[Updated on: Thu, 16 August 2012 07:20]

Report message to a moderator

Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #902163 is a reply to message #902146] Thu, 16 August 2012 08:00 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
the error means that you are trying to refresh your viewer from a
background thread. It's strange that the error appears only if you have
more than one user session active. Without the actual code I can't help
you much.
Best,
Ivan


On 8/16/2012 9:41 AM, Thongchai Sukosi wrote:
> Hi,
>
> I am very new to RAP. I built a simple application for testing RAP
> features as part of evaluation process. My applicaiton was just a
> simple application displaying a simple tree strcutrue model through
> JFace TreeeViewer as well as having a delete action that delete a tree
> member, and then simply called TreeViewer.refresh() to update the
> presentation layer. (To be more specific, my application is based on
> Hyperbola example from one of Eclipse RCP books)
>
> Well, the applicatoin was running fine in either Eclipse IDE or Web
> Broser(IE); but not both! When I opened the application in Eclipse IDE
> and IE at the same time, and then tried delete action, then "Invalid
> thread access" exception was thrown from TreeViewer.refresh(). I have
> tried some techniques I found from google like Job, Display.asyncExec,
> UICallback, etc. They didn't help. I couldn't figure out how to solve
> the problem.
> Can anybody please help. Thank you in advance.
>
> !ENTRY org.eclipse.rap.ui 4 0 2555-08-16 13:10:30.139
> !MESSAGE Unhandled event loop exception
> !STACK 0
> org.eclipse.swt.SWTException: Invalid thread access
> at org.eclipse.swt.SWT.error(SWT.java:3531)
> at org.eclipse.swt.SWT.error(SWT.java:3454)
> at org.eclipse.swt.SWT.error(SWT.java:3425)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:962)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:902)
> at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:660)
> at
> org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:256)
> at
> org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:344)
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2458)
> at
> org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1751)
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2907)
> at
> org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1432)
> at
> org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
> at
> org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1386)
> at
> org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1488)
> at
> org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:536)
> at
> org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1447)
> at
> org.example.rap.hyperbola.contact.ContactView$1.consume(ContactView.java:37)
> at
> org.example.evenbus.InMemoryEvenBus.broadCast(InMemoryEvenBus.java:61)
> at
> org.example.rap.hyperbola.contact.DeleteContactAction.run(DeleteContactAction.java:83)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:493)
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)
> at
> org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
> at
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:646)
> at
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:90)
> at
> org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:191)
> at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:46)
> at
> org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:186)
> at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:208)
> at
> org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1145)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1135)
> at
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
> at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)
> at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
> at org.example.rap.hyperbola.Application.start(Application.java:20)
> at
> org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #902311 is a reply to message #902163] Fri, 17 August 2012 00:22 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
It looks like you've added a listener to your org.example.evenbus.InMemoryEvenBus object that directly updates the Viewer. When session A causes an event to fire, Session B's listener is also triggered and executed in Session A's UI thread, causing the exception.

Perhaps your bus needs to be a session singleton, or perhaps you need to wrap the updated call in a Display.asyncExec (which would need a UICallback active for the client to see the UI change straight away...)
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #902324 is a reply to message #902311] Fri, 17 August 2012 05:10 Go to previous messageGo to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Thanks you very much. I have tried your suggestion, and it did work! Smile

I amended the code to something like this.
SessionSingletonBase.getInstance(InMemoryEvenBus.class);

By the way I am wondering if you would be so kind as to answer my addtional questions as below:

1.) Though, it's not the best solution; but for my evaluation phase, this is good enough. By the way I am wondering if there is any already-exist of something like event bus in RAP (event producer doesn't have to couple with event consumers).

2.) I saw when I was debugging the program that each RAP user session would always be executed by the thread that created it. What if that thread is killed by external process? Will it caused the associated RAP user session to be fail as well?

3.) Is it always the case that the RAP user session needs to be executed on the same thread that created, or there are other options? If the number of RAP user sessions exceeds the number of maximum threads allow for that environment, how RAP should behaves?

Thanks you once again.

[Updated on: Fri, 17 August 2012 06:26]

Report message to a moderator

Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #902357 is a reply to message #902324] Fri, 17 August 2012 09:45 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Quote:
1.) Though, it's not the best solution; but for my evaluation phase, this is good enough. By the way I am wondering if there is any already-exist of something like event bus in RAP (event producer doesn't have to couple with event consumers).

Not that I'm aware of.

Quote:
2.) I saw when I was debugging the program that each RAP user session would always be executed by the thread that created it. What if that thread is killed by external process? Will it caused the associated RAP user session to be fail as well?

Yes, the if the thread is killed, the session will be disposed. You should never call Thread.stop()

Quote:
3.) Is it always the case that the RAP user session needs to be executed on the same thread that created, or there are other options? If the number of RAP user sessions exceeds the number of maximum threads allow for that environment, how RAP should behaves?

When run in SWT compatibility mode, yes. When run in JEE mode, no. But the workbench can't be used in JEE mode.

If you need to scale in SWT mode, look at a load balancer with session affinity and multiple RAP servers behind it.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903102 is a reply to message #902357] Wed, 22 August 2012 02:11 Go to previous messageGo to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Dear Chris,

Truly appreciate your informtive and prompt reply. By the way it is a little pity, since workbench is really cool and make RAP stand out. As I am not always having a control over the infrastructure, I hope to see workbench or something similar available for JEE mode one day.

Many Thanks,
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903115 is a reply to message #902357] Wed, 22 August 2012 06:08 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 17.08.12 11:45, schrieb Chris Mising name:
> Quote:
>> 1.) Though, it's not the best solution; but for my evaluation phase,
>> this is good enough. By the way I am wondering if there is any
>> already-exist of something like event bus in RAP (event producer
>> doesn't have to couple with event consumers).
>
> Not that I'm aware of.
>

Sure there's one EventAdmin from OSGi is an event bus e4 makes use of.

Tom
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903187 is a reply to message #903115] Wed, 22 August 2012 13:01 Go to previous messageGo to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Thank you for sharing the information. One question if you don't mind. I have searched and found a snippet of EventAdmin usage in RCP. By the way I would like to know whether it is also appropriate for multi-user environment like as RAP as well?

Thank you in advance.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903194 is a reply to message #903187] Wed, 22 August 2012 13:11 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well you can naturally use it in RAP as well all you need to do is to
make sure you isolate events you only want to share with the same RAP
instance.

You need to prefix events and subscriptions with something like a sessionId:

// Sending
Event event = new Event( sessionId + "/viewcommunication/syncEvent",
properties);
eventAdmin.sendEvent(event);

// Subscribing
Dictionary<String,String> properties = new Hashtable<String, String>();
properties.put(EventConstants.EVENT_TOPIC, sessionId +
"/viewcommunication/*");
ctx.registerService(EventHandler.class, handler, properties);

I'm not an expert in RAP but that's what I have proposed for e4 and is
already successfully used in the vaadin renderer for e4.

Tom


Am 22.08.12 15:01, schrieb Thongchai Sukosi:
> Thank you for sharing the information. One question if you don't mind. I
> have searched and found a snippet of EventAdmin usage in RCP. By the way
> I would like to know whether it is also appropriate for multi-user
> environment like as RAP as well?
>
> Thank you in advance.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903522 is a reply to message #903194] Fri, 24 August 2012 06:41 Go to previous messageGo to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Dear Thomas,

Thank you again for your reply. While I am considering your solution, one thing come up on my mind.

- Suppose when I do this ...

BundleContext ctx = FrameworkUtil.getBundle(SenderView.class).getBundleContext();
ServiceReference<EventAdmin> ref = ctx.getServiceReference(EventAdmin.class);
EventAdmin eventAdmin = ctx.getService(ref);

1. Is the EventAdmin obtained above singleton?

2. If so, does it have a dedicated thread for fetching and broadcasting events?

3. If so, it means that all user sessions in RAP depend on that dedicated thread to broadcast events of their interest. Will it cause any scalibility or concurrency issue?

Please kindly advice.

Thank you in advance.

[Updated on: Fri, 24 August 2012 09:44]

Report message to a moderator

Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903685 is a reply to message #903522] Fri, 24 August 2012 21:36 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes the EventAdmin is a singleton. There are 2 ways to send out events:
* post - is async
* send - is sync

Whether this can get a bottleneck is something you need to test your own
using a simple OSGi-Application and create threads who are sending and
receiving notifications.

Tom

Am 24.08.12 08:41, schrieb Thongchai Sukosi:
> Dear Thomas,
>
> Thank you again for your reply. While I am considering your solution,
> one thing come up on my mind.
>
> - Suppose when I do this ...
>
> BundleContext ctx =
> FrameworkUtil.getBundle(SenderView.class).getBundleContext();
> ServiceReference<EventAdmin> ref =
> ctx.getServiceReference(EventAdmin.class);
> EventAdmin eventAdmin = ctx.getService(ref);
>
> 1. Is the EventAdmin obtained above singleton?
>
> 2. If so, does it have a dedicated for fetching and broadcasting events?
>
> 3. If so, it means that all user sessions in RAP need to wait for that
> dedicated thread to broadcast events of their interest. Will it cause
> any scalibility issue?
>
> Please kindly advice.
> Thank you in advance.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #903719 is a reply to message #903685] Sat, 25 August 2012 02:36 Go to previous messageGo to next message
Thongchai Sukosi is currently offline Thongchai SukosiFriend
Messages: 7
Registered: August 2012
Junior Member
Dear,

Pls do not get me wrong. I'm really appricated you guys answering many many questions from novices like me.

By the way since this topic have been read by thousands of people and might be more people to read it in the future. Thus I would like to make it clear for others.

Firstly I do not worry about whether or not EventAdmin can support any types of OSGI-Application, because I am pretty sure it does well on serving its original design goal so as to provide a mean of communication amoung OSGI bundles even with fews threads are involved. The good example is Eclipse IDE.

But as the matter of fact, my originally question is asking about whether or not a decouple event mechanism (the practical one) is there for RAP or developers need to seek for another solution.

Fortunately I just found this information from eclipsesource.com blogs this morning (my bad!). Sorry that I am unable to post the web link. The information has been published by 'Ralf Sternberg' since 16-JUL-12. If it is correct, it might be a conclusion as well as hope to the question.

[Below is a part of the information]
"However, even with these changes, the Eclipse 4 workbench is not yet capable of handling multiple user sessions. One known problem is that events are broadcast using the OSGi event admin service. In RAP all user sessions share a single instance of this service. However, I've learned that the event admin service is never accessed directly by E4 code, but always through an event broker interface in from the current context, which should make this problem much easier to fix."

Thank you once again.

[Updated on: Sat, 25 August 2012 04:20]

Report message to a moderator

Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #904003 is a reply to message #903719] Mon, 27 August 2012 14:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

we now face the same question. We need to send events and listen to
those. The EventAdmin is not the correct solution for RAP applications
as this does not seem to be able to work with multiple users. If one
user fires an event, than all other user sessions will be notifed of
this event. Great for a chat application, but not for updating views etc. .

For now, it seems that we need to build our own solution, like an
EventManager that is a SessionSingleton or something like this.

Regards,
Markus

Am 25.08.2012 04:36, schrieb Thongchai Sukosi:
> Dear,
>
> Pls do not get me wrong. I'm really appricated you guys, answering many
> many questions from novices like me.
>
> By the way since this topic have been read by thousands of people and
> might be more people to read it in the future. Thus I would like to make
> it clear for others.
>
> Firstly I do not worry about whether or not EventAdmin can support any
> types of OSGI-Application, because I am pretty sure it does well on
> serving its original design goal so as to provide a mean of
> communication amoung OSGI bundles even with fews threads are involved.
> The good example is Eclipse IDE.
>
> But as the matter of fact, my originally question is asking about
> whether or not a decouple event mechanism (the practical one) is there
> for RAP or developers need to seek for another solution.
>
> Fortunately I just found this information from eclipsesource.com blogs
> this morning (my bad!). Sorry that I am unable to post the web link. The
> information was published since 16-JUL-12. If it is correct, it might be
> a conclusion as well as hope to the question.
>
> [Below is a part of the information]
> "However, even with these changes, the Eclipse 4 workbench is not yet
> capable of handling multiple user sessions. One known problem is that
> events are broadcast using the OSGi event admin service. In RAP all user
> sessions share a single instance of this service. However, I've learned
> that the event admin service is never accessed directly by E4 code, but
> always through an event broker interface in from the current context,
> which should make this problem much easier to fix."
>
> Thank you once again.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #904055 is a reply to message #904003] Mon, 27 August 2012 16:32 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you read my idea? You can simply scope the event to a session by
prefixing all your events with it.

So if you have "clientA" and "clientB" and upon launch give them a
unique key (e.g. the session) which I'd name $clientId and prefix all
your your EventAdmin-Events and Subscribtions with $clientId+"/...." you
can use the EventAdmin in a multi-user env (This is BTW the proposed
solution for e4 and works already in the e4 vaadin port).

Tom

Am 27.08.12 16:37, schrieb Markus Krüger:
> Hi,
>
> we now face the same question. We need to send events and listen to
> those. The EventAdmin is not the correct solution for RAP applications
> as this does not seem to be able to work with multiple users. If one
> user fires an event, than all other user sessions will be notifed of
> this event. Great for a chat application, but not for updating views etc. .
>
> For now, it seems that we need to build our own solution, like an
> EventManager that is a SessionSingleton or something like this.
>
> Regards,
> Markus
>
> Am 25.08.2012 04:36, schrieb Thongchai Sukosi:
>> Dear,
>>
>> Pls do not get me wrong. I'm really appricated you guys, answering many
>> many questions from novices like me.
>>
>> By the way since this topic have been read by thousands of people and
>> might be more people to read it in the future. Thus I would like to make
>> it clear for others.
>>
>> Firstly I do not worry about whether or not EventAdmin can support any
>> types of OSGI-Application, because I am pretty sure it does well on
>> serving its original design goal so as to provide a mean of
>> communication amoung OSGI bundles even with fews threads are involved.
>> The good example is Eclipse IDE.
>>
>> But as the matter of fact, my originally question is asking about
>> whether or not a decouple event mechanism (the practical one) is there
>> for RAP or developers need to seek for another solution.
>>
>> Fortunately I just found this information from eclipsesource.com blogs
>> this morning (my bad!). Sorry that I am unable to post the web link. The
>> information was published since 16-JUL-12. If it is correct, it might be
>> a conclusion as well as hope to the question.
>>
>> [Below is a part of the information]
>> "However, even with these changes, the Eclipse 4 workbench is not yet
>> capable of handling multiple user sessions. One known problem is that
>> events are broadcast using the OSGi event admin service. In RAP all user
>> sessions share a single instance of this service. However, I've learned
>> that the event admin service is never accessed directly by E4 code, but
>> always through an event broker interface in from the current context,
>> which should make this problem much easier to fix."
>>
>> Thank you once again.
Re: Invalid threadd access thrown when calling TreeViewer.refresh() [message #904893 is a reply to message #904055] Wed, 29 August 2012 10:33 Go to previous message
Eclipse UserFriend
Ah, ok, didn'T get that. Thank you, we'll try.

Am 27.08.2012 18:32, schrieb Tom Schindl:
> Did you read my idea? You can simply scope the event to a session by
> prefixing all your events with it.
>
> So if you have "clientA" and "clientB" and upon launch give them a
> unique key (e.g. the session) which I'd name $clientId and prefix all
> your your EventAdmin-Events and Subscribtions with $clientId+"/...." you
> can use the EventAdmin in a multi-user env (This is BTW the proposed
> solution for e4 and works already in the e4 vaadin port).
Previous Topic:How to do a loading page
Next Topic:IE security message on rap-org.eclipse.swt.theme.Default-eb194a91.js
Goto Forum:
  


Current Time: Sat Apr 20 02:09:11 GMT 2024

Powered by FUDForum. Page generated in 0.04710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top