DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦aaf314ce3⟧ TextFile

    Length: 4219 (0x107b)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Behavior_Defs;
with Bounded_String_Generic;
with Identifier;
with Method;
with Message;
with Message_Transport;
with Parameter;
with Server;
with Signature;
with Text_Io;

use Text_Io;
package body Log_Server is

    procedure Publish (Self : Identifier.Object);

    procedure Process_Message (Message : Standard.Message.Object);


    package S is new Server (Publish, Process_Message);

    package Bs is new Bounded_String_Generic (256);

    Display : Bs.Variable_String;


    procedure Publish (Self : Identifier.Object) is
        Status : Message_Transport.Status_Code;
        use Message_Transport;
    begin
        Behavior_Defs.Send_Message
           (Message => Standard.Message.Create
                          (Class => Standard.Message.Publication,
                           Addressee => Identifier.Hash (Identifier.Broker),
                           Sender => Identifier.Hash (S.Get_Identity),
                           Method => "log_server",
                           Parameter1_Name => "display",
                           Parameter1_Class => "string",
                           Parameter1_Value => Bs.Image (Display),
                           Parameter2_Name => "identifier",
                           Parameter2_Class => "string",
                           Parameter2_Value => Parameter.Void),
            Status => Status);

        if Status = Ok then
            Put_Line ("+++ Publication of class successful");
        else
            Put_Line ("*** Publication of class failed");
        end if;

        Behavior_Defs.Send_Message
           (Message => Standard.Message.Create
                          (Class => Standard.Message.Publication,
                           Addressee => Identifier.Hash (Identifier.Broker),
                           Sender => Identifier.Hash (S.Get_Identity),
                           Method => "log_line",
                           Parameter_Name => "message",
                           Parameter_Class => "string",
                           Parameter_Value => Parameter.Void),
            Status => Status);

        if Status = Ok then
            Put_Line ("+++ Publication successful");
        else
            Put_Line ("*** Publication failed");
        end if;

    end Publish;


    procedure Process_Message (Message : Standard.Message.Object) is
        Met : Method.Object := Standard.Message.Get_Method (Message);
        Sig : Signature.Object := Method.Get_Signature (Met);
        Iter : Signature.Iterator;
        Par : Parameter.Object;

        Status : Message_Transport.Status_Code;

        use Message_Transport;
    begin
        if Method.Get_Name (Met) = "LOG_LINE" then
            Signature.Init (Iter, Sig);
            Par := Signature.Value (Iter);
            Put_Line (Parameter.Get_Value (Par));

        elsif Method.Get_Name (Met) = "LOG_SERVER" then

            Put_Line ("processing log_server:");

            Behavior_Defs.Send_Message
               (Message =>
                   Standard.Message.Create
                      (Class => Standard.Message.Forward,
                       Addressee => Standard.Message.Get_Sender (Message),
                       Sender => Identifier.Hash (S.Get_Identity),
                       Method => "log_server",
                       Parameter1_Name => "display",
                       Parameter1_Class => "string",
                       Parameter1_Value => Bs.Image (Display),
                       Parameter2_Name => "identifier",
                       Parameter2_Class => "string",
                       Parameter2_Value =>
                          Integer'Image (Identifier.Hash (S.Get_Identity))),
                Status => Status);

            if Status = Ok then
                Put_Line ("+++ identity forwarded");
            else
                Put_Line ("*** failed to forward identity");
            end if;

        else
            Put_Line ("unknown message");
        end if;

    end Process_Message;


    procedure Start (Display : String := "") is
    begin
        Put_Line ("+++ starting log on display => " & Display);

        Log_Server.Display := Bs.Value (Display);
        S.Start;
    end Start;
end Log_Server;