TAO  2.3.3
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TAO_Connector Class Referenceabstract

Generic Connector interface definitions. More...

#include <Transport_Connector.h>

Inheritance diagram for TAO_Connector:
Inheritance graph
[legend]
Collaboration diagram for TAO_Connector:
Collaboration graph
[legend]

Public Member Functions

 TAO_Connector (CORBA::ULong tag)
 Default constructor. More...
 
virtual ~TAO_Connector (void)
 The destructor. More...
 
CORBA::ULong tag (void) const
 
int make_mprofile (const char *ior, TAO_MProfile &mprofile)
 
virtual TAO_Profilecorbaloc_scan (const char *ior, size_t &len)
 
virtual int open (TAO_ORB_Core *orb_core)=0
 Initialize object and register with reactor. More...
 
virtual int close (void)=0
 Shutdown Connector bridge and concrete Connector. More...
 
virtual TAO_Transportconnect (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *timeout)
 
virtual TAO_Transportparallel_connect (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *timeout)
 
virtual TAO_Profilecreate_profile (TAO_InputCDR &cdr)=0
 
virtual int check_prefix (const char *endpoint)=0
 
virtual char object_key_delimiter (void) const =0
 Return the object key delimiter to use or expect. More...
 

Protected Member Functions

virtual int supports_parallel_connects (void) const
 
virtual TAO_Profilemake_profile (void)=0
 Create a profile with a given endpoint. More...
 
virtual int set_validate_endpoint (TAO_Endpoint *endpoint)=0
 
virtual TAO_Transportmake_connection (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface &desc, ACE_Time_Value *timeout)=0
 Make a connection. More...
 
virtual TAO_Transportmake_parallel_connection (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface &desc, ACE_Time_Value *timeout)
 
virtual int cancel_svc_handler (TAO_Connection_Handler *svc_handler)=0
 Cancel the passed svc_handler from the connector. More...
 
virtual int check_connection_closure (TAO_Connection_Handler *connection_handler)
 Check whether the connection is not closed. More...
 
virtual bool wait_for_connection_completion (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface &desc, TAO_Transport *&transport, ACE_Time_Value *timeout)
 
virtual bool wait_for_connection_completion (TAO::Profile_Transport_Resolver *r, TAO_Transport *&the_winner, TAO_Transport **transport, unsigned int count, TAO_LF_Multi_Event *mev, ACE_Time_Value *timeout)
 
void cleanup_pending (TAO_Transport *&the_winner, TAO_Transport **transport, unsigned int count)
 
bool new_connection_is_ok (size_t busy_count)
 See if a new connection is allowed. More...
 
bool wait_for_transport (TAO::Profile_Transport_Resolver *r, TAO_Transport *base_transport, ACE_Time_Value *timeout, bool force_wait)
 
void orb_core (TAO_ORB_Core *orb_core)
 Set the ORB Core pointer. More...
 
int create_connect_strategy (void)
 Create a connect strategy. More...
 
TAO_ORB_Coreorb_core (void)
 Return the TAO_ORB_Core pointer. More...
 

Protected Attributes

TAO_Connect_Strategyactive_connect_strategy_
 The (a)synch connect strategy. More...
 

Private Attributes

CORBA::ULong const tag_
 IOP protocol tag. More...
 
TAO_ORB_Coreorb_core_
 Pointer to our ORB core. More...
 

Detailed Description

Generic Connector interface definitions.

Base class for connector bridge object.

Todo:
Need to rename the class as TAO_Transport_Connector.

Constructor & Destructor Documentation

TAO_Connector::TAO_Connector ( CORBA::ULong  tag)

Default constructor.

TAO_Connector::~TAO_Connector ( void  )
virtual

The destructor.

Member Function Documentation

virtual int TAO_Connector::cancel_svc_handler ( TAO_Connection_Handler svc_handler)
protectedpure virtual

Cancel the passed svc_handler from the connector.

Implemented in TAO_IIOP_Connector.

int TAO_Connector::check_connection_closure ( TAO_Connection_Handler connection_handler)
protectedvirtual

Check whether the connection is not closed.

Return values
0The connection happens to be not closed, but is now open because an other thread managed to open the handler
-1The connection is closed
virtual int TAO_Connector::check_prefix ( const char *  endpoint)
pure virtual

Check that the prefix of the provided endpoint is valid for use with a given pluggable protocol.

Implemented in TAO_IIOP_Connector.

void TAO_Connector::cleanup_pending ( TAO_Transport *&  the_winner,
TAO_Transport **  transport,
unsigned int  count 
)
protected

For a parallel connection attempt, any pending connection attempts present when the connection completes needs to be cleaned up. In some cases this happens before wait_for_connection_completion needs to be called, so the clean up logic is separated out here.

virtual int TAO_Connector::close ( void  )
pure virtual

Shutdown Connector bridge and concrete Connector.

Implemented in TAO_IIOP_Connector.

