~ubuntu-branches/ubuntu/raring/babel/raring-proposed

« back to all changes in this revision

Viewing changes to runtime/sidl/sidl.sidl

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2008-08-01 07:56:58 UTC
  • mfrom: (3.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080801075658-9ezcrbh8dcs8lg70
Tags: 1.2.0.dfsg-6
Added libparsifal-dev as dependency to libsidl-dev (closes: #483324).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
// File:        sidl.sidl
3
 
// Revision:    @(#) $Revision: 4470 $
4
 
// Date:        $Date: 2005-03-23 17:14:50 -0800 (Wed, 23 Mar 2005) $
 
3
// Revision:    @(#) $Revision: 6049 $
 
4
// Date:        $Date: 2007-06-25 13:00:21 -0700 (Mon, 25 Jun 2007) $
5
5
// Description: sidl interface description for the basic sidl run-time library
6
6
// 
7
7
// Copyright (c) 2001, The Regents of the University of Calfornia.
36
36
 * and every class implicitly inherits from <code>sidl.BaseClass</code>.
37
37
 * 
38
38
 */
39
 
package sidl version 0.9.1 {
 
39
final package sidl version 0.9.17 {
40
40
 
41
41
  /**
42
42
   * Every interface in <code>sidl</code> implicitly inherits
77
77
    bool isSame(in BaseInterface iobj);
78
78
 
79
79
    /**
80
 
     * Check whether the object can support the specified interface or
81
 
     * class.  If the <code>sidl</code> type name in <code>name</code>
82
 
     * is supported, then a reference to that object is returned with the
83
 
     * reference count incremented.  The callee will be responsible for
84
 
     * calling <code>deleteRef</code> on the returned object.  If
85
 
     * the specified type is not supported, then a null reference is
86
 
     * returned.
87
 
     */
88
 
    BaseInterface queryInt(in string name);
89
 
 
90
 
    /**
91
80
     * Return whether this object is an instance of the specified type.
92
81
     * The string name must be the <code>sidl</code> type name.  This
93
82
     * routine will return <code>true</code> if and only if a cast to
138
127
    final bool isSame(in BaseInterface iobj);
139
128
 
140
129
    /**
141
 
     * Check whether the object can support the specified interface or
142
 
     * class.  If the <code>sidl</code> type name in <code>name</code>
143
 
     * is supported, then a reference to that object is returned with the
144
 
     * reference count incremented.  The callee will be responsible for
145
 
     * calling <code>deleteRef</code> on the returned object.  If
146
 
     * the specified type is not supported, then a null reference is
147
 
     * returned.
148
 
     */
149
 
    BaseInterface queryInt(in string name);
150
 
 
151
 
    /**
152
130
     * Return whether this object is an instance of the specified type.
153
131
     * The string name must be the <code>sidl</code> type name.  This
154
132
     * routine will return <code>true</code> if and only if a cast to
162
140
    final ClassInfo getClassInfo();
163
141
  }
164
142
 
 
143
  /** 
 
144
   * This package has some I/O capability that's not core to the 
 
145
   * SIDL object model, but still needed by parts of the generated code
 
146
   */
 
147
  package io { 
 
148
    /**
 
149
     *   Objects that implement Serializable will be serializable (copyable)
 
150
     * over RMI, or storable to streams.  Classes that can pack or unpack 
 
151
     *  themselves should implement this interface
 
152
     */ 
 
153
    interface Serializable { 
 
154
      void packObj( in Serializer ser );
 
155
      void unpackObj( in Deserializer des );
 
156
    } 
 
157
  }
 
158
 
165
159
  /**
166
160
   * Every exception implements <code>BaseException</code>. This interface
167
161
   * declares the basic functionality to get and set error messages and stack
168
162
   * traces.
169
163
   */
170
 
  interface BaseException {
 
164
  interface BaseException extends sidl.io.Serializable{
171
165
 
172
166
    /**
173
167
     * Return the message associated with the exception.
198
192
  }
199
193
 
200
194
  /**
 
195
   * This exception type is the default exception for every method.
 
196
   * 
 
197
   */
 
198
  interface RuntimeException extends BaseException {}
 
199
 
 
200
  /**
201
201
   * <code>SIDLException</code> provides the basic functionality of the
202
202
   * <code>BaseException</code> interface for getting and setting error
203
203
   * messages and stack traces.
206
206
  }
207
207
 
208
208
  /**
209
 
   * <code>PreconditionViolation</code> provides the basic marker for 
 
209
   * <code>PreViolation</code> provides the basic marker for 
210
210
   * a pre-condition exception.
211
211
   */
212
 
  class PreconditionViolation extends SIDLException {
 
212
  class PreViolation extends SIDLException implements RuntimeException {
213
213
  }
214
214
 
215
215
  /**
216
 
   * <code>PostconditionViolation</code> provides the basic marker for 
 
216
   * <code>PostViolation</code> provides the basic marker for 
217
217
   * a post-condition exception.
218
218
   */
219
 
  class PostconditionViolation extends SIDLException {
 
219
  class PostViolation extends SIDLException implements RuntimeException {
220
220
  }
221
221
 
222
222
  /**
223
 
   * <code>InvariantViolation</code> provides the basic marker for 
 
223
   * <code>InvViolation</code> provides the basic marker for 
224
224
   * a invariant exception.
225
225
   */
226
 
  class InvariantViolation extends SIDLException {
 
226
  class InvViolation extends SIDLException implements RuntimeException {
227
227
  }
228
228
 
229
229
  /**
231
231
   * settings: LOCAL, GLOBAL and SCLSCOPE.
232
232
   */
233
233
  enum Scope {
234
 
     /** Attempt to load the symbols into a local namespace. */
235
 
     LOCAL,
236
 
     /** Attempt to load the symbols into the global namespace. */
237
 
     GLOBAL,
238
 
     /** Use the scope setting from the SCL file. */
239
 
     SCLSCOPE
240
 
  }
 
234
    /** Attempt to load the symbols into a local namespace. */
 
235
    LOCAL,
 
236
      /** Attempt to load the symbols into the global namespace. */
 
237
      GLOBAL,
 
238
      /** Use the scope setting from the SCL file. */
 
239
      SCLSCOPE
 
240
      }
241
241
 
242
242
  /**
243
243
   * When loading a dynmaically linked library, there are three
244
244
   * settings: LAZY, NOW, SCLRESOLVE
245
245
   */
246
 
   enum Resolve {
247
 
     /** Resolve symbols on an as needed basis. */
248
 
     LAZY,
249
 
     /** Resolve all symbols at load time. */
250
 
     NOW,
251
 
     /** Use the resolve setting from the SCL file. */
252
 
     SCLRESOLVE
253
 
   }
 
246
  enum Resolve {
 
247
    /** Resolve symbols on an as needed basis. */
 
248
    LAZY,
 
249
      /** Resolve all symbols at load time. */
 
250
      NOW,
 
251
      /** Use the resolve setting from the SCL file. */
 
252
      SCLRESOLVE
 
253
      }
254
254
 
255
255
  /**
256
256
   * The <code>DLL</code> class encapsulates access to a single
307
307
    string getName();
308
308
 
309
309
    /**
 
310
     * Return true if the library was loaded into the global namespace.
 
311
     */
 
312
    bool isGlobal();
 
313
 
 
314
    /**
 
315
     * Return true if the library was loaded using lazy symbol resolution.
 
316
     */
 
317
    bool isLazy();
 
318
 
 
319
    /**
310
320
     * Unload the dynamic link library.  The library may no longer
311
321
     * be used to access symbol names.  When the library is actually
312
322
     * unloaded from the memory image depends on details of the operating
361
371
     *         The DLL has already been added.
362
372
     */
363
373
    DLL findLibrary(in string  sidl_name,
364
 
                           in string  target,
365
 
                           in Scope   lScope,
366
 
                           in Resolve lResolve);
 
374
                    in string  target,
 
375
                    in Scope   lScope,
 
376
                    in Resolve lResolve);
367
377
 
368
378
    /**
369
379
     * Set the search path, which is a semi-colon separated sequence of
399
409
   */
400
410
 
401
411
  class DFinder implements-all Finder {
402
 
 
403
 
 
404
412
  }
405
413
 
406
414
 
547
555
   * class.
548
556
   */
549
557
  interface ClassInfo {
550
 
     /**
551
 
      * Return the name of the class.
552
 
      */
553
 
     string getName();
 
558
    /**
 
559
     * Return the name of the class.
 
560
     */
 
561
    string getName();
 
562
 
 
563
    /**
 
564
     * Return the version number of the class. This should be a string
 
565
     * with a sequence of numbers separated by periods.
 
566
     */
 
567
    string getVersion();
554
568
 
555
569
    /**
556
570
     * Get the version of the intermediate object representation.
557
571
     * This will be in the form of major_version.minor_version.
558
572
     */
559
 
     string getIORVersion();
 
573
    string getIORVersion();
560
574
  }
561
575
 
562
 
  /**
563
 
   * An implementation of the <code>ClassInfo</code> interface. This provides
564
 
   * methods to set all the attributes that are read-only in the
565
 
   * <code>ClassInfo</code> interface.
 
576
  /** 
 
577
   * An implementation of the <code>ClassInfo</code> interface. This
 
578
   * provides methods to set all the attributes that are read-only in
 
579
   * the <code>ClassInfo</code> interface.
566
580
   */
567
581
  class ClassInfoI implements-all ClassInfo {
568
 
     /**
569
 
      * Set the name of the class.
570
 
      */
571
 
     final void setName(in string name);
572
 
 
573
 
     /**
574
 
      * Set the IOR major and minor version numbers.
575
 
      */
576
 
     final void setIORVersion(in int major, in int minor);
577
 
  }
578
 
 
579
 
  /** 
580
 
   * This package has some I/O capability that's not core to the 
581
 
   * SIDL object model, but still needed by parts of the generated code
 
582
    /**
 
583
     * Set the name of the class.
 
584
     */
 
585
    final void setName(in string name);
 
586
 
 
587
    /**
 
588
     * Set the version number of the class.
 
589
     */
 
590
    final void setVersion(in string ver);
 
591
 
 
592
    /**
 
593
     * Set the IOR major and minor version numbers.
 
594
     */
 
595
    final void setIORVersion(in int major, in int minor);
 
596
  }
 
597
 
 
598
  /**
 
599
   * Exception thrown from Babel internals when memory allocation
 
600
   * fails.  This exception is special in that it avoids any memory
 
601
   * allocation.  For this reason, the trace or note may be truncated
 
602
   * to fit in the preallocated buffers.
 
603
   */
 
604
  class MemAllocException extends sidl.SIDLException 
 
605
    implements RuntimeException {
 
606
 
 
607
    /**
 
608
     * Returns the preallocated copy of this exception.  Any
 
609
     * failure of memory allocation should throw the exception returned
 
610
     * by this method to avoid further allocation failures.
 
611
     */    
 
612
    static MemAllocException getSingletonException();
 
613
 
 
614
    /**
 
615
     * Return the message associated with the exception.
 
616
     */
 
617
    string getNote();
 
618
 
 
619
    /**
 
620
     * Set the message associated with the exception.
 
621
     */
 
622
    void setNote(in string message);
 
623
 
 
624
    /**
 
625
     * Returns formatted string containing the concatenation of all 
 
626
     * tracelines.
 
627
     */
 
628
    string getTrace();
 
629
 
 
630
    /**
 
631
     * Adds a stringified entry/line to the stack trace.
 
632
     */
 
633
    void add[Line](in string traceline);
 
634
 
 
635
    /**
 
636
     * Formats and adds an entry to the stack trace based on the 
 
637
     * file name, line number, and method name.
 
638
     */
 
639
    void add(in string filename, in int lineno, in string methodname);
 
640
 
 
641
  }
 
642
 
 
643
  /**
 
644
   * Exception is thrown when a cast fails and the failure needs to
 
645
   * be communicated up the call stack.  (Note: babel _cast does NOT
 
646
   * throw this exception)
 
647
   */
 
648
  class CastException extends sidl.SIDLException 
 
649
    implements RuntimeException {
 
650
  } 
 
651
 
 
652
  /** 
 
653
   * This Exception is thrown by the Babel runtime when a non SIDL
 
654
   * exception is thrown from an exception throwing language such as
 
655
   * C++ or Java.
 
656
   */
 
657
  class LangSpecificException extends sidl.SIDLException 
 
658
    implements RuntimeException {
 
659
  } 
 
660
 
 
661
  /** 
 
662
   * This Exception is thrown when a method is called that an 
 
663
   * implmentation has not been written for yet.  The throw code is
 
664
   * placed into the _Impl files automatically when they are generated.
 
665
   */
 
666
  class NotImplementedException extends sidl.SIDLException 
 
667
    implements RuntimeException {
 
668
  } 
 
669
 
 
670
 
 
671
  /** 
 
672
   * This package has some I/O capability that's not core to the SIDL
 
673
   * object model, but still needed by parts of the generated code
582
674
   */
583
675
  package io { 
584
676
      
585
 
      /** generic exception for I/O issues */
586
 
      class IOException extends sidl.SIDLException {
587
 
      }
588
 
      
589
 
      /**
590
 
       * Standard interface for packing Babel types
591
 
       */
592
 
      interface Serializer { 
593
 
          void packBool( in string key, in bool value ) throws IOException ;
594
 
          void packChar( in string key, in char value ) throws IOException ;
595
 
          void packInt( in string key, in int value ) throws IOException ;
596
 
          void packLong( in string key, in long value ) throws IOException ;
597
 
          void packFloat( in string key, in float value ) throws IOException ;
598
 
          void packDouble( in string key, in double value ) throws IOException ;
599
 
          void packFcomplex( in string key, in fcomplex value ) throws IOException ;
600
 
          void packDcomplex( in string key, in dcomplex value ) throws IOException ;
601
 
          void packString( in string key, in string value ) throws IOException ;
602
 
          //void pack[Serializable]( in string key, in Serializable value ) throws IOException;
603
 
          
604
 
          /* pack arrays of values */
605
 
          // void pack[BoolArray]( in string key, in array<bool> value ) throws IOException ;
606
 
          // void pack[CharArray]( in string key, in array<char> value ) throws IOException ;
607
 
          // void pack[IntArray]( in string key, in array<int> value ) throws IOException ;
608
 
          // void pack[LongArray]( in string key, in array<long> value ) throws IOException ;
609
 
          // void pack[FloatArray]( in string key, in array<float> value ) throws IOException ;
610
 
          // void pack[DoubleArray]( in string key, in array<double> value ) throws IOException ;
611
 
          // void pack[FcomplexArray]( in string key, in array<fcomplex> value ) throws IOException ;
612
 
          // void pack[DcomplexArray]( in string key, in array<dcomplex> value ) throws IOException ;
613
 
          // void pack[StringArray]( in string key, in array<string> value ) throws IOException ;
614
 
          // void pack[SerializableArray]( in string key, in array<Serializable> value ) throws IOException;
615
 
      }
616
 
 
617
 
      /**
618
 
       * Standard interface for unpacking Babel types
619
 
       */
620
 
      interface Deserializer { 
621
 
          /* unpack values */
622
 
          void unpackBool( in string key, out bool value ) throws IOException ;
623
 
          void unpackChar( in string key, out char value ) throws IOException ;
624
 
          void unpackInt( in string key, out int value ) throws IOException ;
625
 
          void unpackLong( in string key, out long value ) throws IOException ;
626
 
          void unpackFloat( in string key, out float value ) throws IOException ;
627
 
          void unpackDouble( in string key, out double value ) throws IOException ;
628
 
          void unpackFcomplex( in string key, out fcomplex value ) throws IOException ;
629
 
          void unpackDcomplex( in string key, out dcomplex value ) throws IOException ;
630
 
          void unpackString( in string key, out string value ) throws IOException ;
631
 
          // void unpack[Serializable]( in string key, out Serializable value ) throws IOException;
632
 
          
633
 
          /* unpack arrays of values */
634
 
          // void unpack[BoolArray]( in string key, out array<bool> value ) throws IOException ;
635
 
          // void unpack[CharArray]( in string key, out array<char> value ) throws IOException ;
636
 
          // void unpack[IntArray]( in string key, out array<int> value ) throws IOException ;
637
 
          // void unpack[LongArray]( in string key, out array<long> value ) throws IOException ;
638
 
          // void unpack[FloatArray]( in string key, out array<float> value ) throws IOException ;
639
 
          // void unpack[DoubleArray]( in string key, out array<double> value ) throws IOException ;
640
 
          // void unpack[FcomplexArray]( in string key, out array<fcomplex> value ) throws IOException ;
641
 
          // void unpack[DcomplexArray]( in string key, out array<dcomplex> value ) throws IOException ;
642
 
          // void unpack[StringArray]( in string key, out array<string> value ) throws IOException ;
643
 
          // void unpack[SerializableArray]( in string key, out array<Serializable> value ) throws IOException ;
644
 
      }
645
 
      
646
 
      /** Classes that can pack or unpack themselves should implement this interface */
647
 
      interface Serializeable { 
648
 
          void packObj( in Serializer ser );
649
 
          void unpackObj( in Deserializer des );
650
 
      } 
651
 
  }
652
 
 
653
 
  /**
654
 
   * This package contains necessary interfaces for RMI protocols to 
655
 
   * hook into Babel, plus a Protocol Factory class.  The intention is 
 
677
    /** generic exception for I/O issues */
 
678
    class IOException extends sidl.SIDLException 
 
679
      implements RuntimeException {
 
680
    }
 
681
 
 
682
 
 
683
    /**
 
684
     * Standard interface for packing Babel types
 
685
     */
 
686
    interface Serializer { 
 
687
      void packBool( in string key, in bool value ) 
 
688
         ;
 
689
      void packChar( in string key, in char value )
 
690
         ;
 
691
      void packInt( in string key, in int value )
 
692
         ;
 
693
      void packLong( in string key, in long value )
 
694
         ;
 
695
      void packOpaque(  in string key, in opaque value ) 
 
696
         ;
 
697
      void packFloat( in string key, in float value ) 
 
698
         ;
 
699
      void packDouble( in string key, in double value )
 
700
         ;
 
701
      void packFcomplex( in string key, in fcomplex value )
 
702
         ;
 
703
      void packDcomplex( in string key, in dcomplex value )
 
704
         ;
 
705
      void packString( in string key, in string value )
 
706
         ;
 
707
      void packSerializable( in string key, in Serializable value ) 
 
708
        ;
 
709
          
 
710
      /** 
 
711
       * pack arrays of values.  It is possible to ensure an array is
 
712
       * in a certain order by passing in ordering and dimension
 
713
       * requirements.  ordering should represent a value in the
 
714
       * sidl_array_ordering enumeration in sidlArray.h If either
 
715
       * argument is 0, it means there is no restriction on that
 
716
       * aspect.  The boolean reuse_array flag is set to true if the
 
717
       * remote unserializer should try to reuse the array that is
 
718
       * passed into it or not.
 
719
       */ 
 
720
      void packBoolArray( in string key, in array<bool> value, 
 
721
                          in int ordering, in int dimen, 
 
722
                          in bool reuse_array );
 
723
      void packCharArray( in string key, in array<char> value,
 
724
                          in int ordering, in int dimen, 
 
725
                          in bool reuse_array );
 
726
      void packIntArray( in string key, in array<int> value,
 
727
                         in int ordering, in int dimen, 
 
728
                         in bool reuse_array );
 
729
      void packLongArray( in string key, in array<long> value,
 
730
                          in int ordering, in int dimen,
 
731
                          in bool reuse_array );
 
732
      void packOpaqueArray( in string key, in array<opaque> value,
 
733
                            in int ordering, in int dimen, 
 
734
                            in bool reuse_array );
 
735
      void packFloatArray( in string key, in array<float> value, 
 
736
                           in int ordering, in int dimen, 
 
737
                           in bool reuse_array );
 
738
      void packDoubleArray( in string key, in array<double> value,
 
739
                            in int ordering, in int dimen,
 
740
                            in bool reuse_array );
 
741
      void packFcomplexArray( in string key, in array<fcomplex> value,
 
742
                              in int ordering, in int dimen, 
 
743
                              in bool reuse_array );
 
744
      void packDcomplexArray( in string key, in array<dcomplex> value,
 
745
                              in int ordering, in int dimen, 
 
746
                              in bool reuse_array );
 
747
      void packStringArray( in string key, in array<string> value, 
 
748
                            in int ordering, in int dimen, 
 
749
                            in bool reuse_array );
 
750
      void packGenericArray( in string key, in array<> value,
 
751
                             in bool reuse_array );
 
752
      void packSerializableArray( in string key, 
 
753
                                  in array<Serializable> value,
 
754
                                  in int ordering, in int dimen,
 
755
                                  in bool reuse_array );
 
756
    }
 
757
 
 
758
    /**
 
759
     * Standard interface for unpacking Babel types
 
760
     */
 
761
    interface Deserializer { 
 
762
      /* unpack values */
 
763
      void unpackBool( in string key, out bool value );
 
764
      void unpackChar( in string key, out char value );
 
765
      void unpackInt( in string key, out int value );
 
766
      void unpackLong( in string key, out long value );
 
767
      void unpackOpaque( in string key, out opaque value );
 
768
      void unpackFloat( in string key, out float value );
 
769
      void unpackDouble( in string key, out double value );
 
770
      void unpackFcomplex( in string key, out fcomplex value );
 
771
      void unpackDcomplex( in string key, out dcomplex value );
 
772
      void unpackString( in string key, out string value );
 
773
      void unpackSerializable( in string key, out Serializable value );
 
774
          
 
775
      /** unpack arrays of values 
 
776
       * It is possible to ensure an array is
 
777
       * in a certain order by passing in ordering and dimension
 
778
       * requirements.  ordering should represent a value in the
 
779
       * sidl_array_ordering enumeration in sidlArray.h If either
 
780
       * argument is 0, it means there is no restriction on that
 
781
       * aspect.  The rarray flag should be set if the array being
 
782
       * passed in is actually an rarray.  The semantics are slightly
 
783
       * different for rarrays.  The passed in array MUST be reused,
 
784
       * even if the array has changed bounds.
 
785
       */
 
786
      void unpackBoolArray( in string key, out array<bool> value, 
 
787
                            in int ordering, in int dimen, 
 
788
                            in bool isRarray );
 
789
      void unpackCharArray( in string key, out array<char> value, 
 
790
                            in int ordering, in int dimen,
 
791
                            in bool isRarray  );
 
792
      void unpackIntArray( in string key, out array<int> value,
 
793
                           in int ordering, in int dimen, 
 
794
                           in bool isRarray  );
 
795
      void unpackLongArray( in string key, out array<long> value, 
 
796
                            in int ordering, in int dimen, 
 
797
                            in bool isRarray  );
 
798
      void unpackOpaqueArray( in string key, out array<opaque> value, 
 
799
                              in int ordering, in int dimen, 
 
800
                              in bool isRarray  );
 
801
      void unpackFloatArray( in string key, out array<float> value,
 
802
                             in int ordering, in int dimen,
 
803
                             in bool isRarray  );
 
804
      void unpackDoubleArray( in string key, out array<double> value,
 
805
                              in int ordering, in int dimen,
 
806
                              in bool isRarray  );
 
807
      void unpackFcomplexArray( in string key, out array<fcomplex> value, 
 
808
                                in int ordering, in int dimen,
 
809
                                in bool isRarray  );
 
810
      void unpackDcomplexArray( in string key, 
 
811
                                out array<dcomplex> value, 
 
812
                                in int ordering, in int dimen, 
 
813
                                in bool isRarray  );
 
814
      void unpackStringArray( in string key, out array<string> value,
 
815
                              in int ordering, in int dimen, 
 
816
                              in bool isRarray  );
 
817
      void unpackGenericArray( in string key, out array<> value);
 
818
      void unpackSerializableArray( in string key, 
 
819
                                    out array<Serializable> value,
 
820
                                    in int ordering, in int dimen,
 
821
                                    in bool isRarray  );
 
822
    }
 
823
 
 
824
  } //end package io
 
825
 
 
826
  /** 
 
827
   * This package contains necessary interfaces for RMI protocols to
 
828
   * hook into Babel, plus a Protocol Factory class.  The intention is
656
829
   * that authors of new protocols will create classes that implement
657
 
   * InstanceHandle, Invocation and Response (they could even have one object
658
 
   * that implements all three interfaces).
 
830
   * InstanceHandle, Invocation and Response (they could even have one
 
831
   * object that implements all three interfaces).
659
832
   */
660
833
  package rmi { 
661
834
 
662
 
      /**
663
 
       * Generic Network Exception
664
 
       */
665
 
      class NetworkException extends sidl.io.IOException {
666
 
      } 
667
 
 
668
 
      /** 
669
 
       * This singleton class keeps a table of string prefixes (e.g. "babel" or "proteus")
670
 
       * to protocol implementations.  The intent is to parse a URL (e.g. "babel://server:port/class")
671
 
       * and create classes that implement <code>sidl.rmi.InstanceHandle</code>.
672
 
       */
673
 
      class ProtocolFactory { 
674
 
          /** 
675
 
           * Associate a particular prefix in the URL to a typeName <code>sidl.Loader</code> can find.
676
 
           * The actual type is expected to implement <code>sidl.rmi.InstanceHandle</code>
677
 
           * Return true iff the addition is successful.  (no collisions allowed)
678
 
           */
679
 
          static bool addProtocol( in string prefix, in string typeName ) throws NetworkException;
680
 
          
681
 
          /**
682
 
           * Return the typeName associated with a particular prefix.
683
 
           * Return empty string if the prefix
684
 
           */
685
 
          static string getProtocol( in string prefix ) throws NetworkException;
686
 
 
687
 
          /**
688
 
           * Remove a protocol from the active list.
689
 
           */
690
 
          static bool deleteProtocol( in string prefix ) throws NetworkException;
691
 
          
692
 
          /**
693
 
           * Create a new remote object and a return an instance handle for that object. 
694
 
           * The server and port number are in the url.  Return nil 
695
 
           * if protocol unknown or InstanceHandle.init() failed.
696
 
           */
697
 
          static InstanceHandle createInstance( in string url, in string typeName ) throws NetworkException;
698
 
 
699
 
          /**
700
 
           * Create an new connection linked to an already existing object on a remote 
701
 
           * server.  The server and port number are in the url, the objectID is the unique ID
702
 
           * of the remote object in the remote instance registry. 
703
 
           * Return nil if protocol unknown or InstanceHandle.init() failed.
704
 
           */
705
 
          static InstanceHandle connectInstance( in string url, in string typeName, in string objectID ) throws NetworkException;       
706
 
      }
707
 
 
708
 
      /**
709
 
       * This interface holds the state information for handles to remote
710
 
       * objects.  Client-side messaging libraries are expected to implement
711
 
       * <code>sidl.rmi.InstanceHandle</code>, <code>sidl.rmi.Invocation</code>
712
 
       * and <code>sidl.rmi.Response</code>.
713
 
       * 
714
 
       *  When a connection is created between a stub and a real object:
715
 
       *       sidl_rmi_InstanceHandle c = sidl_rmi_ProtocolFactory_createInstance( url, typeName );
716
 
       * 
717
 
       *  When a method is invoked:
718
 
       *       sidl_rmi_Invocation i = sidl_rmi_InstanceHandle_createInvocationHandle( methodname );
719
 
       *       sidl_rmi_Invocation_packDouble( i, "input_val" , 2.0 );
720
 
       *       sidl_rmi_Invocation_packString( i, "input_str", "Hello" );
721
 
       *       ...
722
 
       *       sidl_rmi_Response r = sidl_rmi_Invocation_invokeMethod( i );
723
 
       *       sidl_rmi_Response_unpackBool( i, "_retval", &succeeded );
724
 
       *       sidl_rmi_Response_unpackFloat( i, "output_val", &f );
725
 
       * 
726
 
       */
727
 
      interface InstanceHandle {
728
 
 
729
 
          /** initialize a connection (intended for use by the ProtocolFactory) */
730
 
          bool init[Create]( in string protocol, in string server, in int port, in string typeName ) throws NetworkException;
731
 
 
732
 
          /** initialize a connection (intended for use by the ProtocolFactory) */
733
 
          bool init[Connect]( in string protocol, in string server, in int port, in string typeName, in string objectID ) throws NetworkException;
734
 
 
735
 
          /** return the name of the protocol */
736
 
          string getProtocol() throws NetworkException;
737
 
 
738
 
          /** return the name of the server */
739
 
          string getServerName() throws NetworkException;
740
 
          
741
 
          /** return the port number on the server */
742
 
          int getPort() throws NetworkException;
743
 
 
744
 
          /** return the session ID */
745
 
          string getObjectID() throws NetworkException;
746
 
 
747
 
          /** create a handle to invoke a named method */
748
 
          Invocation createInvocation( in string methodName ) throws NetworkException;
749
 
          
750
 
          /** closes the connection (called be destructor, if not done explicitly) 
751
 
           * returns true if successful, false otherwise (including subsequent calls)
752
 
           */
753
 
          bool close() throws NetworkException;
754
 
      }
755
 
 
756
 
      /**
757
 
       * This type is used to pack arguments and make the actual 
758
 
       * method invocation.
759
 
       */        
760
 
      interface Invocation extends sidl.io.Serializer {
761
 
 
762
 
          /** this method may be called only once at the end of the object's lifetime */
763
 
          Response invokeMethod() throws NetworkException;
764
 
      }
765
 
 
766
 
      /**
767
 
       * This type is created when an InvocationHandle actually invokes its method.
768
 
        * It encapsulates all the results that users will want to pull out of a
769
 
       * remote method invocation.
770
 
       */
771
 
      interface Response extends sidl.io.Deserializer { 
772
 
 
773
 
          /** returns true iff RMI hasn't timed out */
774
 
          bool timedOut() throws NetworkException;
775
 
 
776
 
          /** if returns null, then safe to unpack arguments */
777
 
          sidl.BaseException getExceptionThrown() throws NetworkException;
778
 
          
779
 
          /** signal that all is complete */
780
 
          bool done() throws NetworkException;
781
 
      }
 
835
    /**
 
836
     * Generic Network Exception
 
837
     */
 
838
    class NetworkException extends sidl.io.IOException {
 
839
      int getHopCount();
 
840
      void packObj( in sidl.io.Serializer ser );
 
841
      void unpackObj( in sidl.io.Deserializer des );
 
842
      void setErrno(in int err);
 
843
      int getErrno();
 
844
    }   
 
845
 
 
846
    /**
 
847
     * This exception is thrown by the RMI library when a 
 
848
     * host can not be found by a DNS lookup.
 
849
     */
 
850
    class UnknownHostException extends NetworkException {}
 
851
 
 
852
    /** 
 
853
     * This exception is normally thrown by the RMI library when the
 
854
     * server is started up and the port it is assigned to use is
 
855
     * already in use.
 
856
     */
 
857
    class BindException extends NetworkException {}
 
858
     
 
859
    /**
 
860
     * This exception is thrown by the RMI library when an 
 
861
     * attempt to connect to a remote host fails.
 
862
     */
 
863
    class ConnectException extends NetworkException {}
 
864
 
 
865
    /**
 
866
     * This exception is thrown by the RMI library when a host 
 
867
     * can be found by DNS, but is not reachable.  It usually means 
 
868
     * a router is down.
 
869
     */
 
870
    class NoRouteToHostException extends NetworkException {}
 
871
 
 
872
    /**
 
873
     * This exception is thrown by the RMI library when a request 
 
874
     * times out. 
 
875
     */
 
876
    class TimeOutException extends NetworkException {}
 
877
 
 
878
    /**
 
879
     * This exception is thrown by the RMI library when the network 
 
880
     * unexpected loses it's connection.  Can be caused by reset, 
 
881
     * software connection abort, connection reset by peer, etc. 
 
882
     */
 
883
    class UnexpectedCloseException extends NetworkException {}
 
884
 
 
885
    /**
 
886
     * This exception is thrown by a server when a passed in object 
 
887
     * id does not match any known object. 
 
888
     */
 
889
    class ObjectDoesNotExistException extends NetworkException {}
 
890
 
 
891
    /**
 
892
     * This exception is thrown by the RMI library when a passed in URL 
 
893
     * is malformed.
 
894
     */
 
895
    class MalformedURLException extends NetworkException {}
 
896
 
 
897
    /**
 
898
     * This is a base class for all protocol specific exceptions.
 
899
     */
 
900
    class ProtocolException extends NetworkException {}
 
901
 
 
902
    /**
 
903
     * This exception thrown when one attempts to pass a local object remotely but 
 
904
     * there is no local server running to serve the object
 
905
     */ 
 
906
    class NoServerException extends NetworkException {} 
 
907
 
 
908
    /** 
 
909
     * This singleton class keeps a table of string prefixes
 
910
     * (e.g. "babel" or "proteus") to protocol implementations.  The
 
911
     * intent is to parse a URL (e.g. "babel://server:port/class") and
 
912
     * create classes that implement
 
913
     * <code>sidl.rmi.InstanceHandle</code>.
 
914
     */
 
915
    class ProtocolFactory { 
 
916
      /** 
 
917
       * Associate a particular prefix in the URL to a typeName
 
918
       * <code>sidl.Loader</code> can find.  The actual type is
 
919
       * expected to implement <code>sidl.rmi.InstanceHandle</code>
 
920
       * Return true iff the addition is successful.  (no collisions
 
921
       * allowed)
 
922
       */
 
923
      static bool addProtocol( in string prefix, in string typeName );
 
924
          
 
925
      /**
 
926
       * Return the typeName associated with a particular prefix.
 
927
       * Return empty string if the prefix
 
928
       */
 
929
      static string getProtocol( in string prefix );
 
930
 
 
931
      /**
 
932
       * Remove a protocol from the active list.
 
933
       */
 
934
      static bool deleteProtocol( in string prefix );
 
935
          
 
936
      /**
 
937
       * Create a new remote object and return an instance handle for that
 
938
       * object. 
 
939
       * The server and port number are in the url.  Return nil 
 
940
       * if protocol unknown or InstanceHandle.init() failed.
 
941
       */
 
942
      static InstanceHandle createInstance( in string url,
 
943
                                            in string typeName );
 
944
 
 
945
      /** 
 
946
       * Create an new connection linked to an already existing
 
947
       * object on a remote server.  The server and port number are in
 
948
       * the url, the objectID is the unique ID of the remote object
 
949
       * in the remote instance registry.  Return null if protocol
 
950
       * unknown or InstanceHandle.init() failed.  The boolean addRef
 
951
       * should be true if connect should remotely addRef
 
952
       */
 
953
      static InstanceHandle connectInstance( in string url, 
 
954
                                             in string typeName, 
 
955
                                             in bool ar);       
 
956
 
 
957
      /** 
 
958
       * Request that a remote object be serialized to you.  The server 
 
959
       * and port number are in the url, the objectID is the unique ID 
 
960
       * of the remote object in the remote instance registry.  Return 
 
961
       * null if protocol unknown or InstanceHandle.init() failed.  
 
962
       */
 
963
      static sidl.io.Serializable unserializeInstance( in string url);  
 
964
 
 
965
    }
 
966
 
 
967
    /** 
 
968
     * This interface holds the state information for handles to
 
969
     * remote objects.  Client-side messaging libraries are expected
 
970
     * to implement <code>sidl.rmi.InstanceHandle</code>,
 
971
     * <code>sidl.rmi.Invocation</code> and
 
972
     * <code>sidl.rmi.Response</code>.
 
973
     * 
 
974
     * Every stub with a connection to a remote object holds a pointer
 
975
     * to an InstanceHandle that manages the connection. Multiple
 
976
     * stubs may point to the same InstanceHandle, however.  Babel
 
977
     * takes care of the reference counting, but the developer should
 
978
     * keep concurrency issues in mind.
 
979
     *  
 
980
     *  When a new remote object is created:
 
981
     *       sidl_rmi_InstanceHandle c = 
 
982
     *         sidl_rmi_ProtocolFactory_createInstance( url, typeName,
 
983
     *               _ex );
 
984
     * 
 
985
     *  When a new stub is created to connect to an existing remote
 
986
     * instance:
 
987
     *        sidl_rmi_InstanceHandle c = 
 
988
     *          sidl_rmi_ProtocolFactory_connectInstance( url, _ex );
 
989
     *
 
990
     *  When a method is invoked:
 
991
     *       sidl_rmi_Invocation i = 
 
992
     *          sidl_rmi_InstanceHandle_createInvocation( methodname );
 
993
     *       sidl_rmi_Invocation_packDouble( i, "input_val" , 2.0 );
 
994
     *       sidl_rmi_Invocation_packString( i, "input_str", "Hello" );
 
995
     *       ...
 
996
     *       sidl_rmi_Response r = sidl_rmi_Invocation_invokeMethod( i );
 
997
     *       sidl_rmi_Response_unpackBool( i, "_retval", &succeeded );
 
998
     *       sidl_rmi_Response_unpackFloat( i, "output_val", &f );
 
999
     * 
 
1000
     */ 
 
1001
    interface InstanceHandle {
 
1002
 
 
1003
      /** initialize a connection (intended for use by the
 
1004
       * ProtocolFactory, (see above).  This should parse the url and
 
1005
       * do everything necessary to create the remote object.
 
1006
       */
 
1007
      bool initCreate( in string url, in string typeName );
 
1008
 
 
1009
      /**
 
1010
       * initialize a connection (intended for use by the ProtocolFactory) 
 
1011
       * This should parse the url and do everything necessary to connect 
 
1012
       * to a remote object.
 
1013
       */
 
1014
      bool initConnect( in string url, in string typeName, in bool ar);
 
1015
 
 
1016
 
 
1017
      /** Get a connection specifically for the purpose for requesting a 
 
1018
       * serialization of a remote object (intended for use by the
 
1019
       * ProtocolFactory, (see above).  This should parse the url and
 
1020
       * request the object.  It should return a deserializer..
 
1021
       */
 
1022
      sidl.io.Serializable initUnserialize( in string url);
 
1023
 
 
1024
 
 
1025
      /** return the short name of the protocol */
 
1026
      string getProtocol();
 
1027
 
 
1028
      /** return the object ID for the remote object*/
 
1029
      string getObjectID();
 
1030
 
 
1031
      /** 
 
1032
       * return the full URL for this object, takes the form: 
 
1033
       * protocol://serviceID/objectID (where serviceID would = server:port 
 
1034
       * on TCP/IP)
 
1035
       * So usually, like this: protocol://server:port/objectID
 
1036
       */
 
1037
      string getObjectURL();
 
1038
 
 
1039
      /** create a serializer handle to invoke the named method */
 
1040
      Invocation createInvocation( in string methodName );
782
1041
  
783
 
      /**
784
 
       * This singleton class is implemented by Babel's runtime for RMI libraries to 
785
 
       * invoke methods on server objects.  It is assumed that the RMI library
786
 
       * has a self-describing stream of data, but the data may be reordered
787
 
       * from the natural argument list.
788
 
       * 
789
 
       * 
790
 
       * In the case of the RMI library receiving a self-describing stream
791
 
       * and wishing to invoke a method on a class... the RMI library would 
792
 
       * make a sequence of calls like:
793
 
       * 
794
 
       *       sidl_BaseClass bc = sidl_rmi_InstanceRegistry_getInstance( "instanceID" );
795
 
       *       sidl_rmi_TypeMap inArgs = sidl_rmi_TypeMap__create();
796
 
       *       
797
 
       *       sidl_rmi_TypeMap_putDouble( inArgs, "input_val" , 2.0 );
798
 
       *       sidl_rmi_TypeMap_putString( inArgs, "input_str", "Hello" );
799
 
       *       ...
800
 
       *       sidl_rmi_TypeMap ourArgs = sidl_BaseClass_execMethod( bc, "methodName" , t );
801
 
       * 
802
 
       *       sidl_rmi_Response_unpackBool( i, "_retval", &succeeded );
803
 
       *       sidl_rmi_Response_unpackFloat( i, "output_val", &f );
804
 
       */
805
 
      class InstanceRegistry { 
806
 
 
807
 
          /** register an instance of a class
808
 
           *  the registry will return a string guaranteed to be unique for
809
 
           *  the lifetime of the process
810
 
           */         
811
 
          static string registerInstance( in sidl.BaseClass instance ) throws NetworkException;
812
 
 
813
 
          /** 
814
 
           * returns a handle to the class based on the unique string
815
 
           */
816
 
          static sidl.BaseClass getInstance( in string instanceID ) throws NetworkException;
817
 
 
818
 
          /**   
819
 
           * returns a handle to the class based on the unique string
820
 
           * and removes the instance from the table.  
821
 
           */
822
 
          static sidl.BaseClass removeInstance( in string instanceID ) throws NetworkException;
823
 
      }
824
 
 
825
 
      interface InArgs extends  sidl.io.Deserializer { 
826
 
          
827
 
      }
828
 
      
829
 
      interface OutArgs extends sidl.io.Serializer { 
830
 
          
831
 
      }
832
 
 
833
 
  }
 
1042
      /** 
 
1043
       * closes the connection (called by the destructor, if not done
 
1044
       * explicitly) returns true if successful, false otherwise
 
1045
       * (including subsequent calls)
 
1046
       */
 
1047
      bool close();
 
1048
    }
 
1049
 
 
1050
    /**
 
1051
     * This type is used to pack arguments and make the Client->Server 
 
1052
     * method invocation.
 
1053
     */  
 
1054
    interface Invocation extends sidl.io.Serializer {
 
1055
 
 
1056
      /** 
 
1057
       * this method is one of a triad.  Only one of which 
 
1058
       * may be called, and it must the the last method called
 
1059
       * in the object's lifetime.
 
1060
       */
 
1061
      Response invokeMethod();
 
1062
 
 
1063
      /**
 
1064
       * This method is second of the triad.  It returns
 
1065
       * a Ticket, from which a Response is later extracted.
 
1066
       */
 
1067
      Ticket invokeNonblocking();
 
1068
 
 
1069
      /**
 
1070
       * This method is third of the triad.  It returns
 
1071
       * and exception iff the invocation cannot be delivered
 
1072
       * reliably.  It does not wait for the invocation to 
 
1073
       * be acted upon and returns no values from the invocation.
 
1074
       */
 
1075
      void invokeOneWay();
 
1076
    }
 
1077
 
 
1078
    /** 
 
1079
     * This type is created when an invokeMethod is called on an
 
1080
     * Invocation.  It encapsulates all the results that users will
 
1081
     * want to pull out of a remote method invocation.
 
1082
     */
 
1083
    interface Response extends sidl.io.Deserializer { 
 
1084
 
 
1085
      /** 
 
1086
       * May return a communication exception or an execption thrown
 
1087
       * from the remote server.  If it returns null, then it's safe
 
1088
       * to unpack arguments
 
1089
       */
 
1090
      sidl.BaseException getExceptionThrown();
 
1091
          
 
1092
    }
 
1093
 
 
1094
    /** 
 
1095
     * This interface is implemented by the Server side deserializer.
 
1096
     * Deserializes method arguments in preperation for the method
 
1097
     * call.
 
1098
     */
 
1099
    interface Call extends sidl.io.Deserializer { }
 
1100
 
 
1101
    /** 
 
1102
     * This interface is implemented by the Server side serializer.
 
1103
     * Serializes method arguments after the return from the method
 
1104
     * call.
 
1105
     */
 
1106
    interface Return extends sidl.io.Serializer {
 
1107
 
 
1108
      /** 
 
1109
       * This method serialized exceptions thrown on the server side
 
1110
       * that should be returned to the client.  Assumed to invalidate
 
1111
       * in previously serialized arguments.  (Also assumed that no
 
1112
       * more arguments will be serialized.)
 
1113
       */
 
1114
      void throwException(in sidl.BaseException ex_to_throw);
 
1115
    }
 
1116
 
 
1117
    /**
 
1118
     * Used in lieu of a Response in nonblocking calls
 
1119
     */
 
1120
    interface Ticket { 
 
1121
        
 
1122
      /** blocks until the Response is recieved */
 
1123
      void block();
 
1124
 
 
1125
      /** 
 
1126
       * returns immediately: true iff the Response is already
 
1127
       * received 
 
1128
       */
 
1129
      bool test();
 
1130
 
 
1131
      /** creates an empty container specialized for Tickets */
 
1132
      TicketBook createEmptyTicketBook();
 
1133
 
 
1134
      /** returns immediately: returns Response or null 
 
1135
       *  (NOTE: needed for implementors of communication
 
1136
       *         libraries, not expected for general use).
 
1137
       */
 
1138
      Response getResponse();
 
1139
 
 
1140
    }
 
1141
 
 
1142
    /**
 
1143
     * This is a collection of Tickets that itself can be viewed
 
1144
     * as a ticket.  
 
1145
     */
 
1146
    interface TicketBook extends Ticket { 
 
1147
        
 
1148
      /** insert a ticket with a user-specified ID */
 
1149
      void insertWithID( in Ticket t, in int id );
 
1150
 
 
1151
      /** insert a ticket and issue a unique ID */
 
1152
      int insert( in Ticket t );
 
1153
 
 
1154
      /** remove a ready ticket from the TicketBook
 
1155
       *  returns 0 (and null) on an empty TicketBook
 
1156
       */
 
1157
      int removeReady( out Ticket t );
 
1158
 
 
1159
      /**
 
1160
       * immediate, returns the number of Tickets in the book.
 
1161
       */
 
1162
      bool isEmpty();
 
1163
 
 
1164
    }
 
1165
 
 
1166
    /** 
 
1167
     * This singleton class is implemented by Babel's runtime for RMI
 
1168
     * libraries to invoke methods on server objects.  It maps
 
1169
     * objectID strings to sidl_BaseClass objects and vice-versa.
 
1170
     *
 
1171
     * The InstanceRegistry creates and returns a unique string when a
 
1172
     * new object is added to the registry.  When an object's refcount
 
1173
     * reaches 0 and it is collected, it is removed from the Instance
 
1174
     * Registry.
 
1175
     *
 
1176
     * Objects are added to the registry in 3 ways:
 
1177
     * 1) Added to the server's registry when an object is
 
1178
     *    create[Remote]'d.
 
1179
     * 2) Implicity added to the local registry when an object is
 
1180
     *    passed as an argument in a remote call.
 
1181
     * 3) A user may manually add a reference to the local registry
 
1182
     *    for publishing purposes.  The user hsould keep a reference
 
1183
     *    to the object.  Currently, the user cannot provide their own
 
1184
     *    objectID, this capability should probably be added.
 
1185
     */
 
1186
    class InstanceRegistry { 
 
1187
 
 
1188
      /** 
 
1189
       * Register an instance of a class.
 
1190
       *  
 
1191
       * the registry will return an objectID string guaranteed to be
 
1192
       * unique for the lifetime of the process
 
1193
       */             
 
1194
      static string registerInstance( in sidl.BaseClass instance );
 
1195
 
 
1196
      /** 
 
1197
       * Register an instance of a class with the given instanceID
 
1198
       *  
 
1199
       * If a different object already exists in registry under
 
1200
       * the supplied name, a false is returned, if the object was 
 
1201
       * successfully registered, true is returned.
 
1202
       */             
 
1203
      static string registerInstance[ByString]( in sidl.BaseClass instance, 
 
1204
                                              in string instanceID);
 
1205
 
 
1206
      /** 
 
1207
       * returns a handle to the class based on the unique objectID
 
1208
       * string, (null if the handle isn't in the table)
 
1209
       */
 
1210
      static sidl.BaseClass getInstance[ByString]( in string instanceID );
 
1211
 
 
1212
      /** 
 
1213
       * takes a class and returns the objectID string associated
 
1214
       * with it.  (null if the handle isn't in the table)
 
1215
       */
 
1216
      static string getInstance[ByClass]( in sidl.BaseClass instance );
 
1217
 
 
1218
      /** 
 
1219
       * removes an instance from the table based on its objectID
 
1220
       * string..  returns a pointer to the object, which must be
 
1221
       * destroyed.
 
1222
       */
 
1223
      static sidl.BaseClass removeInstance[ByString]( in string instanceID );
 
1224
    
 
1225
      /** 
 
1226
       * removes an instance from the table based on its BaseClass
 
1227
       * pointer.  returns the objectID string, which much be freed.
 
1228
       */
 
1229
      static string removeInstance[ByClass]( in sidl.BaseClass instance );
 
1230
    }
 
1231
 
 
1232
    /** 
 
1233
     * This singleton class is implemented by Babel's runtime for to
 
1234
     * allow RMI downcasting of objects.  When we downcast an RMI
 
1235
     * object, we may be required to create a new derived class object
 
1236
     * with a connect function.  We store all the connect functions in
 
1237
     * this table for easy access.
 
1238
     *
 
1239
     * This Class is for Babel internal use only.
 
1240
     */
 
1241
    class ConnectRegistry { 
 
1242
 
 
1243
      /** 
 
1244
       * The key is the SIDL classname the registered connect belongs
 
1245
       * to.  Multiple registrations under the same key are possible,
 
1246
       * this must be protected against in the user code.  Babel does
 
1247
       * this internally with a static boolean.
 
1248
       */             
 
1249
      static void registerConnect( in string key, in opaque func);
 
1250
 
 
1251
      /** 
 
1252
       * Returns the connect method for the class named in the key
 
1253
       */
 
1254
      static opaque getConnect( in string key );
 
1255
 
 
1256
      /** 
 
1257
       * Returns the connect method for the class named in the key,
 
1258
       * and removes it from the table.
 
1259
       */
 
1260
      static opaque removeConnect( in string key );
 
1261
    }   
 
1262
 
 
1263
    /** 
 
1264
     * ServerInfo is an interface (possibly implemented by the ORB
 
1265
     * itself) that provides functions to deal with the problems
 
1266
     * associated with passing local object remotely.  It should be
 
1267
     * registered with the ServerRegistry for general use.
 
1268
     */
 
1269
    interface ServerInfo {
 
1270
      string getServerURL(in string objID);
 
1271
 
 
1272
      /** 
 
1273
       * For internal Babel use ONLY. Needed by Babel to determine if
 
1274
       * a url points to a local or remote object.  Returns the
 
1275
       * objectID if is local, Null otherwise.
 
1276
       */ 
 
1277
      string isLocalObject(in string url);
 
1278
 
 
1279
      /** 
 
1280
       * This gets an array of logged exceptions.  If an exception
 
1281
       * can not be thrown back to the caller, we log it with the
 
1282
       * Server.  This gets the array of all those exceptions.  THIS
 
1283
       * IS SOMETHING OF A TEST! THIS MAY CHANGE!
 
1284
       */
 
1285
      array<sidl.io.Serializable,1> getExceptions();
 
1286
    }
 
1287
 
 
1288
    /** 
 
1289
     * This singleton class is simply a place to register a
 
1290
     * ServerInfo interface for general access.  This ServerInfo
 
1291
     * should give info about the ORB being used to export RMI objects
 
1292
     * for the current Babel process.
 
1293
     *
 
1294
     * This Registry provides two important functions, a way to get
 
1295
     * the URL for local object we wish to expose over RMI, and a way
 
1296
     * to tell if an object passed to this process via RMI is actually
 
1297
     * a local object.  This abilities are protocol specific, the
 
1298
     * ServerInfo interface must by implemented by the protocol
 
1299
     * writer.
 
1300
     *
 
1301
     * THIS CLASS IS NOT DESIGNED FOR CONCURRENT WRITE ACCESS.  (Only
 
1302
     * one server is assumed per Babel process)
 
1303
     */
 
1304
    class ServerRegistry {
 
1305
      /**
 
1306
       * Register the server with the ServerRegistry.
 
1307
       */
 
1308
      static void registerServer(in sidl.rmi.ServerInfo si);
 
1309
 
 
1310
      /**
 
1311
       * Get the registered server from the Server Registery.
 
1312
       */
 
1313
      static sidl.rmi.ServerInfo getServer();
 
1314
 
 
1315
      /**
 
1316
       * Perhaps this should take BaseClass and look the objectID up in 
 
1317
       * the Instance Registry
 
1318
       */ 
 
1319
      static string getServerURL(in string objID);
 
1320
 
 
1321
      /**
 
1322
       * For internal Babel use ONLY. Needed by Babel to determine if a 
 
1323
       * url points to a local or remote object.  Returns the objectID 
 
1324
       * if is local, Null otherwise.
 
1325
       */ 
 
1326
      static string isLocalObject(in string url);
 
1327
 
 
1328
      /** 
 
1329
       * This gets an array of logged exceptions.  If an exception
 
1330
       * can not be thrown back to the caller, we log it with the
 
1331
       * Server.  This gets the array of all those exceptions.  THIS
 
1332
       * IS SOMETHING OF A TEST! THIS MAY CHANGE!
 
1333
       */
 
1334
      static array<sidl.io.Serializable,1> getExceptions();             
 
1335
      
 
1336
    }
 
1337
      
 
1338
  } //end package rmi
834
1339
}