Server Smalltalk Guide
The notion of a remote object in CORBA is represented by an Interoperable
Object Reference (IOR). An IOR contains type information and
a sequence of tagged profiles. SST currently supports only IIOP so all
IORs must have an IIOP profile which contains the TCP/IP address of the
object's server location. While standard IDL-to-Smalltalk mapping
represents IORs as dictionaries, SST provides IOR objects which respond to
Dictionary protocol as well as several helper methods.
SstIor objects can be created from object references in string
form, using the following protocol:
- fromString: value
- Converts an IOR in string form into an SstIor according to the
CORBA conversion specifications for
ORB::string_to_object. @value
indicates the IOR in the form of the output of
CORBA::object_to_string() in the repository's
native environment, the name of a file containing such a string, or an HTTP
URL indicating the location of a page containing the IOR string.
When acting as an object server, it is often necessary to create
SstIor objects to represent some other object residing
locally. SstIor's can be created explicitly by you, or
automatically created by the marshaler if a normal object is encountered when
marshaling a request using sstAsIorInContext. The protocols
for explicit creation of an SstIor are as follows:
- for: anObject context:
context
- Answers a Smalltalk form of an
::IOP::IOR, representing
@anObject with no type information.
- for: anObject context:
context key: exportKey
- Answers a Smalltalk form of an
::IOP::IOR, representing
@anObject. Type information is not given. The
key used in exporting @anObject is
@exportKey.
- for:: anObject type:
typeId context: context
- Answers a Smalltalk form of an
::IOP::IOR, representing
@anObject with whatever type information is provided by
@typeId. To determine an appropriate object key for
@anObject, @context is used to find a
local space. If the context is not capable of exporting an object, an
exception is thrown.
- for: anObject type:
typeId context: context key:
exportKey
- Answers a Smalltalk form of an
::IOP::IOR, representing
@anObject with whatever type information is provided by
@typeId. The key used in exporting
@anObject is @exportKey. If the
context is not capable of exporting an object, an exception is thrown.
- nullIor
- Answers a Smalltalk form of an
::IOP::IOR, representing a null object
reference.
When interacting with an ORB from a particular vendor running on a
particular machine, you might want to forge an IOR directly rather than use a
naming service or a common file system. Note that this is not a safe or
approved mechanism for general CORBA interactions and relies on
vendor-specific details of how they construct their object keys in
IORs. If you really require this facility, the following API in the
SstIor class might help:
- at: location key:
key typeId: typeId
- Answers an instance of the receiver with the type ID information set to
@typeId. The profile information for the answer is
contructed from the @location information identifying the
machine location and the @key information specifying the
object's unique ID at that location.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]