This chapter describes the classes of the Pluggable Transport Interface provided by VisiBroker for C++. For information on how to implement support for a transport protocol via the VisiBroker Pluggable Transport Interface, see the chapter “VisiBroker Pluggable Transport Interface” in the VisiBroker C++ Developer’s Guide.This class is the abstract base class for a connection class that must be implemented for each transport protocol that is to be plugged in to VisiBroker, to allow VisiBroker to work with that particular transport protocol. Each instance of the derived class will represent a single connection between a server and a client. VisiBroker will request instances of this class be created (via the corresponding factory class, see “virtual CORBA::Boolean waitNextMessage(CORBA::ULong _timeout) = 0;”) on both the client and server side of the ORB, whenever a new connection is required.The vptrans.h file should be included to use this class.virtual void close() = 0;To be implemented by the derived connection class. This method will be called by the client-side ORB, and must communicate with the remote peer’s ‘Listener’ instance to setup a new connection on the server-side. The function does not return any error code, but should throw exceptions if any transport layer errors occur. Any exception may be thrown, including a CORBA User Exception, as the exception will be thrown back to the client CORBA application. CORBA::TRANSIENT is one possible exception that could be thrown.
virtual void flush() = 0;virtual IOP::ProfileValue_ptr getPeerProfile() = 0;virtual CORBA::Long id() = 0;virtual CORBA::Boolean isBridgeSignalling() = 0;virtual CORBA::Boolean isConnected() = 0;virtual CORBA::Boolean isDataAvailable() = 0;virtual CORBA::Boolean no_callback() = 0;virtual void read(CORBA::Boolean _isFirst, CORBA::Boolean _isLast, char* _data, CORBA::ULong _offset, CORBA::ULong _length, CORBA::ULongLong _timeout)= 0;
To be implemented by the derived connection class. This method is used to tell a newly created client-side connection object what peer it should try to connect to in later steps (when connect() is called.) The given VISPTransProfileBase_ptr base class should be cast to the Profile class type of the particular transport and all member data in the connection should be initialized from that instance. A prefix string is also passed, for property lookup, in case additional property parameters need to be read.
String prefix of the form “vbroker.se.<SE_name>.scm.<SCM_name>” that the method can use to read any protocol-specific VisiBroker properties that may have been set to configure this instance. To be implemented by the derived connection class. This method should block the calling thread until either data has arrived on this connection or the given timeout (in milliseconds) has expired. It should return 1 (TRUE) if data is available, or 0 (FALSE) if not. Note that a value of 0 for the _timeout parameter should never occur (as in this case the ORB should not call this method). Therefore receiving this value should be handled as an error, perhaps by logging an error message.
virtual void write(CORBA::Boolean _isFirst, CORBA::Boolean _isLast, char* _data, CORBA::ULong _offset, CORBA::ULong _length, CORBA::ULongLong _timeout) = 0;
This class is the abstract base class for a connection factory class that must be implemented for each transport protocol that is to be plugged in to VisiBroker, to allow VisiBroker to work with that particular transport protocol. A singleton instance of the derived class is registered with VisiBroker, via the “VISPTransRegistrar” class. The ORB calls the connection factory object to create instances of the connection class of the associated transport. The connection class is the corresponding class derived from class VISPTransConnection.The vptrans.h file should be included to use this class.
String prefix of the form “vbroker.se.<SE_name>.scm.<SCM_name>” that the method can use to read any protocol-specific VisiBroker properties that may have been set to configure the connection factory.This class is the abstract base class for a listener factory that must be implemented for each transport protocol that is to be plugged in to VisiBroker, to allow VisiBroker to work with that particular transport protocol. Instances of the derived class are created each time a Server Engine is created that includes Server Connection Managers (‘SCMs’) that specify the particular transport protocol. One instance is created per SCM instance that specifies the protocol. The listener instances are used by the server-side ORB to wait for incoming connections and requests from clients. New connections and requests on existing connections are signaled by the listener to the ORB via the Pluggable Transport Interface’s Bridge class (see “VISPTransBridge”). When a request is received on an existing connection, the connection goes through a ‘Dispatch Cycle’. The Dispatch Cycle starts when the connection delivers data to the transport layer. In this initial state, the arrival of this data must be signaled to the ORB via the Bridge and then the Listener ignores the connection until the Dispatch process is completed (in the mean time, the connection is said to be in the ‘dispatch state’). The connection is returned to the initial state when the ORB makes a call to the Listener’s completedData() method. During the dispatch state the ORB will read directly from the connection until all requests are exhausted, avoiding any overhead incurred by the Bridge-Listener communication. In most cases, the transport layer uses blocking calls that wait for new connections. In order to handle this situation, the Listener should be made a subclass of the class VISThread and start a separate thread of execution that can be blocked without holding up the whole ORB.The vptrans.h file should be included to use this class.
virtual void destroy() = 0;virtual IOP::ProfileValue_ptr getListenerProfile() = 0;virtual CORBA::Boolean isDataAvailable(CORBA::Long id) = 0;
This class is the abstract base class for a listener factory class that must be implemented for each transport protocol that is to be plugged in to VisiBroker, to allow VisiBroker to work with that particular transport protocol. A singleton instance of the derived class is registered with VisiBroker, via the VISPTransRegistrar class. The ORB calls this object to create instances of the listener class of the associated transport. The listener class is the corresponding class derived from class VISPTransListener, as described in “VISPTransListener”.The vptrans.h file should be included to use this class.
String prefix of the form “vbroker.se.<SE_name>.scm.<SCM_name>” that the method can use to read any protocol-specific VisiBroker properties that may have been set to configure the listener instance or the particular listener instance that is being created. Note that the factory can pass the prefix into the constructor of the listener instance it is creating, to allow it to read properties itself. This would require the derived listener class to have a constructor that takes the prefix as a parameter.class VISPTransProfileBase : public GIOP::ProfileBodyValue, public CORBA_DefaultValueRefCountBaseThe vptrans.h file should be included to use this class.
GIOP::ObjectKey_var object_key() const;
GIOP::Version& version();const GIOP::Version& version() const;static const VISValueInfo& _info();static const VISValueInfo& _stat_info;IOP::ProfileValue_ptr copy()
IOP::ProfileId tag()IOP::TaggedProfile* toTaggedProfile();
This class is the abstract base class for a Profile factory class that must be implemented for each transport protocol that is to be plugged in to VisiBroker, to allow VisiBroker to work with that particular transport protocol. A singleton instance of the derived class is registered with VisiBroker, via the VISPTransRegistrar class. The ORB calls this object to create instances of the Profile class of the associated transport. The Profile class is the corresponding class derived from class VISPTransProfileBase, as described in“VISPTransProfileBase”.The vptrans.h file should be included to use this class.
IOP::ProfileId getTag();The vptrans.h file should be included to use this class.
void signalDataAvailable(CORBA::Long conId);
The vptrans.h file should be included to use this class.static void addTransport(const char* protocolName, VISPTransConnectionFactory* connFac, VISPTransListenerFactory* listFac, VISPTransProfileFactory* profFac);