Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

MPS::Transport Class Reference

Represents a method of resolving names for, and connecting to remote objects. More...

#include <transport.h>

Inheritance diagram for MPS::Transport:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~Transport ()
string const& getName () const

Static Public Methods

void registerTransport (Transport *t)
ref<ConnectiongetConnectionTo (Address const &connectionSpec)
string bindServer (Server *server, string const &bindingSpec)
void bindServer (Server *server)
string unbindServer (Server *server, string const &bindingSpec)
void unbindServer (Server *server)

Protected Methods

 Transport (string const &_name)
virtual ref<ConnectionconnectTo (Address const &connectionSpec)=0
virtual string registerServer (Server *server, Address const &spec)=0
virtual string deregisterServer (Server *server, Address const &spec)=0

Private Types

typedef vector<Transport *> transportVec_t

Private Attributes

string name

Static Private Methods

Transport* findTransport (string const &name)

Static Private Attributes

transportVec_t allTransports

Detailed Description

Represents a method of resolving names for, and connecting to remote objects.

Subclasses implement name-resolution and connection facilities according to a particular transport protocol; examples include InetTransport, SleeTransport, and FastmsgTransport.

Definition at line 46 of file transport.h.


Member Typedef Documentation

typedef vector< Transport *> MPS::Transport::transportVec_t<Transport *> [private]
 

A list of Transports.

Definition at line 48 of file transport.h.


Constructor & Destructor Documentation

MPS::Transport::Transport ( string const & _name ) [protected]
 

For access by subclasses - initialises this class.

Parameters:
_name   name to register the transport under

virtual MPS::Transport::~Transport ( ) [virtual]
 


Member Function Documentation

void MPS::Transport::bindServer ( Server * server ) [static]
 

Bind an object server to all available transports that currently do not have a binding for this server.

Parameters:
server   the server to bind

string MPS::Transport::bindServer ( Server * server,
string const & bindingSpec ) [static]
 

Bind an object server to an interface provided by a transport.

Parameters:
server   the server to bind to the (about-to-be-created) transport-interface
bindingSpec   the suggested resolved name to bind to - should be of the form "mps:transportname" or, if a greater degree of control over the bind is desired, "mps:transportname:param:param:..." (for instance, with the "inet" transport, you use "mps:inet:hostname:portnumber").

Returns:
the string of the newly-bound address, or empty-string if the bind failed

Referenced by main().

ref< Connection > MPS::Transport::connectTo ( Address const & connectionSpec ) [protected, pure virtual]
 

Returns a message source/sink that can be used for communication with the object at the address described by the connectionSpec.

The connectionSpec is the broken-down resolved name of the remote object, and must match the address format that this transport expects.

Parameters:
connectionSpec   the address of the remote object
Returns:
a connection handle for remote communication, or NULL if none could be created

Reimplemented in MPS::FastmsgTransport, MPS::InetTransport, and MPS::SimplTransport.

string MPS::Transport::deregisterServer ( Server * server,
Address const & spec ) [protected, pure virtual]
 

Attempt to deregister a server interface.

Parameters:
server   the server to deregister
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when unbinding this object.
Returns:
the canonical name of the server-that-was-bound-to-this-transport, or "" if unbinding from this transport fails.

Reimplemented in MPS::FastmsgTransport, MPS::InetTransport, and MPS::SimplTransport.

Transport* MPS::Transport::findTransport ( string const & name ) [static, private]
 

Locate a Transport by name.

Returns:
a pointer to the named Transport.
Exceptions:
MPSException   if the Transport name is not registered.

ref<Connection> MPS::Transport::getConnectionTo ( Address const & connectionSpec ) [static]
 

Returns a message source/sink that can be used for communication with the object at the address described by the connectionSpec.

Selects an appropriate Transport based on the "transport" field of the Address.

Parameters:
connectionSpec   the address of the remote object
Returns:
a connection handle for remote communication, or NULL if none could be created
Exceptions:
MPSException   if the transport name given is not registered

string const & MPS::Transport::getName ( ) const
 

Retrieves the transport's registered name.

string MPS::Transport::registerServer ( Server * server,
Address const & spec ) [protected, pure virtual]
 

Attempt to register a server interface for access using this transport.

Parameters:
server   the server to register
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when binding this object.
Returns:
the canonical name of the server-bound-to-this-transport, or "" if binding to this transport fails.

Reimplemented in MPS::FastmsgTransport, MPS::InetTransport, and MPS::SimplTransport.

void MPS::Transport::registerTransport ( Transport * t ) [static]
 

Register a transport.

void MPS::Transport::unbindServer ( Server * server ) [static]
 

Unbind a previously-bound server.

Parameters:
server   the server to unbind.

string MPS::Transport::unbindServer ( Server * server,
string const & bindingSpec ) [static]
 

Unbind an object server from an interface provided by a transport.

Parameters:
server   the server to unbind to the (about-to-be-removed) transport-interface
bindingSpec   the suggested resolved name to unbind from - cf. bindServer()
Returns:
the string of the newly-unbound address, or empty-string if the unbind failed


Member Data Documentation

transportVec_t MPS::Transport::allTransports [static, private]
 

All registered Transports.

Definition at line 49 of file transport.h.

string MPS::Transport::name [private]
 

Registered name of this transport ("inet", "slee", ..).

Definition at line 52 of file transport.h.


The documentation for this class was generated from the following file:
Generated at Wed Aug 15 01:05:33 2001 for mps-cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001