Example #1
0
 public void ReceiveTransition(ReportIdentification msg, Receive.Body.ReceiveRec transportData)
 {
     transition_ = "ReceiveTransition";
     State.ReceiveTransition(this, msg, transportData);
     transition_ = "";
     return;
 }
Example #2
0
        public ReportIdentification setAs(ReportIdentification value)
        {
            m_MsgHeader = value.m_MsgHeader;
            m_Body      = value.m_Body;

            return(this);
        }
Example #3
0
        public ReportIdentification(ReportIdentification value)
        {
            /// Initiliaze the protected variables
            m_MsgHeader = new MsgHeader();
            m_Body      = new Body();
            m_IsCommand = false;

            /// Copy the values
            m_MsgHeader = value.m_MsgHeader;
            m_Body      = value.m_Body;
        }
Example #4
0
        public bool  isEqual(ReportIdentification value)
        {
            if (!this.getMsgHeader().isEqual(value.getMsgHeader()))
            {
                return(false);
            }
            if (!this.getBody().isEqual(value.getBody()))
            {
                return(false);
            }

            return(true);
        }
Example #5
0
 public virtual void handleMessageAction(ReportIdentification msg, Receive.Body.ReceiveRec transportData)
 {
     // Since we found a discovery service, register our local services
     registerServicesAction(transportData);
 }
Example #6
0
                protected internal override void ReceiveTransition(DiscoveryClient_ReceiveFSMContext context, ReportIdentification msg, Receive.Body.ReceiveRec transportData)
                {
                    DiscoveryClient_ReceiveFSM ctxt = context.Owner;


#if TRACE
                    Trace.WriteLine(
                        "LEAVING STATE   : DiscoveryClient_ReceiveFSM_SM.Receiving_Ready");
#endif

                    DiscoveryClient_ReceiveFSMState endState = context.State;

#if TRACE
                    Trace.WriteLine(
                        "ENTER TRANSITION: DiscoveryClient_ReceiveFSM_SM.DiscoveryClient_ReceiveFSM_SM.Receiving_Ready.ReceiveTransition(, ReportIdentification msg, Receive.Body.ReceiveRec transportData)");
#endif

                    context.ClearState();

                    try
                    {
                        ctxt.handleMessageAction(msg, transportData);
                    }
                    finally
                    {
#if TRACE
                        Trace.WriteLine(
                            "EXIT TRANSITION : DiscoveryClient_ReceiveFSM_SM.DiscoveryClient_ReceiveFSM_SM.Receiving_Ready.ReceiveTransition(, ReportIdentification msg, Receive.Body.ReceiveRec transportData)");
#endif

                        context.State = endState;
                    }

                    return;
                }
Example #7
0
 protected internal virtual void ReceiveTransition(DiscoveryClient_ReceiveFSMContext context, ReportIdentification msg, Receive.Body.ReceiveRec transportData)
 {
     Default(context);
 }
Example #8
0
 public bool  notEquals(ReportIdentification value)
 {
     return(!this.isEqual(value));
 }
Example #9
0
        //	This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

            // Since this function can be called from multiple threads,
            // we use a mutex to ensure only one state transition is
            // active at a time.
            mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new ReportHeartbeatPulse().getID())
                    {
                        ReportHeartbeatPulse msg = new ReportHeartbeatPulse();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new ReportServices().getID())
                    {
                        ReportServices msg = new ReportServices();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new ReportIdentification().getID())
                    {
                        ReportIdentification msg = new ReportIdentification();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new GrantNodeID().getID())
                    {
                        GrantNodeID msg = new GrantNodeID();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        Receive.Body.ReceiveRec transportData = casted_ie.getBody().getReceiveRec();
                        pDiscoveryClient_ReceiveFSM.context.ReceiveTransition(msg, transportData);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("RHP_Timeout") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    RHP_Timeout casted_ie = (RHP_Timeout)ie;
                    pDiscoveryClient_ReceiveFSM.context.RHP_TimeoutTransition();
                    done = true;
                }
            } catch (Exception e) {}



            mutex.ReleaseMutex();
            return(done);
        }