pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /work/a/ports/net/polyorb/work/polyorb-2.9.0/idls/cos/notification/CosNotifyChannelAdmin.idl
--  by IAC (IDL to Ada Compiler) 2.9.0 (rev. unknown).
---------------------------------------------------
--  NOTE: If you modify this file by hand, your
--  changes will be lost when you re-run the
--  IDL to Ada compiler.
---------------------------------------------------

with CosNotifyChannelAdmin.EventChannelFactory.Impl;
with CosNotification;
with CORBA;
pragma Elaborate_All (CORBA);
with CosNotification.Helper;
with PolyORB.Any;
with CORBA.NVList;
with CosNotifyChannelAdmin.Helper;
with CosNotifyChannelAdmin.EventChannel;
with CORBA.Object.Helper;
with CORBA.Object;
with CosNotifyChannelAdmin.EventChannel.Helper;
with CORBA.ServerRequest;
with PolyORB.CORBA_P.IR_Hooks;
with PolyORB.CORBA_P.Domain_Management;
with CosNotifyChannelAdmin_EventChannelFactory_Hash;
with PolyORB.Std;
with PortableServer;
with CORBA.ORB;
with PolyORB.CORBA_P.Exceptions;
with PolyORB.Qos.Exception_Informations;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CosNotifyChannelAdmin.EventChannelFactory.Skel is

   create_channel_Arg_Name_initial_qos_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("initial_qos");

   create_channel_Arg_Name_initial_admin_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("initial_admin");

   create_channel_Arg_Name_id_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("id");

   get_event_channel_Arg_Name_id_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("id");

   N_Operations : constant PolyORB.Std.Natural :=
     8;

   type String_Ptr is
     access PolyORB.Std.String;

   Invoke_Db : array (0 .. (N_Operations
      - 1)) of String_Ptr :=
     (others => null);

   procedure Register_Procedure
     (Operation_Name : PolyORB.Std.String);

   ------------------------
   -- Register_Procedure --
   ------------------------

   procedure Register_Procedure
     (Operation_Name : PolyORB.Std.String)
   is
      Index_Ü : PolyORB.Std.Natural;
      Invoke_Name_Access : String_Ptr;
   begin
      Index_Ü :=
        CosNotifyChannelAdmin_EventChannelFactory_Hash.Hash
           (Operation_Name);
      if (Invoke_Db
        (Index_Ü)
         /= null)
      then
         raise Program_Error;
      end if;
      Invoke_Name_Access :=
        new PolyORB.Std.String'
           (Operation_Name);
      Invoke_Db
        (Index_Ü) :=
        Invoke_Name_Access;
   end Register_Procedure;

   procedure Invoke
     (Self : PortableServer.Servant;
      Request : CORBA.ServerRequest.Object_Ptr);

   ------------
   -- Invoke --
   ------------

   procedure Invoke
     (Self : PortableServer.Servant;
      Request : CORBA.ServerRequest.Object_Ptr)
   is
      Operation_Ü : constant PolyORB.Std.String :=
        CORBA.To_Standard_String
           (CORBA.ServerRequest.Operation
              (Request.all));
      Argument_List_Ü : CORBA.NVList.Ref;
      Index_Ü : PolyORB.Std.Natural;
      Invoke_Name_Access : String_Ptr;

      procedure Invoke_create_channel;

      ---------------------------
      -- Invoke_create_channel --
      ---------------------------

      procedure Invoke_create_channel is
         Argument_initial_qos_Ü : CosNotification.QoSProperties;
         pragma Warnings (Off, Argument_initial_qos_Ü);
         pragma Suppress (Validity_Check, Argument_initial_qos_Ü);
         Arg_CC_initial_qos_Ü : aliased PolyORB.Any.Content'Class :=
           CosNotification.Helper.Internals.Wrap
              (CosNotification.IDL_SEQUENCE_CosNotification_Property.Sequence
                 (Argument_initial_qos_Ü)'Unrestricted_Access);
         Arg_Any_initial_qos_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotification.Helper.TC_QoSProperties,
               Arg_CC_initial_qos_Ü'Unchecked_Access);
         Argument_initial_admin_Ü : CosNotification.AdminProperties;
         pragma Warnings (Off, Argument_initial_admin_Ü);
         pragma Suppress (Validity_Check, Argument_initial_admin_Ü);
         Arg_CC_initial_admin_Ü : aliased PolyORB.Any.Content'Class :=
           CosNotification.Helper.Internals.Wrap
              (CosNotification.IDL_SEQUENCE_CosNotification_Property.Sequence
                 (Argument_initial_admin_Ü)'Unrestricted_Access);
         Arg_Any_initial_admin_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotification.Helper.TC_AdminProperties,
               Arg_CC_initial_admin_Ü'Unchecked_Access);
         Argument_id_Ü : CosNotifyChannelAdmin.ChannelID;
         pragma Warnings (Off, Argument_id_Ü);
         pragma Suppress (Validity_Check, Argument_id_Ü);
         Arg_CC_id_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Wrap
              (CORBA.Long
                 (Argument_id_Ü)'Unrestricted_Access);
         Arg_Any_id_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotifyChannelAdmin.Helper.TC_ChannelID,
               Arg_CC_id_Ü'Unchecked_Access);
         Result_Ü : CosNotifyChannelAdmin.EventChannel.Ref;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Object.Helper.Wrap
              (CORBA.Object.Ref
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotifyChannelAdmin.EventChannel.Helper.TC_EventChannel,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            create_channel_Arg_Name_initial_qos_Ü,
            Arg_Any_initial_qos_Ü,
            CORBA.ARG_IN);
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            create_channel_Arg_Name_initial_admin_Ü,
            Arg_Any_initial_admin_Ü,
            CORBA.ARG_IN);
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            create_channel_Arg_Name_id_Ü,
            Arg_Any_id_Ü,
            CORBA.ARG_OUT);
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         begin
            --  Call Implementation
            CosNotifyChannelAdmin.EventChannelFactory.Impl.create_channel
              (CosNotifyChannelAdmin.EventChannelFactory.Impl.Object'Class
                 (Self.all)'Access,
               Argument_initial_qos_Ü,
               Argument_initial_admin_Ü,
               Argument_id_Ü,
               Result_Ü);
         exception
            when E : CosNotification.UnsupportedQoS =>
               declare
                  Members : CosNotification.UnsupportedQoS_Members;
               begin
                  CosNotification.Get_Members
                    (E,
                     Members);
                  CORBA.ServerRequest.Set_Exception
                    (Request,
                     CosNotification.Helper.To_Any
                       (Members));
                  return;
               end;
            when E : CosNotification.UnsupportedAdmin =>
               declare
                  Members : CosNotification.UnsupportedAdmin_Members;
               begin
                  CosNotification.Get_Members
                    (E,
                     Members);
                  CORBA.ServerRequest.Set_Exception
                    (Request,
                     CosNotification.Helper.To_Any
                       (Members));
                  return;
               end;
         end;
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_create_channel;

      procedure Invoke_get_all_channels;

      -----------------------------
      -- Invoke_get_all_channels --
      -----------------------------

      procedure Invoke_get_all_channels is
         Result_Ü : CosNotifyChannelAdmin.ChannelIDSeq;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CosNotifyChannelAdmin.Helper.Internals.Wrap
              (CosNotifyChannelAdmin.IDL_SEQUENCE_CosNotifyChannelAdmin_ChannelID.Sequence
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotifyChannelAdmin.Helper.TC_ChannelIDSeq,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosNotifyChannelAdmin.EventChannelFactory.Impl.get_all_channels
              (CosNotifyChannelAdmin.EventChannelFactory.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_get_all_channels;

      procedure Invoke_get_event_channel;

      ------------------------------
      -- Invoke_get_event_channel --
      ------------------------------

      procedure Invoke_get_event_channel is
         Argument_id_Ü : CosNotifyChannelAdmin.ChannelID;
         pragma Warnings (Off, Argument_id_Ü);
         pragma Suppress (Validity_Check, Argument_id_Ü);
         Arg_CC_id_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Wrap
              (CORBA.Long
                 (Argument_id_Ü)'Unrestricted_Access);
         Arg_Any_id_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotifyChannelAdmin.Helper.TC_ChannelID,
               Arg_CC_id_Ü'Unchecked_Access);
         Result_Ü : CosNotifyChannelAdmin.EventChannel.Ref;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Object.Helper.Wrap
              (CORBA.Object.Ref
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosNotifyChannelAdmin.EventChannel.Helper.TC_EventChannel,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            get_event_channel_Arg_Name_id_Ü,
            Arg_Any_id_Ü,
            CORBA.ARG_IN);
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         begin
            --  Call Implementation
            Result_Ü :=
              CosNotifyChannelAdmin.EventChannelFactory.Impl.get_event_channel
                 (CosNotifyChannelAdmin.EventChannelFactory.Impl.Object'Class
                    (Self.all)'Access,
                  Argument_id_Ü);
         exception
            when E : CosNotifyChannelAdmin.ChannelNotFound =>
               declare
                  Members : CosNotifyChannelAdmin.ChannelNotFound_Members;
               begin
                  CosNotifyChannelAdmin.Get_Members
                    (E,
                     Members);
                  CORBA.ServerRequest.Set_Exception
                    (Request,
                     CosNotifyChannelAdmin.Helper.To_Any
                       (Members));
                  return;
               end;
         end;
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_get_event_channel;

      procedure Invoke_Uis_a;

      ------------------
      -- Invoke_Uis_a --
      ------------------

      procedure Invoke_Uis_a is
         Type_Id_Ü : CORBA.String;
         Arg_Name_Type_Id_Ü : constant CORBA.Identifier :=
           CORBA.To_CORBA_String
              ("Type_Id_Ü");
         Argument_Type_Id_Ü : constant CORBA.Any :=
           CORBA.To_Any
              (Type_Id_Ü);
         Result_Ü : CORBA.Boolean;
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            Arg_Name_Type_Id_Ü,
            Argument_Type_Id_Ü,
            CORBA.ARG_IN);
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         Type_Id_Ü :=
           CORBA.From_Any
              (Argument_Type_Id_Ü);
         Result_Ü :=
           Is_A
              (CORBA.To_Standard_String
                 (Type_Id_Ü));
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.To_Any
              (Result_Ü));
      end Invoke_Uis_a;

      procedure Invoke_Uinterface;

      -----------------------
      -- Invoke_Uinterface --
      -----------------------

      procedure Invoke_Uinterface is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.Object.Helper.To_Any
              (CORBA.Object.Ref
                 (PolyORB.CORBA_P.IR_Hooks.Get_Interface_Definition
                    (CORBA.To_CORBA_String
                       (Repository_Id)))));
      end Invoke_Uinterface;

      procedure Invoke_Udomain_managers;

      -----------------------------
      -- Invoke_Udomain_managers --
      -----------------------------

      procedure Invoke_Udomain_managers is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            PolyORB.CORBA_P.Domain_Management.Get_Domain_Managers
              (Self));
      end Invoke_Udomain_managers;

      procedure Invoke_Unon_existent;

      --------------------------
      -- Invoke_Unon_existent --
      --------------------------

      procedure Invoke_Unon_existent is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.To_Any
              (CORBA.Boolean'
                 (False)));
      end Invoke_Unon_existent;

      procedure Dispatch;

      --------------
      -- Dispatch --
      --------------

      procedure Dispatch is
      begin
         case Index_Ü is
            when 0 =>
               Invoke_create_channel;
            when 1 =>
               Invoke_get_all_channels;
            when 2 =>
               Invoke_get_event_channel;
            when 4 =>
               Invoke_Uinterface;
            when 5 =>
               Invoke_Udomain_managers;
            when 6
               | 7 =>
               Invoke_Unon_existent;
            when 3 =>
               Invoke_Uis_a;
            pragma Warnings (Off);
            when others =>
               raise Program_Error;
            pragma Warnings (On);

         end case;
      end Dispatch;

   begin
      CORBA.ORB.Create_List
        (0,
         Argument_List_Ü);
      Index_Ü :=
        CosNotifyChannelAdmin_EventChannelFactory_Hash.Hash
           (Operation_Ü);
      Invoke_Name_Access :=
        Invoke_Db
           (Index_Ü);
      begin
         if (Operation_Ü
            = Invoke_Name_Access.all)
         then
            Dispatch;
         else
            CORBA.Raise_Bad_Operation
              (CORBA.Default_Sys_Member);
         end if;
      exception
         when E : others =>
            CORBA.ServerRequest.Set_Exception
              (Request,
               PolyORB.CORBA_P.Exceptions.System_Exception_To_Any
                 (E));
            PolyORB.Qos.Exception_Informations.Set_Exception_Information
              (Request.all,
               E);
      end;
   end Invoke;

   function Servant_Is_A
     (Obj : PortableServer.Servant)
     return Boolean;

   ------------------
   -- Servant_Is_A --
   ------------------

   function Servant_Is_A
     (Obj : PortableServer.Servant)
     return Boolean
   is
   begin
      return (Obj.all
         in CosNotifyChannelAdmin.EventChannelFactory.Impl.Object'Class);
   end Servant_Is_A;

   -----------------------------
   -- Deferred_Initialization --
   -----------------------------

   procedure Deferred_Initialization is
   begin
      PortableServer.Internals.Register_Skeleton
        (CosNotifyChannelAdmin.EventChannelFactory.Repository_Id,
         Servant_Is_A'Access,
         Is_A'Access,
         Invoke'Access);
      Register_Procedure
        ("create_channel");
      Register_Procedure
        ("get_all_channels");
      Register_Procedure
        ("get_event_channel");
      Register_Procedure
        ("_is_a");
      Register_Procedure
        ("_interface");
      Register_Procedure
        ("_domain_managers");
      Register_Procedure
        ("_non_existent");
      Register_Procedure
        ("_not_existent");
   end Deferred_Initialization;

begin
   declare
      use PolyORB.Utils.Strings;
      use PolyORB.Utils.Strings.Lists;
   begin
      PolyORB.Initialization.Register_Module
        (PolyORB.Initialization.Module_Info'
           (Name => +"CosNotifyChannelAdmin.EventChannelFactory.Skel",
            Conflicts => PolyORB.Utils.Strings.Lists.Empty,
            Depends => PolyORB.Utils.Strings.Lists.Empty,
            Provides => PolyORB.Utils.Strings.Lists.Empty,
            Implicit => False,
            Init => Deferred_Initialization'Access,
            Shutdown => null));
   end;
end CosNotifyChannelAdmin.EventChannelFactory.Skel;
