This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Am using RMI Spring capablilites and new to this framework.
In my application there is a client which access a service running on server using RMI Spring. Now, if maximum no. of users to that service connect, connection refuse exception is thrown and I am catching it and then transferring the control to another server which runs a backup service and performs the same task.
The task is simple. We are adding user names to an arraylist.
Problem: Arraylist to which users are getting added is local to each of the server and when control transfers to new server after exception has occured, the users get added to the arraylist which was created at the new server.
How can the same arraylist object be shared across the servers/application, so when the exception occurs or doesn't occur, program continues to add usernames in the same arraylist?
I don't completely understand what you're doing, but in order for two distinct JVMs (as I reckon you have) to operate on the same component, that component should be somehow exposed. Through an EJB, RESTful interface or anything really, as long both apps can see it and use it... You can't directly just share an object between JVMs.... well, you probably can, but that's hardly what you need here... I guess.