Share object in same JVM
-
I am reading date time and generating random number using MyClass(Java class) that have Main function. I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java). in this case there was two main that is running concurrent and want to share data.
-
I am reading date time and generating random number using MyClass(Java class) that have Main function. I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java). in this case there was two main that is running concurrent and want to share data.
-
You should create a library (class or jar file) that the other application calls in order to get its information.
yes, I agreed bu problem is that to shared variable of my current running application to other java application and if other application access my class that is OK but how to share value of my current running object.
-
yes, I agreed bu problem is that to shared variable of my current running application to other java application and if other application access my class that is OK but how to share value of my current running object.
-
I am reading date time and generating random number using MyClass(Java class) that have Main function. I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java). in this case there was two main that is running concurrent and want to share data.
Shivanand Gupta wrote:
I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java).
No, you are approaching this incorrectly. What you need is a 'service' that provides a unique (presumably that is what you think you are doing) data to the caller. That service is an independent app. Then the two apps that you have use that service. That way either app can be running without the other. This of course presumes there isn't a different way to solve the problem which wouldn't require any sharing at all.
-
I am reading date time and generating random number using MyClass(Java class) that have Main function. I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java). in this case there was two main that is running concurrent and want to share data.
For get your Solution you can visit on http://techgurulab.com/course/java-tutorials/
-
Shivanand Gupta wrote:
I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java).
No, you are approaching this incorrectly. What you need is a 'service' that provides a unique (presumably that is what you think you are doing) data to the caller. That service is an independent app. Then the two apps that you have use that service. That way either app can be running without the other. This of course presumes there isn't a different way to solve the problem which wouldn't require any sharing at all.
thanks dear