示例#1
0
 /** <inheritdoc /> */
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     if (evt == LifecycleEventType.BeforeNodeStop && _ignite != null)
     {
         ((Ignite)_ignite).BeforeNodeStop();
     }
 }
示例#2
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="name">is the name of the named window</param>
 /// <param name="processor">instance for processing the named window contents</param>
 /// <param name="eventType">the type of event</param>
 /// <param name="paramList">event parameters</param>
 protected internal NamedWindowLifecycleEvent(String name, NamedWindowProcessor processor, LifecycleEventType eventType, params Object[] paramList)
 {
     _name      = name;
     _processor = processor;
     _eventType = eventType;
     _paramList = paramList;
 }
示例#3
0
 /// <summary>Ctor. </summary>
 /// <param name="statement">the statement</param>
 /// <param name="eventType">the type if event</param>
 /// <param name="parameters">event parameters</param>
 public StatementLifecycleEvent(EPStatement statement,
                                LifecycleEventType eventType,
                                params Object[] parameters)
 {
     Statement  = statement;
     EventType  = eventType;
     Parameters = parameters;
 }
 /** <inheritDoc /> */
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     if (evt == LifecycleEventType.AfterNodeStart)
         // This event cannot be propagated right away because at this point we
         // do not have Ignite instance yet. So just schedule it.
         _startEvt = true;
     else
         _target.OnLifecycleEvent(evt);
 }
        /** <inheritdoc /> */
        public void OnLifecycleEvent(LifecycleEventType evt)
        {
            if (evt == LifecycleEventType.AfterNodeStop)
            {
                _isStopping = true;

                Stop();
            }
        }
示例#6
0
 private void CheckExitCondition(InternalState internalState, LifecycleEventType eventType)
 {
     foreach (IExitCondition exitCondition in exitConditions)
     {
         if (exitCondition.CheckExitCondition(this, internalState, eventType))
         {
             throw new ExitConditionException(exitCondition, internalState, eventType);
         }
     }
 }
示例#7
0
        /** <inheritdoc /> */
        public void OnLifecycleEvent(LifecycleEventType evt)
        {
            if (evt != LifecycleEventType.AfterNodeStart && evt != LifecycleEventType.BeforeNodeStop)
            {
                return;
            }

            _ignite.GetCompute()
            .ExecuteJavaTask <object>(SetUseTypedArrayTask, evt == LifecycleEventType.AfterNodeStart);
        }
#pragma warning restore 649

            /** <inheritDoc /> */
            public void OnLifecycleEvent(LifecycleEventType evt)
            {
                Console.WriteLine();
                Console.WriteLine(">>> Ignite lifecycle event occurred: " + evt);
                Console.WriteLine(">>> Ignite name: " + (_ignite != null ? _ignite.Name : "not available"));

                if (evt == LifecycleEventType.AfterNodeStart)
                    Started = true;
                else if (evt == LifecycleEventType.AfterNodeStop)
                    Started = false;          
            }
示例#9
0
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     if (evt == LifecycleEventType.AfterNodeStart)
     {
         Started = true;
     }
     else if (evt == LifecycleEventType.AfterNodeStop)
     {
         Started = false;
     }
 }
示例#10
0
 /** <inheritDoc /> */
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     if (evt == LifecycleEventType.AfterNodeStart)
     {
         // This event cannot be propagated right away because at this point we
         // do not have Ignite instance yet. So just schedule it.
         _startEvt = true;
     }
     else
     {
         _target.OnLifecycleEvent(evt);
     }
 }
示例#11
0
        private ExitConditionException NotifyLifecycleEvent(LifecycleEventType eventType)
        {
            ExitConditionException pendingInterruption = null;

            try
            {
                switch (eventType)
                {
                case LifecycleEventType.HalfTState:
                    if (HalfTState != null)
                    {
                        HalfTState(new InternalState(this), eventType);
                    }
                    break;

                case LifecycleEventType.InstructionEnd:
                    if (InstructionEnd != null)
                    {
                        InstructionEnd(new InternalState(this), eventType);
                    }
                    break;

                case LifecycleEventType.InstructionStart:
                    if (InstructionStart != null)
                    {
                        InstructionStart(new InternalState(this), eventType);
                    }
                    break;

                case LifecycleEventType.MachineCycleEnd:
                    if (MachineCycleEnd != null)
                    {
                        MachineCycleEnd(new InternalState(this), eventType);
                    }
                    break;

                case LifecycleEventType.MachineCycleStart:
                    if (MachineCycleStart != null)
                    {
                        MachineCycleStart(new InternalState(this), eventType);
                    }
                    break;
                }
            }
            catch (ExitConditionException e)
            {
                pendingInterruption = e;
            }
            return(pendingInterruption);
        }
示例#12
0
#pragma warning restore 649

            /** <inheritDoc /> */
            public void OnLifecycleEvent(LifecycleEventType evt)
            {
                Console.WriteLine();
                Console.WriteLine(">>> Ignite lifecycle event occurred: " + evt);
                Console.WriteLine(">>> Ignite name: " + (_ignite != null ? _ignite.Name : "not available"));

                if (evt == LifecycleEventType.AfterNodeStart)
                {
                    Started = true;
                }
                else if (evt == LifecycleEventType.AfterNodeStop)
                {
                    Started = false;
                }
            }
