Release 5.  Copyright ©1994-1998 by TipTop Software, Inc.  All Rights Reserved.






TTReceptionist




Inherits From: NSObject
Conforms To: TTReceptionistProtocol
Declared In: <ObjSysCore/TTReceptionist.h>




Class Description

TTReceptionist provides a "standard" way of vending objects (e.g., interpreters) over DO to other applications.  The main functionality of this class is encapsulated in the TTReceptionistProtocol.

Here is a simple server implemented in ObjTcl which uses TTReceptionist to vend its interpreter:

set rv [TTReceptionist sharedInstance]
$rv setConnectionName: [@ "TestConn"]
$rv setObject: $interp forKey: [@ "ObjTclInterp"]
# If you are not running from AppKit, you have to run explicitly:
[NSRunLoop currentRunLoop] run

You can then use robjtclsh to connect to the interp:

robjtclsh TestConn

You can also use TTExecutor (see method -connectToRemoteInterp) to access a remote intepreter which is vended this way.  Or, if you want to access an interpreter directly inside your program, to get a proxy to the interp object, do:

rv=[NSConnection rootProxyForConnectionWithRegisteredName:@"TestConn" host: ...];
interp=[rv objectForKey:@"ObjTclInterp" forClient:self];
... use interp

Security.  By default, TTReceptionist authenticates remote clients using an rlogin-like mechanism.  Hence, in order to be able to connect to an interpreter on a different machine, you may need to set the ~/.rhosts file appropriately.  See the rlogin(1) man page.

Note that although the rlogin-like authentication used by TTReceptionist provides a degree of security, it is not as secure as the the rlogin authentication.  The authentication mechanism can be replaced by a custom authentication mechanism.




Method Types

+ sharedReceptionist
connection
connectionName
- objectForKey:forClient:
setConnectionName:
setObject:forKey:authenticator:




Class Methods

sharedReceptionist
+ sharedReceptionist

Returns the shared TTReceptionist instance, creating it if needed.




Instance Methods

connection
  (NSConnection *)connection

Returns the connection object.




connectionName
  (NSString *)connectionName

Returns the connection name.




objectForKey:forClient:
  (id)objectForKey:(NSString*)name forClient:(id)client

Returns the object vended under name, or nil if such an object does not exist.  The client object may be queried for authentication purposes.

See also:  -setObject:forKey:authenticator:




setConnectionName:
  (NSString*)setConnectionName:(NSString*)name

Specifies the connection name to be used by the TTReceptionist.  Returns the actual connection name, which may be different from name, e.g., if name cannot be registered with the name server.

See also:  -connectionName




setObject:forKey:authenticator:
  (void)setObject:(id)object forKey:(NSString*)name authenticator:(id)auth

Associates object with name.

See also:  -objectForKey:forClient:




###