home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / somoa.idl < prev    next >
Text File  |  1996-12-24  |  7KB  |  190 lines

  1. /*
  2.  *    @(#) 2.9.1.43 src/somd/somoa.idl, somd, som3.0 9/26/96 14:02:23 [12/24/96 07:39:40]
  3.  */
  4. //
  5. //   COMPONENT_NAME: somd
  6. //
  7. //   ORIGINS: 27
  8. //
  9. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996
  10. //   All Rights Reserved
  11. //   Licensed Materials - Property of IBM
  12. //   US Government Users Restricted Rights - Use, duplication or
  13. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. //
  15.  
  16. //#  SOMOA is a PUBLIC class derived from BOA.
  17. //
  18. //  SOMOA is DSOM's primary Object Adapter.  It implements and extends the
  19. //  BOA interface.  SOMOA is the main interface between the server
  20. //  applications and the DSOM run time.  SOMOA handles all communications
  21. //  and interpretation of inbound requests and outbound results.  SOMOA
  22. //  works together with the SOMDServer (or subclass) to create and resolve
  23. //  DSOM references to local objects and to dispatch methods on objects.
  24.  
  25.  
  26. #ifndef somoa_idl
  27. #define somoa_idl
  28.  
  29. #include <somdtype.idl>
  30. #include <unotypes.idl>
  31. #include <boa.idl>
  32.  
  33.  
  34.  
  35. interface SOMOA : BOA
  36. {
  37.  
  38.   ORBStatus execute_next_request(in Flags waitFlag);
  39.  
  40.   // This method receives a single request message, executes it, and
  41.   // sends the result to the calling client.  If waitFlag is SOMD_WAIT,
  42.   // the call will block if there is no message pending.  If waitFlag
  43.   // is SOMD_NO_WAIT, the call will immediately return "SOMDERROR_NoMessages"
  44.   // if there is no message pending.
  45.   //
  46.   // ("SOMDERROR_NoMessage" is only returned as a status code, not as an
  47.   // exception structure.)
  48.  
  49.   ORBStatus execute_request_loop(in Flags waitFlag);
  50.  
  51.   // Repeatedly calls execute_next_request.  If waitFlag is SOMD_WAIT,
  52.   // the call will continue to wait for messages when there is no message
  53.   // pending.  If waitFlag is SOMD_NO_WAIT, the call will process any
  54.   // messages that are present, and return "SOMD_NoMessages" as soon as there
  55.   // are no more messages pending.
  56.   //
  57.   // ("SOMDERROR_NoMessage" is only returned as a status code, not as an
  58.   // exception structure.)
  59.  
  60.   void change_id(in SOMDObject objref, in ReferenceData id);
  61.  
  62.   // This method changes the ReferenceData associated with the object
  63.   // identified by "objref".  The ReferenceData previously stored in the
  64.   // Object Registry is replaced with the value of "id".  The new id value
  65.   // cannot be larger than the maximum size of the original ReferenceData
  66.   // (usually specified as 1024 bytes).
  67.  
  68.   SOMDObject create_constant(in ReferenceData id, in InterfaceDef intf,
  69.                              in ImplementationDef impl);
  70.  
  71.   // This method is a variant of the "create" method.  Like "create", it
  72.   // creates an object reference for an object (with the specified interface)
  73.   // and associates the supplied ReferenceData with the object reference.
  74.   // The ReferenceData can later be retrieved using the "get_id" method.
  75.   // Unlike "create", this method creates a "contant" reference whose id
  76.   // value cannot be changed.  (See "change_id" below.)  This is because
  77.   // the id is part of the object reference state, versus stored in the
  78.   // Object Registry.
  79.   //
  80.   // This method would be used whenever the application prefers not to
  81.   // maintain an object's ReferenceData in the Object Registry.
  82.  
  83.   SOMDObject create_SOM_ref(in SOMObject somobj, in ImplementationDef impl);
  84.  
  85.   // This methods creates a simple DSOM reference (SOMDObject) for a local
  86.   // SOM object.  The reference is "special" in that there is no explicit
  87.   // ReferenceData associated with the object.  Also, the reference is
  88.   // only valid while the SOM object exists.
  89.   //
  90.   // The SOMObject can be retrieved via the get_SOM_object method.
  91.   // The SOMDObject::is_SOM_ref method can be used to tell if the
  92.   // reference was created using create_SOM_ref or not.
  93.  
  94.   SOMObject get_SOM_object(in SOMDObject somref);
  95.  
  96.   // This method returns the SOM object associated with a SOMDObject
  97.   // reference created by the create_SOM_ref method.
  98.  
  99.   void activate_impl_failed(in ImplementationDef impl, in ORBStatus rc);
  100.  
  101.   // Indicates there was an error when activating this implementation.
  102.   // Called by a server program.  ORBStatus code is returned to the client
  103.   // in an exception.
  104.  
  105.   void interrupt_server();
  106.  
  107.   // Wakes up a server waiting for a request message.  Responsibility
  108.   // of caller to ensure that the server is finished processing requests
  109.   // before invoking this method.
  110.  
  111.   IIOP::SOMDServiceContextList get_service_contexts(in SOMDObject obj);
  112.  
  113.   // Returns the sequence of service contexts associated with a request.
  114.  
  115.  
  116. #ifdef __SOMIDL__
  117.  
  118.   implementation
  119.   {
  120.     releaseorder: execute_next_request, execute_request_loop,
  121.                   create_constant, change_id,
  122.                   create_SOM_ref, get_SOM_object,
  123.                   activate_impl_failed, interrupt_server,
  124.                   private1, get_service_contexts,
  125.                   private2, private3;
  126.  
  127.     //# Class Modifiers
  128.     callstyle = idl;
  129.     dllname = "somd.dll";
  130.     majorversion = 2;
  131.     minorversion = 2;
  132.  
  133.     //# Method Modifiers
  134.     somDefaultInit: override;
  135.     somDestruct: override;
  136.     create: override;
  137.     dispose: override;
  138.     get_id: override;
  139.     get_principal: override;
  140.     set_exception: override;
  141.     impl_is_ready: override;
  142.     deactivate_impl: override;
  143.     change_implementation: override;
  144.     obj_is_ready: override;
  145.     deactivate_obj: override;
  146.  
  147.     //# Passthrus
  148.     #define COMMON_SOMOA_H_PASSTHRU \
  149.       "" \
  150.       "#define SOMD_WAIT     1" \
  151.       "#define SOMD_NO_WAIT  0" \
  152.       "#define SOMD_IMPL_NOT_INITIALIZED          0" \
  153.       "#define SOMD_IMPL_NOT_ACTIVE               1" \
  154.       "#define SOMD_IMPL_ACTIVE                   2" \
  155.       ""
  156.     passthru C_h_after  = COMMON_SOMOA_H_PASSTHRU
  157.         "#ifndef SOM_IMPORTEXPORT_somd"
  158.         "#if defined(_WIN32) && !defined(SOM_DLL_somd)"
  159.             "#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT"
  160.         "#else"
  161.             "#define SOM_IMPORTEXPORT_somd"
  162.         "#endif"
  163.         "#endif"
  164.       "#ifdef SOM_STRICT_IDL"
  165.       "SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA   SOMDLINK SOMD_SOMOAObject;"
  166.       "#else"
  167.       "SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA *  SOMDLINK SOMD_SOMOAObject;"
  168.       "#endif"
  169.       "";
  170.  
  171.     passthru C_xh_after = COMMON_SOMOA_H_PASSTHRU
  172.       "class SOMOA;"
  173.         "#ifndef SOM_IMPORTEXPORT_somd"
  174.         "#if defined(_WIN32) && !defined(SOM_DLL_somd)"
  175.             "#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT"
  176.         "#else"
  177.             "#define SOM_IMPORTEXPORT_somd"
  178.         "#endif"
  179.         "#endif"
  180.       "SOMEXTERN SOM_IMPORTEXPORT_somd SOMOA * SOMDLINK SOMD_SOMOAObject;"
  181.       "";
  182.  
  183.   };
  184.  
  185. #endif /* __SOMIDL__ */
  186.  
  187. };
  188.  
  189. #endif  /* somoa_idl */
  190.