Esempio n. 1
0
    protected void sendMessage(JTS.Message msg, Inheritence1_csharp dest)
    {
        // First encode the message
        uint bufsize = (uint)msg.getSize();

        byte[] buffer = new byte[bufsize];
        int    pos    = 0;

        msg.encode(buffer, pos);

        // To inject a message directly into the component, we need
        // to wrap it in a receive event and spoof the source.
        JTS.Receive ie = new JTS.Receive();
        ie.getBody().getReceiveRec().getMessagePayload().set(bufsize, buffer);
        ie.getBody().getReceiveRec().setSrcSubsystemID(160);
        ie.getBody().getReceiveRec().setSrcNodeID(1);
        ie.getBody().getReceiveRec().setSrcComponentID(1);

        // Now wedge the event into the component...
        dest.processInternalEvent(ie);

        // Sleep for a bit to let the event percolate through...
        Thread.Sleep(500);
    }
Esempio n. 2
0
			if (layer == 1) return ((urn_org_jts_test_Intermediary_1_0.IntermediaryService) serviceList[layer]).pIntermediary_Parent1FSM.context.State.Name;
			if (layer == 2) return ((urn_org_jts_test_Child_1_0.ChildService) serviceList[layer]).pChild_Parent1FSM.context.State.Name;
			return "";
		}