TAO_Transport * TAO_Connector::connect ( TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
ACE_Time_Value timeout 
)
virtual

To support pluggable we need to abstract away the details of the connect () method so it can be called from the invocation code independent of the actual transport protocol in use.

TAO_Profile * TAO_Connector::corbaloc_scan ( const char *  ior,
size_t &  len 
)
virtual

Helper function to assist corbaloc parsing. The default simply validates the protocol identifier and scans up to the next comma or slash. Any protocol that has a specific need, such as uiop, can override this method to provide a custom scanner. The profile returned is either null if this the ior does not match or an empty profile of the correct type, obtained from make_profile().

int TAO_Connector::create_connect_strategy ( void  )
protected

Create a connect strategy.

virtual TAO_Profile* TAO_Connector::create_profile ( TAO_InputCDR cdr)
pure virtual

Create a profile for this protocol and initialize it based on the encapsulation in cdr

Implemented in TAO_IIOP_Connector.

virtual TAO_Transport* TAO_Connector::make_connection ( TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
ACE_Time_Value timeout 
)
protectedpure virtual

Make a connection.

Implemented in TAO_IIOP_Connector.

int TAO_Connector::make_mprofile ( const char *  ior,
TAO_MProfile mprofile 
)

Parse a string containing a URL style IOR and return an MProfile. Verify that ior is in the correct format.

TAO_Transport * TAO_Connector::make_parallel_connection ( TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
ACE_Time_Value timeout 
)
protectedvirtual

Make a connection using - not a pure virtual since not all protocols support this.

Reimplemented in TAO_IIOP_Connector.

virtual TAO_Profile* TAO_Connector::make_profile ( void  )
protectedpure virtual

Create a profile with a given endpoint.

Implemented in TAO_IIOP_Connector.

bool TAO_Connector::new_connection_is_ok ( size_t  busy_count)
protected

See if a new connection is allowed.

virtual char TAO_Connector::object_key_delimiter ( void  ) const
pure virtual

Return the object key delimiter to use or expect.

Implemented in TAO_IIOP_Connector.

virtual int TAO_Connector::open ( TAO_ORB_Core orb_core)
pure virtual

Initialize object and register with reactor.

Implemented in TAO_IIOP_Connector.

void TAO_Connector::orb_core ( TAO_ORB_Core orb_core)
protected

Set the ORB Core pointer.

TAO_ORB_Core * TAO_Connector::orb_core ( void  )
protected

Return the TAO_ORB_Core pointer.

TAO_Transport * TAO_Connector::parallel_connect ( TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
ACE_Time_Value timeout 
)
virtual

A variation on connect that will try simultaneous connections on all endpoints listed in the desc.

virtual int TAO_Connector::set_validate_endpoint ( TAO_Endpoint endpoint)
protectedpure virtual

Set and validate endpoint. We need to do this to initialize our remote *_Addr's which have not been done during IOR decode.

Implemented in TAO_IIOP_Connector.

int TAO_Connector::supports_parallel_connects ( void  ) const
protectedvirtual

A flag indicating the actual connector supports parallel connection attempts. The base implementation always returns 0. Override to return non-zero if parallel connection attempts may be tried.

Reimplemented in TAO_IIOP_Connector.

CORBA::ULong TAO_Connector::tag ( void  ) const

The tag identifying the specific ORB transport layer protocol. For example IOP::TAG_INTERNET_IOP == 0. The tag is used in the IOR to identify the type of profile included. IOR -> {{tag0, profile0} {tag1, profile1} ...}. The IOP module defines the ProfileId typedef to be a CORBA::ULong.

bool TAO_Connector::wait_for_connection_completion ( TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
TAO_Transport *&  transport,
ACE_Time_Value timeout 
)
protectedvirtual

Wait for connection completion. We have a transport that is not connected yet, wait until it is connected.

Return values
trueWhen we could use transport
Returns
false When we can't use the transport
bool TAO_Connector::wait_for_connection_completion ( TAO::Profile_Transport_Resolver r,
TAO_Transport *&  the_winner,
TAO_Transport **  transport,
unsigned int  count,
TAO_LF_Multi_Event mev,
ACE_Time_Value timeout 
)
protectedvirtual

In the case of a parallel connection attempt, we take an array of transports, and wait on any of them. When the first one completes, the rest are closed.

bool TAO_Connector::wait_for_transport ( TAO::Profile_Transport_Resolver r,
TAO_Transport base_transport,
ACE_Time_Value timeout,
bool  force_wait 
)
protected

Wait for a transport to be connected Note: no longer changes transport reference count

Return values
trueif wait was uneventful
falseif error occurred during wait

Member Data Documentation

TAO_Connect_Strategy* TAO_Connector::active_connect_strategy_
protected

The (a)synch connect strategy.

TAO_ORB_Core* TAO_Connector::orb_core_
private

Pointer to our ORB core.

CORBA::ULong const TAO_Connector::tag_
private

IOP protocol tag.


The documentation for this class was generated from the following files: