So I've been using Java/Scala/Lift to manage and run some Java code, using AJAX and JSON Rest to pass data into the java program from the browser and back respectively.
Currently I have a Scala class which contains a value with the java class that gets created when a user starts the Lift session by logging in. The AJAX and Rest are handled such that someone can click run on the browser, all other users will get info that an update has run, and then will access the data via Rest per-user.
This works because the Scala class containing the value has an extended object, and other Scala classes to handle control of Ajax/Rest/Updates can simply call functions or data as needed.
However while this works fine if the Java program is singular giving people access to it in a shared way - I'm struggling to find an easy way that someone could switch (even if it's just commenting out a line of code) such that each person gets their own copy without having a completely different setup.
Despite having the Scala code, and the code to accept Ajax commands be CometActor's by having the other classes access the 'Manager.scala' object extended from the class means that even though each person starts with a unique manager, the second it's accessed by another class it becomes shared. (I've tested this by using render, and UUID's)
Is there an easier or better way to manage this so one could easily switch from being able to update/receive data from some shared Java code, but also be able to have it be unique - or do I need to setup two completely different backend setups and tell the developer which to use?
Thanks for your hopeful insight and help!