示例#13
0
 private IEnumerator RunAssertInternal(LifecycleEventType lifecycleEventType, Action <GameObject> callback = null)
 {
     yield return
         (RunAssert(
              "LifecycleEvent",
              AssertLifecycleEvent,
              () =>
     {
         CurrentLifecycleEventType = lifecycleEventType;
         var go = SceneManager
                  .GetSceneByName("LifecycleEvent")
                  .GetRootGameObjects()
                  .First(x => x.name == lifecycleEventType.ToString());
         Assert.NotNull(go);
         go.SetActive(true);
         callback?.Invoke(go);
     },
              0.5
              ));
 }
示例#14
0
        private ExitConditionException NotifyLifecycleEvent(LifecycleEventType eventType)
        {
            ExitConditionException pendingInterruption = null;

            try
            {
                switch (eventType)
                {
                case LifecycleEventType.ClockCycle:
                    if (ClockCycle != null)
                    {
                        ClockCycle(this, new InternalState(this), eventType);
                    }
                    break;
                }
            }
            catch (ExitConditionException e)
            {
                pendingInterruption = e;
            }
            return(pendingInterruption);
        }
示例#15
0
        /** <inheritDoc /> */
        public void OnLifecycleEvent(LifecycleEventType evtType)
        {
            if (LifecycleTest.ThrowErr)
            {
                throw new Exception("Lifecycle exception.");
            }

            Event evt = new Event
            {
                Grid1 = Grid1,
                Grid2 = Grid2,
                Prop1 = Property1,
                Prop2 = Property2
            };

            switch (evtType)
            {
            case LifecycleEventType.BeforeNodeStart:
                LifecycleTest.BeforeStartEvts.Add(evt);

                break;

            case LifecycleEventType.AfterNodeStart:
                LifecycleTest.AfterStartEvts.Add(evt);

                break;

            case LifecycleEventType.BeforeNodeStop:
                LifecycleTest.BeforeStopEvts.Add(evt);

                break;

            case LifecycleEventType.AfterNodeStop:
                LifecycleTest.AfterStopEvts.Add(evt);

                break;
            }
        }
 private ExitConditionException NotifyLifecycleEvent(LifecycleEventType eventType)
 {
     ExitConditionException pendingInterruption = null;
     try
     {
         switch (eventType)
         {
             case LifecycleEventType.ClockCycle:
                 if (ClockCycle != null)
                 {
                     ClockCycle(this, new InternalState(this), eventType);
                 }
                 break;
         }
     }
     catch (ExitConditionException e)
     {
         pendingInterruption = e;
     }
     return pendingInterruption;
 }
 /// <summary>
 /// This method is called when lifecycle event occurs.
 /// </summary>
 /// <param name="evt">Lifecycle event.</param>
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     // No-op.
 }
示例#18
0
 public void OnLifecycleEvent(LifecycleEventType evt)
 {
     throw new ArithmeticException("Failure in bean");
 }
示例#19
0
 public ExitConditionException(IExitCondition exitCondition, InternalState internalState, LifecycleEventType eventType)
 {
     this.ExitCondition = exitCondition;
     this.InternalState = internalState;
     this.EventType     = eventType;
 }
 public ExitConditionException(IExitCondition exitCondition, InternalState internalState, LifecycleEventType eventType)
 {
     this.ExitCondition = exitCondition;
     this.InternalState = internalState;
     this.EventType = eventType;
 }
示例#21
0
 public static LifecycleEventData Create(LifecycleEventType lifecycleEventType) =>
 new LifecycleEventData(lifecycleEventType);
示例#22
0
        /** <inheritDoc /> */
        public void OnLifecycleEvent(LifecycleEventType evtType)
        {
            if (LifecycleTest.ThrowErr)
                throw new Exception("Lifecycle exception.");

            Event evt = new Event();

            evt.Grid1 = Grid1;
            evt.Grid2 = Grid2;
            evt.Prop1 = Property1;
            evt.Prop2 = Property2;

            switch (evtType)
            {
                case LifecycleEventType.BeforeNodeStart:
                    LifecycleTest.BeforeStartEvts.Add(evt);

                    break;

                case LifecycleEventType.AfterNodeStart:
                    LifecycleTest.AfterStartEvts.Add(evt);

                    break;

                case LifecycleEventType.BeforeNodeStop:
                    LifecycleTest.BeforeStopEvts.Add(evt);

                    break;

                case LifecycleEventType.AfterNodeStop:
                    LifecycleTest.AfterStopEvts.Add(evt);

                    break;
            }
        }
示例#23
0
        /** <inheritdoc /> */
        public void OnLifecycleEvent(LifecycleEventType evt)
        {
            if (evt == LifecycleEventType.AfterNodeStop)
            {
                _isStopping = true;

                Stop();
            }
        }
示例#24
0
 private LifecycleEventData(LifecycleEventType eventType)
 {
     EventType = eventType;
 }