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 - download
Index: ┃ B T

⟦cd0e3048f⟧ TextFile

    Length: 4379 (0x111b)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦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_Exception;
with Identifier;
with Message;
with Method;
with Signature;
with Parameter;

package body Behavior_Defs is


    procedure Register_Service (Host : String;
                                Socket : Message_Transport.Socket) is
        Status : Message_Transport.Status_Code;

        use Message_Transport;
    begin
        Message_Transport.Put
           (Message => Standard.Message.Image
                          (Message.Create
                              (Class => Message.Registration,
                               Addressee => Identifier.Hash (Identifier.Broker),
                               Sender => Identifier.Hash (Identifier.Nil),
                               Method => "registration",
                               Parameter1_Name => "host",
                               Parameter1_Class => "string",
                               Parameter1_Value => Host,
                               Parameter2_Name => "socket",
                               Parameter2_Class => "string",
                               Parameter2_Value =>
                                  Message_Transport.Socket'Image (Socket))),

            Remote_Host => Identifier.Get_Host (Identifier.Broker),
            Remote_Socket => Identifier.Get_Socket (Identifier.Broker),
            Number_Of_Retry => 10,
            Retry_Delay => 0.1,
            Status => Status);

        if Status /= Message_Transport.Ok then
            raise Behavior_Exception.Not_Registered_Error;
        end if;
    end Register_Service;


    procedure Identify (M : String;
                        Behavior : out Identifier.Object;
                        Registered : out Boolean) is

        Mes : Message.Object;
        Met : Method.Object;
        Sig : Signature.Object;
        Par : Parameter.Object;  
        Iter : Signature.Iterator;
    begin
        Mes := Message.Value (M);

        if not Message."=" (Message.Get_Class (Mes), Message.Notification) then
            Behavior := Identifier.Nil;
            Registered := False;
        end if;


        Met := Message.Get_Method (Mes);

        if Method.Get_Name (Met) /= Behavior_Defs.Identification_Name then
            Behavior := Identifier.Nil;
            Registered := False;
        end if;


        Sig := Method.Get_Signature (Met);

        Signature.Init (Iter, Sig);

        if Signature.Is_Done (Iter) then
            Behavior := Identifier.Nil;
            Registered := False;
        end if;


        Par := Signature.Value (Iter);

        if Parameter.Get_Name (Par) /=
           Behavior_Defs.Identification_Parameter then
            Behavior := Identifier.Nil;
            Registered := False;
        end if;

        if Parameter.Get_Class (Par) /= Behavior_Defs.Identification_Class then
            Behavior := Identifier.Nil;
            Registered := False;
        end if;

        declare
        begin
            Behavior := Identifier.Value (Natural'Value
                                             (Parameter.Get_Value (Par)));
            Registered := True;
        exception
            when others =>
                Behavior := Identifier.Nil;
                Registered := False;
        end;

    end Identify;


    procedure Send_Message (Message : Standard.Message.Object;
                            Status : out Message_Transport.Status_Code) is
        Addressee : Identifier.Object :=
           Identifier.Value (Standard.Message.Get_Addressee (Message));

        use Standard.Message;
    begin

        if Standard.Message.Get_Class (Message) = Standard.Message.Forward then
            Message_Transport.Put
               (Message => Standard.Message.Image (Message),
                Remote_Host => Identifier.Get_Host (Identifier.Broker),
                Remote_Socket => Identifier.Get_Socket (Identifier.Broker),
                Number_Of_Retry => 10,
                Retry_Delay => 0.1,
                Status => Status);

        else
            Message_Transport.Put
               (Message => Standard.Message.Image (Message),
                Remote_Host => Identifier.Get_Host (Addressee),  
                Remote_Socket => Identifier.Get_Socket (Addressee),
                Number_Of_Retry => 10,
                Retry_Delay => 0.1,
                Status => Status);

        end if;

    end Send_Message;

end Behavior_Defs;