public void SetupSiblingRelationship(ISpecificationModel relatedModel) { ISibling sibling = this.testingFactory.GenerateSibling(this, relatedModel); this.siblings.Add(sibling); this.relationships.Add(sibling); }
/// <summary> /// Internal constructor to allow creation of a stopwatch that uses previous sibling 'end' timestamp as the 'start' /// for this watch, and uses the assigned parents 'end' timestamp as the 'end' for this watch. /// </summary> Startwatch(Startwatch sibling, ISibling fakeParentParameter, Startwatch parent, IParent parent1) { if (parent == null) { throw new ArgumentNullException("parent"); } _startTimestamp = sibling._stopTimestamp; _stopTimestamp = parent._stopTimestamp; }
private List <bool> MayIProcess(TuplePack input) { List <bool> decisions = new List <bool>(); List <string> toRemove = new List <string>(); Siblings = new List <ISibling>(); // Query my brothers foreach (string siblingUrl in SlaveObj.Siblings) { try { ISibling replica = (ISibling)Activator.GetObject(typeof(ISibling), siblingUrl); Siblings.Add(replica); decisions.Add(replica.PollTuple(input)); } catch (SocketException e) { // Sibling has crashed don't consider it toRemove.Add(siblingUrl); } catch (NotImplementedException e) { // Sibling doens't respond } catch (Exception e) { Console.WriteLine(e.GetBaseException()); } } // remove the siblings that don't need to be considered foreach (var siblingurl in toRemove) { SlaveObj.Siblings.Remove(siblingurl); } return(decisions); }
/// <summary> /// internal constructor that allows creation of a sibling stopwatch from older sibling /// </summary> Startwatch(Startwatch sibling, ISibling fakeParentParameter) { _startTimestamp = sibling._stopTimestamp; _stopTimestamp = new RefTimestamp(); }