Beispiel #1
0
        public void SetState(string state, ISubscriptionPersistence persistence, string nodeId)
        {
            Timesout = false;

            switch (state)
            {
            case MonitoredNode.HealthyAndFunctional:
                IsFullyFunctionalAndActive();
                persistence.Alter(nodeId, node => node.AddOwnership(Subject));

                break;

            case MonitoredNode.ThrowsExceptionOnStartupOrHealthCheck:
                ActivationException      = new DivideByZeroException();
                AssertAvailableException = new HandshakeException();
                break;

            case MonitoredNode.TimesOutOnStartupOrHealthCheck:
                Timesout = true;
                break;

            case MonitoredNode.IsInactive:
                IsFullyFunctional();
                IsActive = false;
                break;
            }
        }
Beispiel #2
0
 public void AddOwnershipToThisNode(Uri subject)
 {
     _persistence.Alter(_graph.NodeId, node => node.AddOwnership(subject));
 }
        public void SetState(string state, ISubscriptionPersistence persistence, string nodeId)
        {
            Timesout = false;

            switch (state)
            {
                case MonitoredNode.HealthyAndFunctional:
                    IsFullyFunctionalAndActive();
                    persistence.Alter(nodeId, node => node.AddOwnership(Subject));

                    break;

                case MonitoredNode.ThrowsExceptionOnStartupOrHealthCheck:
                    ActivationException = new DivideByZeroException();
                    AssertAvailableException = new HandshakeException();
                    break;

                case MonitoredNode.TimesOutOnStartupOrHealthCheck:
                    Timesout = true;
                    break;

                case MonitoredNode.IsInactive:
                    IsFullyFunctional();
                    IsActive = false;
                    break;
            }
        }