* @param content
* @param supersedes
*/
void addObservedCall(ObjectId targetId, String methodName,Object content,boolean supersedes, boolean clientInitiatedCall) {// TODO: Probably should move this to Transaction
Map<PropertyChangeSetListener,List<ObservedCall>> observedCallSet = getObservedCallSet();
IndividualRequest request = Client.getCurrentObjectResponse();
// create an observed call
ObservedCall evt = new ObservedCall(targetId, methodName, methodName.equals("DELETE") ? org.mozilla.javascript.Undefined.instance : content,
// if it is a clientInitiatedCall, we record the connection so we can avoid sending the notification back to the client
request != null && clientInitiatedCall && !request.performedClientInitiatedCall ? request.getConnection() : null);
// iterate through all the listeners
synchronized(PersistableObject.watchSets){
Scriptable global = GlobalData.getGlobalScope();
for (Entry<PropertyChangeSetListener,Map<ObjectId, Set<String>>> entry : PersistableObject.watchSets.entrySet()) {
PropertyChangeSetListener listener = entry.getKey();