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

  1. //
  2. //   COMPONENT_NAME: somnm
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13. //#  @(#) 1.8 src/somnm/naming/naming.idl, somnm, som3.0 12/15/96 18:01:04 [12/24/96 08:00:01]
  14.  
  15.  
  16. #ifndef naming_idl
  17. #define naming_idl
  18.  
  19.  
  20. #include <somobj.idl>
  21.  
  22.  
  23. module CosNaming {
  24.  
  25.  
  26.         typedef string Istring;
  27.         struct NameComponent {
  28.                 Istring id;
  29.                 Istring kind;
  30.         };
  31.         typedef sequence <NameComponent> Name;
  32.         enum BindingType {nobject, ncontext};
  33.         struct Binding {
  34.                 Name binding_name;
  35.                 BindingType binding_type;
  36.         };
  37.         typedef sequence <Binding> BindingList;
  38.  
  39.  
  40.         interface BindingIterator : SOMObject {
  41.  
  42.                 boolean next_one(out Binding b);
  43.                 // returns the next binding. FALSE is returned if
  44.                 // there are no more bindings
  45.  
  46.                 boolean next_n(in unsigned long how_many,
  47.                                 out BindingList bl);
  48.                 // returns at most the "how_many" number of bindings.
  49.                 // Returns FALSE if there are no more bindings
  50.  
  51.                 void destroy();
  52.                 // destroys the iterator
  53.  
  54.  
  55.                 #ifdef __SOMIDL__
  56.                 implementation {
  57.                         functionprefix=BI_;
  58.                         releaseorder: next_one, next_n, destroy;
  59.                         dllname = "somnmf.dll";
  60.                         majorversion = 3;
  61.                         minorversion = 0;
  62.                 };
  63.                 #endif
  64.         };
  65.  
  66.         interface NamingContext : SOMObject {
  67.  
  68.                 enum NotFoundReason {missing_node, not_context, not_object};
  69.  
  70.                 exception NotFound {
  71.                         NotFoundReason why;
  72.                         Name rest_of_name;
  73.                 };
  74.  
  75.                 exception CannotProceed {
  76.                         NamingContext cxt;
  77.                         Name rest_of_name;
  78.                 };
  79.  
  80.                 exception InvalidName {
  81.                         Name name;
  82.                 };
  83.                 exception AlreadyBound { };
  84.                 exception NotEmpty { };
  85.  
  86.                 void bind(in Name n, in SOMObject obj)
  87.                         raises(NotFound, CannotProceed,
  88.                                 InvalidName, AlreadyBound);
  89.                 // creates a binding of a name and an object in
  90.                 // the target naming context. Naming Contexts that are
  91.                 // bound using bind do not participate in name resolution
  92.                 // when compound name resolution is done
  93.  
  94.                 void rebind(in Name n, in SOMObject obj)
  95.                         raises(NotFound, CannotProceed, InvalidName);
  96.                 // creates a binding of the name and an object even if
  97.                 // the name is already bound in the context. Naming
  98.                 // contexts that are bound using rebind do not participate
  99.                 // in name resolution process when compound names are
  100.                 // passed to be resolved.
  101.  
  102.                 void bind_context(in Name n, in NamingContext nc)
  103.                         raises(NotFound, CannotProceed,
  104.                                 InvalidName, AlreadyBound);
  105.                 // binds a naming context to the name. Naming contexts
  106.                 // that are bound using bind_context participate in
  107.                 // name resolution when compound names are resolved
  108.  
  109.                 void rebind_context(in Name n, in NamingContext nc)
  110.                         raises(NotFound, CannotProceed, InvalidName);
  111.                 // creates a binding between a name and a naming context
  112.                 // in the target naming context even if the name is
  113.                 // already bound in the context. Naming contexts that
  114.                 // are bound using rebind_context participate in name
  115.                 // resolution when compound names are resolved
  116.  
  117.                 SOMObject resolve(in Name n)
  118.                         raises(NotFound, CannotProceed, InvalidName);
  119.                 //retrieves an object bound to a name in the context
  120.                 // Since names can be compound, name resolution can
  121.                 // traverse multiple naming contexts
  122.  
  123.                 void unbind(in Name n)
  124.                         raises(NotFound, CannotProceed, InvalidName);
  125.                 // removes a name binding from a context
  126.  
  127.                 NamingContext new_context();
  128.                 // Returns a new naming context in the same process as
  129.                 // the context on which the operation was invoked
  130.                 // The new context is not bound to any name
  131.  
  132.                 NamingContext bind_new_context(in Name n)
  133.                         raises(NotFound, CannotProceed,
  134.                                 InvalidName, AlreadyBound);
  135.                 // Creates a name naming context and binds it to the name
  136.                 // supplied as the argument.
  137.                 // The naming context is created in the same process as
  138.                 // the context on which the bind_new_context was invoked
  139.  
  140.                 void destroy()
  141.                         raises(NotEmpty);
  142.                 // destroys the naming context. If the naming context has
  143.                 // bindings, a NotEmpty exception is raised. It is the
  144.                 // responsibilty of the caller to make sure that there
  145.                 // are no refernces to this naming context.
  146.  
  147.                 void list(in unsigned long how_many, out BindingList bl,
  148.                         out BindingIterator bi);
  149.                 // returns at most "how_many" number of bindings in bl.
  150.                 // If the naming context contains additional bindings, a
  151.                 // BindingIterator is returned. If the naming context
  152.                 // does not contain additional bindings, the binding
  153.                 // iterator is a "nil" object reference
  154.  
  155.  
  156.                 #ifdef __SOMIDL__
  157.                 implementation {
  158.                         functionprefix=NC_;
  159.                         releaseorder: bind, rebind, bind_context,
  160.                                 rebind_context, resolve, unbind,
  161.                                 new_context,bind_new_context,destroy,list,
  162.                                         resolvex;
  163.  
  164.                         dllname = "somnmf.dll";
  165.                         majorversion = 3;
  166.                         minorversion = 0;
  167.                         somDefaultInit: override, init;
  168.                         somDestruct: override;
  169.                 };
  170.                 #endif
  171.         };
  172.  
  173.  
  174. }; /* end module CosNaming */
  175.  
  176. #endif /* ifndef  */
  177.