Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share object between java applications?

Tags:

People also ask

How to share object between threads Java?

There are many ways to share same Object between multiple threads. You can use a BlockingQueue to pass an Object from one thread to another thread. You can also use Exchanger class for this purpose. An Exchanger is a bidirectional form of a SynchronousQueue in Java.

How to share data between Servlets?

It can be retrieved via getServletContext() method. ServletContext has an "application" scope, and can also be used to pass information between servlets within the same application, via methods setAttribute("name", object) and getAttribute("name").

How share the data in application scope?

To share data between users of the web application we can put a shared object in application scope which can be done by calling setAttribute() method of the ServletContext . By this way data can then be accessing by other users by calling the getAttribute() method of the ServletContext .


I have 2 separate Java Applications running at a time. (Two separate javaw.exe) I need to share an object between them while they are running.

What is the simplest way to achieve this without having any permanent storage?