But, continue to use realModel as input to other components. To recommend, first construct and set the temporary user information on the model and then simply call the recommender. The synchronized block exists to remind you that this is of course not thread-safe. Only one set of temp data can be inserted into the model and used at one time.
Recommender recommender = ...; ... synchronized(...) { PreferenceArray tempPrefs = ...; plusModel.setTempPrefs(tempPrefs); recommender.recommend(PlusAnonymousUserDataModel.TEMP_USER_ID, 10); }
| |