Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 218732 Details for
Bug 309868
Single EventBus is a problem in multi-user/multi-instance scenario
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Make EventBroker App-Instance aware
eclipse.platform.ui.patch (text/plain), 2.88 KB, created by
Thomas Schindl
on 2012-07-15 06:23:54 EDT
(
hide
)
Description:
Make EventBroker App-Instance aware
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2012-07-15 06:23:54 EDT
Size:
2.88 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/EventBroker.java b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/EventBroker.java >index b3c46d1..6f034c1 100644 >--- a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/EventBroker.java >+++ b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/EventBroker.java >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.e4.ui.services.internal.events; > >+import javax.inject.Named; >+ > import org.eclipse.e4.ui.di.UISynchronize; > > import org.eclipse.e4.core.di.annotations.Optional; >@@ -46,6 +48,11 @@ > @Inject > @Optional > UISynchronize uiSync; >+ >+ @Inject >+ @Optional >+ @Named("e4ApplicationInstanceId") >+ String applicationInstanceId; > > // This is a temporary code to ensure that bundle containing > // EventAdmin implementation is started. This code it to be removed once >@@ -96,6 +103,10 @@ > @SuppressWarnings("unchecked") > private Event constructEvent(String topic, Object data) { > Event event; >+ if( applicationInstanceId != null ) { >+ topic = applicationInstanceId + "/" + topic; >+ } >+ > if (data instanceof Dictionary<?,?>) { > event = new Event(topic, (Dictionary<String,?>)data); > } else if (data instanceof Map<?,?>) { >@@ -120,7 +131,13 @@ > logger.error(NLS.bind(ServiceMessages.NO_BUNDLE_CONTEXT, topic)); > return false; > } >- String[] topics = new String[] {topic}; >+ String[] topics; >+ if( applicationInstanceId != null ) { >+ topics = new String[] { applicationInstanceId + "/" + topic}; >+ } else { >+ topics = new String[] {topic}; >+ } >+ > Dictionary<String, Object> d = new Hashtable<String, Object>(); > d.put(EventConstants.EVENT_TOPIC, topics); > if (filter != null) >diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java >index c4f1f59..17846e9 100644 >--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java >+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java >@@ -20,6 +20,7 @@ > import java.util.List; > import java.util.Locale; > import java.util.Properties; >+import java.util.UUID; > import org.eclipse.core.databinding.observable.Realm; > import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.IExtensionRegistry; >@@ -180,6 +181,7 @@ > IApplicationContext.APPLICATION_ARGS); > > IEclipseContext appContext = createDefaultContext(); >+ appContext.set("e4ApplicationInstanceId", UUID.randomUUID().toString()); > appContext.set(Realm.class, SWTObservables.getRealm(display)); > appContext.set(UISynchronize.class, new UISynchronize() { >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 309868
: 218732