DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3bdf18a1b⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Broker, seg_0525c3

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Database;
with Identifier;
with Message;
with Message_Transport;
with Method;
with Text_Io;

use Text_Io;
package body Broker is

    procedure Process_Message (M : String);


    procedure Register (Host : String; Socket : Message_Transport.Socket);

    task Rx is
        entry Start;
    end Rx;

    function Stub (M : String) return Boolean is
    begin
        return True;
    end Stub;

    procedure Stub is
    begin
        null;
    end Stub;


    procedure Transport_Start is
       new Message_Transport.Start_Server (Register_Service => Register,
                                           Service_Identified => Stub,
                                           Ready_To_Receive => Stub,
                                           Receive_Callback => Process_Message);


    procedure Send_Message (Message : Standard.Message.Object) is
        Status : Message_Transport.Status_Code;
        Id : Identifier.Object := Identifier.Value
                                     (Standard.Message.Get_Addressee (Message));
        use Standard.Message;
    begin
        Message_Transport.Put (Message => Standard.Message.Image (Message),
                               Remote_Host => Identifier.Get_Host (Id),
                               Remote_Socket => Identifier.Get_Socket (Id),
                               Number_Of_Retry => 10,
                               Retry_Delay => 0.1,
                               Status => Status);
    end Send_Message;


    task body Rx is
    begin
        accept Start;
        Transport_Start (Local_Socket =>
                            Identifier.Get_Socket (Id => Identifier.Broker),
                         Buffer_Size => 1024,
                         Wait_For_Identification => False);
    end Rx;


    procedure Start is
    begin
        Rx.Start;
    end Start;


    procedure Register (Host : String; Socket : Message_Transport.Socket) is
    begin  
        Text_Io.Put_Line ("+++ starting broker");
        Text_Io.Put_Line ("--- Host => " & Host);
        Text_Io.Put_Line ("--- socket => " &
                          Integer'Image (Integer ((Socket))));
    end Register;


    procedure Stale (Behavior : Natural) is
    begin
        --[prototype: This simply removes the behavior]
        Database.Expunge (Behavior);
        Identifier.Unregister (Id => Identifier.Value (Behavior));
    end Stale;


    procedure Registration (M : Message.Object) is separate;

    procedure Unregistration (M : in out Message.Object) is separate;

    procedure Query (M : Message.Object) is separate;

    procedure Request (M : Message.Object) is separate;

    procedure Notification (M : Message.Object) is separate;

    procedure Forward (M : Message.Object) is separate;

    procedure Publication (M : Message.Object) is separate;

    procedure Unpublication (M : Message.Object) is separate;

    procedure Subscription (M : Message.Object) is separate;

    procedure Unsubscription (M : Message.Object) is separate;


    procedure Process_Message (M : String) is
        use Message;

        Mes : Message.Object;
    begin
        Mes := Message.Value (M);
        case Message.Get_Class (Mes) is
            when Registration =>
                Registration (Mes);
            when Unregistration =>
                Unregistration (Mes);
            when Message.Query =>
                Query (Mes);
            when Message.Request =>
                Request (Mes);
            when Message.Notification =>
                Notification (Mes);
            when Message.Forward =>
                Forward (Mes);
            when Message.Publication =>
                Publication (Mes);
            when Message.Unpublication =>
                Unpublication (Mes);
            when Message.Subscription =>
                Subscription (Mes);
            when Message.Unsubscription =>
                Unsubscription (Mes);
        end case;
    end Process_Message;

end Broker;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=28 rec1=00 rec2=01 rec3=05e
        [0x01] rec0=1e rec1=00 rec2=02 rec3=034
        [0x02] rec0=1f rec1=00 rec2=04 rec3=00a
        [0x03] rec0=1e rec1=00 rec2=05 rec3=028
        [0x04] rec0=08 rec1=00 rec2=03 rec3=000
    tail 0x2154baf7287a07327e4fc 0x42a00088462060003