549
557
interface ClassInfo {
551
* Return the name of the class.
559
* Return the name of the class.
564
* Return the version number of the class. This should be a string
565
* with a sequence of numbers separated by periods.
556
570
* Get the version of the intermediate object representation.
557
571
* This will be in the form of major_version.minor_version.
559
string getIORVersion();
573
string getIORVersion();
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.
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.
567
581
class ClassInfoI implements-all ClassInfo {
569
* Set the name of the class.
571
final void setName(in string name);
574
* Set the IOR major and minor version numbers.
576
final void setIORVersion(in int major, in int minor);
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
583
* Set the name of the class.
585
final void setName(in string name);
588
* Set the version number of the class.
590
final void setVersion(in string ver);
593
* Set the IOR major and minor version numbers.
595
final void setIORVersion(in int major, in int minor);
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.
604
class MemAllocException extends sidl.SIDLException
605
implements RuntimeException {
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.
612
static MemAllocException getSingletonException();
615
* Return the message associated with the exception.
620
* Set the message associated with the exception.
622
void setNote(in string message);
625
* Returns formatted string containing the concatenation of all
631
* Adds a stringified entry/line to the stack trace.
633
void add[Line](in string traceline);
636
* Formats and adds an entry to the stack trace based on the
637
* file name, line number, and method name.
639
void add(in string filename, in int lineno, in string methodname);
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)
648
class CastException extends sidl.SIDLException
649
implements RuntimeException {
653
* This Exception is thrown by the Babel runtime when a non SIDL
654
* exception is thrown from an exception throwing language such as
657
class LangSpecificException extends sidl.SIDLException
658
implements RuntimeException {
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.
666
class NotImplementedException extends sidl.SIDLException
667
implements RuntimeException {
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
585
/** generic exception for I/O issues */
586
class IOException extends sidl.SIDLException {
590
* Standard interface for packing Babel types
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;
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;
618
* Standard interface for unpacking Babel types
620
interface Deserializer {
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;
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 ;
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 );
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 {
684
* Standard interface for packing Babel types
686
interface Serializer {
687
void packBool( in string key, in bool value )
689
void packChar( in string key, in char value )
691
void packInt( in string key, in int value )
693
void packLong( in string key, in long value )
695
void packOpaque( in string key, in opaque value )
697
void packFloat( in string key, in float value )
699
void packDouble( in string key, in double value )
701
void packFcomplex( in string key, in fcomplex value )
703
void packDcomplex( in string key, in dcomplex value )
705
void packString( in string key, in string value )
707
void packSerializable( in string key, in Serializable value )
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.
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 );
759
* Standard interface for unpacking Babel types
761
interface Deserializer {
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 );
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.
786
void unpackBoolArray( in string key, out array<bool> value,
787
in int ordering, in int dimen,
789
void unpackCharArray( in string key, out array<char> value,
790
in int ordering, in int dimen,
792
void unpackIntArray( in string key, out array<int> value,
793
in int ordering, in int dimen,
795
void unpackLongArray( in string key, out array<long> value,
796
in int ordering, in int dimen,
798
void unpackOpaqueArray( in string key, out array<opaque> value,
799
in int ordering, in int dimen,
801
void unpackFloatArray( in string key, out array<float> value,
802
in int ordering, in int dimen,
804
void unpackDoubleArray( in string key, out array<double> value,
805
in int ordering, in int dimen,
807
void unpackFcomplexArray( in string key, out array<fcomplex> value,
808
in int ordering, in int dimen,
810
void unpackDcomplexArray( in string key,
811
out array<dcomplex> value,
812
in int ordering, in int dimen,
814
void unpackStringArray( in string key, out array<string> value,
815
in int ordering, in int dimen,
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,
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).
663
* Generic Network Exception
665
class NetworkException extends sidl.io.IOException {
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>.
673
class ProtocolFactory {
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)
679
static bool addProtocol( in string prefix, in string typeName ) throws NetworkException;
682
* Return the typeName associated with a particular prefix.
683
* Return empty string if the prefix
685
static string getProtocol( in string prefix ) throws NetworkException;
688
* Remove a protocol from the active list.
690
static bool deleteProtocol( in string prefix ) throws NetworkException;
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.
697
static InstanceHandle createInstance( in string url, in string typeName ) throws NetworkException;
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.
705
static InstanceHandle connectInstance( in string url, in string typeName, in string objectID ) throws NetworkException;
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>.
714
* When a connection is created between a stub and a real object:
715
* sidl_rmi_InstanceHandle c = sidl_rmi_ProtocolFactory_createInstance( url, typeName );
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" );
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 );
727
interface InstanceHandle {
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;
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;
735
/** return the name of the protocol */
736
string getProtocol() throws NetworkException;
738
/** return the name of the server */
739
string getServerName() throws NetworkException;
741
/** return the port number on the server */
742
int getPort() throws NetworkException;
744
/** return the session ID */
745
string getObjectID() throws NetworkException;
747
/** create a handle to invoke a named method */
748
Invocation createInvocation( in string methodName ) throws NetworkException;
750
/** closes the connection (called be destructor, if not done explicitly)
751
* returns true if successful, false otherwise (including subsequent calls)
753
bool close() throws NetworkException;
757
* This type is used to pack arguments and make the actual
760
interface Invocation extends sidl.io.Serializer {
762
/** this method may be called only once at the end of the object's lifetime */
763
Response invokeMethod() throws NetworkException;
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.
771
interface Response extends sidl.io.Deserializer {
773
/** returns true iff RMI hasn't timed out */
774
bool timedOut() throws NetworkException;
776
/** if returns null, then safe to unpack arguments */
777
sidl.BaseException getExceptionThrown() throws NetworkException;
779
/** signal that all is complete */
780
bool done() throws NetworkException;
836
* Generic Network Exception
838
class NetworkException extends sidl.io.IOException {
840
void packObj( in sidl.io.Serializer ser );
841
void unpackObj( in sidl.io.Deserializer des );
842
void setErrno(in int err);
847
* This exception is thrown by the RMI library when a
848
* host can not be found by a DNS lookup.
850
class UnknownHostException extends NetworkException {}
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
857
class BindException extends NetworkException {}
860
* This exception is thrown by the RMI library when an
861
* attempt to connect to a remote host fails.
863
class ConnectException extends NetworkException {}
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
870
class NoRouteToHostException extends NetworkException {}
873
* This exception is thrown by the RMI library when a request
876
class TimeOutException extends NetworkException {}
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.
883
class UnexpectedCloseException extends NetworkException {}
886
* This exception is thrown by a server when a passed in object
887
* id does not match any known object.
889
class ObjectDoesNotExistException extends NetworkException {}
892
* This exception is thrown by the RMI library when a passed in URL
895
class MalformedURLException extends NetworkException {}
898
* This is a base class for all protocol specific exceptions.
900
class ProtocolException extends NetworkException {}
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
906
class NoServerException extends NetworkException {}
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>.
915
class ProtocolFactory {
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
923
static bool addProtocol( in string prefix, in string typeName );
926
* Return the typeName associated with a particular prefix.
927
* Return empty string if the prefix
929
static string getProtocol( in string prefix );
932
* Remove a protocol from the active list.
934
static bool deleteProtocol( in string prefix );
937
* Create a new remote object and return an instance handle for that
939
* The server and port number are in the url. Return nil
940
* if protocol unknown or InstanceHandle.init() failed.
942
static InstanceHandle createInstance( in string url,
943
in string typeName );
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
953
static InstanceHandle connectInstance( in string url,
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.
963
static sidl.io.Serializable unserializeInstance( in string url);
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>.
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.
980
* When a new remote object is created:
981
* sidl_rmi_InstanceHandle c =
982
* sidl_rmi_ProtocolFactory_createInstance( url, typeName,
985
* When a new stub is created to connect to an existing remote
987
* sidl_rmi_InstanceHandle c =
988
* sidl_rmi_ProtocolFactory_connectInstance( url, _ex );
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" );
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 );
1001
interface InstanceHandle {
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.
1007
bool initCreate( in string url, in string typeName );
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.
1014
bool initConnect( in string url, in string typeName, in bool ar);
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..
1022
sidl.io.Serializable initUnserialize( in string url);
1025
/** return the short name of the protocol */
1026
string getProtocol();
1028
/** return the object ID for the remote object*/
1029
string getObjectID();
1032
* return the full URL for this object, takes the form:
1033
* protocol://serviceID/objectID (where serviceID would = server:port
1035
* So usually, like this: protocol://server:port/objectID
1037
string getObjectURL();
1039
/** create a serializer handle to invoke the named method */
1040
Invocation createInvocation( in string methodName );
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.
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:
794
* sidl_BaseClass bc = sidl_rmi_InstanceRegistry_getInstance( "instanceID" );
795
* sidl_rmi_TypeMap inArgs = sidl_rmi_TypeMap__create();
797
* sidl_rmi_TypeMap_putDouble( inArgs, "input_val" , 2.0 );
798
* sidl_rmi_TypeMap_putString( inArgs, "input_str", "Hello" );
800
* sidl_rmi_TypeMap ourArgs = sidl_BaseClass_execMethod( bc, "methodName" , t );
802
* sidl_rmi_Response_unpackBool( i, "_retval", &succeeded );
803
* sidl_rmi_Response_unpackFloat( i, "output_val", &f );
805
class InstanceRegistry {
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
811
static string registerInstance( in sidl.BaseClass instance ) throws NetworkException;
814
* returns a handle to the class based on the unique string
816
static sidl.BaseClass getInstance( in string instanceID ) throws NetworkException;
819
* returns a handle to the class based on the unique string
820
* and removes the instance from the table.
822
static sidl.BaseClass removeInstance( in string instanceID ) throws NetworkException;
825
interface InArgs extends sidl.io.Deserializer {
829
interface OutArgs extends sidl.io.Serializer {
1043
* closes the connection (called by the destructor, if not done
1044
* explicitly) returns true if successful, false otherwise
1045
* (including subsequent calls)
1051
* This type is used to pack arguments and make the Client->Server
1052
* method invocation.
1054
interface Invocation extends sidl.io.Serializer {
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.
1061
Response invokeMethod();
1064
* This method is second of the triad. It returns
1065
* a Ticket, from which a Response is later extracted.
1067
Ticket invokeNonblocking();
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.
1075
void invokeOneWay();
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.
1083
interface Response extends sidl.io.Deserializer {
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
1090
sidl.BaseException getExceptionThrown();
1095
* This interface is implemented by the Server side deserializer.
1096
* Deserializes method arguments in preperation for the method
1099
interface Call extends sidl.io.Deserializer { }
1102
* This interface is implemented by the Server side serializer.
1103
* Serializes method arguments after the return from the method
1106
interface Return extends sidl.io.Serializer {
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.)
1114
void throwException(in sidl.BaseException ex_to_throw);
1118
* Used in lieu of a Response in nonblocking calls
1122
/** blocks until the Response is recieved */
1126
* returns immediately: true iff the Response is already
1131
/** creates an empty container specialized for Tickets */
1132
TicketBook createEmptyTicketBook();
1134
/** returns immediately: returns Response or null
1135
* (NOTE: needed for implementors of communication
1136
* libraries, not expected for general use).
1138
Response getResponse();
1143
* This is a collection of Tickets that itself can be viewed
1146
interface TicketBook extends Ticket {
1148
/** insert a ticket with a user-specified ID */
1149
void insertWithID( in Ticket t, in int id );
1151
/** insert a ticket and issue a unique ID */
1152
int insert( in Ticket t );
1154
/** remove a ready ticket from the TicketBook
1155
* returns 0 (and null) on an empty TicketBook
1157
int removeReady( out Ticket t );
1160
* immediate, returns the number of Tickets in the book.
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.
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
1176
* Objects are added to the registry in 3 ways:
1177
* 1) Added to the server's registry when an object is
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.
1186
class InstanceRegistry {
1189
* Register an instance of a class.
1191
* the registry will return an objectID string guaranteed to be
1192
* unique for the lifetime of the process
1194
static string registerInstance( in sidl.BaseClass instance );
1197
* Register an instance of a class with the given instanceID
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.
1203
static string registerInstance[ByString]( in sidl.BaseClass instance,
1204
in string instanceID);
1207
* returns a handle to the class based on the unique objectID
1208
* string, (null if the handle isn't in the table)
1210
static sidl.BaseClass getInstance[ByString]( in string instanceID );
1213
* takes a class and returns the objectID string associated
1214
* with it. (null if the handle isn't in the table)
1216
static string getInstance[ByClass]( in sidl.BaseClass instance );
1219
* removes an instance from the table based on its objectID
1220
* string.. returns a pointer to the object, which must be
1223
static sidl.BaseClass removeInstance[ByString]( in string instanceID );
1226
* removes an instance from the table based on its BaseClass
1227
* pointer. returns the objectID string, which much be freed.
1229
static string removeInstance[ByClass]( in sidl.BaseClass instance );
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.
1239
* This Class is for Babel internal use only.
1241
class ConnectRegistry {
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.
1249
static void registerConnect( in string key, in opaque func);
1252
* Returns the connect method for the class named in the key
1254
static opaque getConnect( in string key );
1257
* Returns the connect method for the class named in the key,
1258
* and removes it from the table.
1260
static opaque removeConnect( in string key );
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.
1269
interface ServerInfo {
1270
string getServerURL(in string objID);
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.
1277
string isLocalObject(in string url);
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!
1285
array<sidl.io.Serializable,1> getExceptions();
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.
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
1301
* THIS CLASS IS NOT DESIGNED FOR CONCURRENT WRITE ACCESS. (Only
1302
* one server is assumed per Babel process)
1304
class ServerRegistry {
1306
* Register the server with the ServerRegistry.
1308
static void registerServer(in sidl.rmi.ServerInfo si);
1311
* Get the registered server from the Server Registery.
1313
static sidl.rmi.ServerInfo getServer();
1316
* Perhaps this should take BaseClass and look the objectID up in
1317
* the Instance Registry
1319
static string getServerURL(in string objID);
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.
1326
static string isLocalObject(in string url);
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!
1334
static array<sidl.io.Serializable,1> getExceptions();