private void RegisterHandler(Register register) { var client = Context.WebSocket; _clients.Add(register.GetNodeName(), client); var currentModel = WSGroupServices.GetModelService().getCurrentModel().getModel(); var kf = new DefaultKevoreeFactory(); // we clone the marshalled instance into a proper one var modelToApply = (ContainerRoot)kf.createJSONLoader().loadModelFromString(currentModel.serialize()).get(0); // We merge received model with current one ContainerRoot recModel = (ContainerRoot)WSGroupServices.GetJsonModelLoader() .loadModelFromString(register.GetModel()).get(0); TraceSequence tseq = WSGroupServices.GetModelCompare().merge(modelToApply, recModel); tseq.applyOn(modelToApply); Dictionary<string, string> context = new Dictionary<string, string>(); context.Add("nodeName", register.GetNodeName()); context.Add("groupName", WSGroupServices.GetContext().getInstanceName()); if (DoesFilterMatchIncomingNodeName(register.GetNodeName(), WSGroupServices.GetFilter())) { ApplyOnConnect(context, modelToApply); } else { var push = new Push(new ContainerRootMarshalled(modelToApply).serialize()); _clients[register.GetNodeName()].Send(push.Serialize()); } }