Is there a way to utilize a single EventBus for both a Java and GWT project concurrently?

Currently, I am working on a java project that utilizes the Guava EventBus. My goal is to integrate this code into a GWT project without having to rewrite it entirely. While I am aware that GWT comes with its own built-in EventBus, making changes to my Java project's dependencies could potentially cause issues.

In order to incorporate Guava into my GWT project, I have included the guava and gwt-guava jars. Additionally, I have added:

<inherits name="com.google.common.collect.Collect"/>

to my gwt.xml file, which has allowed Guava to work successfully for other classes within the GWT project (such as Strings).

The main challenge lies in using Guava's EventBus instead of GWT's provided EventBus. This switch is necessary as my Java project is not compatible with GWT's implementation. The dilemma arises from the fact that while the GWT project relies on GWT's EventBus, the Java project uses the Guava version. Is there a way to bridge these two implementations seamlessly? Ideally, I would like to substitute the Guava EventBus from the Java project with the one in my GWT project.

Is there a method to utilize Guava EventBus with GWT without altering the dependencies in the original Java project?

Answer №1

Unfortunately, Guava's EventBus cannot be used in GWT client code as it lacks the @GwtCompatible annotation.

While some classes not initially available in GWT can be made accessible, EventBus relies on Java reflection which is not supported in GWT, preventing its use in this context.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can data be transferred from one website to another without the use of an API?

I am a newcomer to the world of web development with basic knowledge of JS, Node, Express, Mongoose, and MongoDB. I have an exciting idea for a web application that would function like a spreadsheet, gathering user inputs to generate an output. The unique ...

"Design the website with a WYSIWYG editor while preventing users from disrupting the page's

I am considering using an HTML WYSIWYG editor like CKEditor, but I am concerned about the possibility of users submitting HTML code that could alter the layout of the page when rendered. Here is a comparison between two posts: <p><b>This is m ...

Is Three.js capable of creating procedurally-generated bump or specular maps?

Using Three.js, it is common practice to utilize external images for bump maps and specular maps: var specular = THREE.ImageUtils.loadTexture("path/to/file.png"); var myMaterial = new THREE.MeshPhongMaterial(); myMaterial.specularMap = specular; However, ...

Prior to the execution of the .create() function in the JavaScript code, the .find() function is being invoked

I am currently following Colt's Web Dev bootcamp and I have encountered an issue. In his version, everything works perfectly fine but when I use the same code, a new entry is added to the database, however, it is not displayed in the printed items unl ...

Creating a loop in Javascript that accesses values from a JSON file and uses the nested data within the loop as a separate JSON object

I am working with a list of user uuids stored in the myContactsUuids array. I am using the forEach() method to iterate through them and add each user, retrieved using the new ChatEngine.User(uuid) function, to the myContacts array. myContactsUuids = ["joh ...

Adjusting the mesh position in WebGL/Three.js

Seeking some guidance on three.js. How can I apply an offset to a mesh? You can find the basic code here: I am looking to set a position offset and have that point serve as the rotation reference. I attempted: mesh.applyMatrix( new THREE.Matrix4().makeTr ...

Drawing an image on an Ionic 4 canvas using the drawImage method, following a change

I've been working on an app that displays an image on a canvas, with the image source coming from the parent page. Everything seems to be functioning correctly, but when I try changing the imageSrc via a button click, the canvas ends up blank. Oddly ...

Synchronizing Events across Two JavaScript Applications

In my game app (using Electron) and web app (testing on Android Chrome), they communicate through a websocket server to coordinate a countdown. I've noticed that in environments with low latency, the synchronization is fine. However, when there is mor ...

Using Javascript to trigger a setTimeout function after the user's mouse leaves

There is a div that pops up when the user's mouse exits the webpage, containing a survey pertaining to my website. I want to avoid prompting users to take the survey if they move their cursor out of the page within the first few minutes of browsing. ...

"Tree panel items in ExtJS 4 are displaying correctly in Firefox, but are mysteriously missing from

While working on my Tree Panel project, I encountered an issue with the display of items in different browsers. The items show up correctly in Firefox but appear empty in Chromium. How is this possible? Here's the JSON data sent to the server: {"tex ...

The ball refuses to fall into the designated boxes

I designed a basic webpage featuring 3 boxes that, when clicked on, trigger the dropping of a ball into them. Below is the code I used: <!DOCTYPE html> <html> <head> <script type="text/javascript"> function popup (n) { ...

Discovering ways to enhance time multiplication with JavaScript

My MVC model provides me with a timespan like this: timeTaken = "00:01:00"; Along with a multiplier value of multiply = "3"; The end result should be 00:03:00 What would be the most efficient way to calculate this time? I'm not well-versed in ...

Issue encountered while retrieving the response, in case the node.js server sends the response with a delay

My aim is to upload an image and have the nodeJS server send the path of that image folder back as a response. Unfortunately, when I try sending the response after completing a task, nothing seems to be happening on the angular-side. Below is my componen ...

After installing babylonjs via npm, encountering the error 'Unable to utilize import statement outside a module'

Recently, I've been working on setting up babylonjs through npm. Starting with a new project, I ran npm init and then proceeded to install babylonjs using npm install babylonjs --save, following the provided documentation. I then created a JavaScript ...

The scanner's use of the delimiter isn't functioning properly with a CSV file accessed through

As a Java beginner, I'm struggling to grasp certain concepts, so please bear with me. Currently, I'm working on a project that involves taking the user's input of UK currency and determining the exchange rate for a specified country. Below i ...

The rating script fails to update when multiple ratings are applied simultaneously

Greetings! I am currently in the process of developing a rating script and encountering some issues. At the moment, the script is somewhat functional -> The problem arises when I open two browsers, load image 1 on both, and rate the image in each brow ...

How can a tooltip be displayed on a disabled toggleButton?

When trying to display a tooltip for MUI's ToggleButton while it is disabled, I am encountering an issue where the tooltip works fine for enabled ToggleButtons but breaks for disabled ones. <ToggleButton value={item?.key} aria-label="left aligned" ...

Comparison between ClientRequestFilter and ContainerRequestFilterThese two types of

Filters are essential for handling requests and performing actions with HTTP headers and methods. However, I'm confused about What sets ClientRequestFilter apart from ContainerRequestFilter? When should we utilize ClientRequestFilter versus Container ...

Is there a method to refresh the image in the template?

I am currently working on generating various images using canvas. Is there a way to display these images in real-time on my main.pug template without having to reload the page every time an image changes? const Canvas = require('canvas') , Ima ...

The radio input is not being properly checked using ng-checked in Angular

The ng-checked attribute is causing issues in the application, specifically with radio buttons. It seems to be working fine for checkboxes but not for radio buttons. <input type="radio" class="radio" name="job_class_radio" ng-checked="key===jobClassDat ...