TAO_COIOP_Connector Class Reference

COIOP-specific Connector bridge for pluggable protocols. More...

#include <COIOP_Connector.h>

Inheritance diagram for TAO_COIOP_Connector:

Inheritance graph
[legend]
Collaboration diagram for TAO_COIOP_Connector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_COIOP_Connector (void)
 Constructor.

 ~TAO_COIOP_Connector (void)
 Destructor.

The TAO_Connector Methods
Please check the documentation in Transport_Connector.h for details.

int open (TAO_ORB_Core *orb_core)
int close (void)
TAO_Profilecreate_profile (TAO_InputCDR &cdr)
virtual int check_prefix (const char *endpoint)
virtual char object_key_delimiter (void) const

Protected Member Functions

int cancel_svc_handler (TAO_Connection_Handler *svc_handler)
 Cancel the passed cvs handler from the connector.

More TAO_Connector Methods
Please check the documentation in Transport_Connector.h for details.

int set_validate_endpoint (TAO_Endpoint *ep)
TAO_Transportmake_connection (TAO::Profile_Transport_Resolver *r, TAO_Transport_Descriptor_Interface &desc, ACE_Time_Value *timeout=0)
virtual TAO_Profilemake_profile (void)

Private Member Functions

TAO_COIOP_Endpointremote_endpoint (TAO_Endpoint *ep)
 Return the remote endpoint, a helper function.


Detailed Description

COIOP-specific Connector bridge for pluggable protocols.

Concrete instance of the TAO_Connector class. Responsible for establishing a connection with a server and is called from the Connector_Registory.

Definition at line 47 of file COIOP_Connector.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_COIOP_Connector::TAO_COIOP_Connector void   ) 
 

Constructor.

Definition at line 25 of file COIOP_Connector.cpp.

References TAO_TAG_COIOP_PROFILE.

00026   : TAO_Connector (TAO_TAG_COIOP_PROFILE)
00027 {
00028 }

TAO_COIOP_Connector::~TAO_COIOP_Connector void   ) 
 

Destructor.

Definition at line 30 of file COIOP_Connector.cpp.

00031 {
00032 }


Member Function Documentation

int TAO_COIOP_Connector::cancel_svc_handler TAO_Connection_Handler svc_handler  )  [protected, virtual]
 

Cancel the passed cvs handler from the connector.

Implements TAO_Connector.

Definition at line 158 of file COIOP_Connector.cpp.

00160 {
00161   return 0;
00162 }

int TAO_COIOP_Connector::check_prefix const char *  endpoint  )  [virtual]
 

Implements TAO_Connector.

Definition at line 112 of file COIOP_Connector.cpp.

References ACE_OS::strchr(), ACE_OS::strlen(), and ACE_OS::strncasecmp().

00113 {
00114   // Check for a valid string
00115   if (!endpoint || !*endpoint)
00116     return -1;  // Failure
00117 
00118   const char *protocol[] = { "COIOP", "COIOPloc" };
00119 
00120   size_t const slot = ACE_OS::strchr (endpoint, ':') - endpoint;
00121 
00122   size_t const len0 = ACE_OS::strlen (protocol[0]);
00123   size_t const len1 = ACE_OS::strlen (protocol[1]);
00124 
00125   // Check for the proper prefix in the IOR.  If the proper prefix
00126   // isn't in the IOR then it is not an IOR we can use.
00127   if (slot == len0
00128       && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0)
00129     return 0;
00130   else if (slot == len1
00131            && ACE_OS::strncasecmp (endpoint, protocol[1], len1) == 0)
00132     return 0;
00133 
00134   return -1;
00135   // Failure: not an COIOP IOR
00136   // DO NOT throw an exception here.
00137 }

int TAO_COIOP_Connector::close void   )  [virtual]
 

Implements TAO_Connector.

Definition at line 47 of file COIOP_Connector.cpp.

00048 {
00049   return 0;
00050 }

TAO_Profile * TAO_COIOP_Connector::create_profile TAO_InputCDR cdr  )  [virtual]
 

Implements TAO_Connector.

Definition at line 74 of file COIOP_Connector.cpp.

References TAO_Profile::_decr_refcnt(), ACE_NEW_RETURN, and TAO_Profile::decode().

00075 {
00076   TAO_Profile *pfile = 0;
00077   ACE_NEW_RETURN (pfile,
00078                   TAO_COIOP_Profile (this->orb_core ()),
00079                   0);
00080 
00081   int const r = pfile->decode (cdr);
00082   if (r == -1)
00083     {
00084       pfile->_decr_refcnt ();
00085       pfile = 0;
00086     }
00087 
00088   return pfile;
00089 }

TAO_Transport * TAO_COIOP_Connector::make_connection TAO::Profile_Transport_Resolver r,
TAO_Transport_Descriptor_Interface desc,
ACE_Time_Value timeout = 0
[protected, virtual]
 

Implements TAO_Connector.

Definition at line 65 of file COIOP_Connector.cpp.

00068 {
00069   // No remote connection possible with COIOP
00070   return 0;
00071 }

TAO_Profile * TAO_COIOP_Connector::make_profile void   )  [protected, virtual]
 

Implements TAO_Connector.

Definition at line 92 of file COIOP_Connector.cpp.

References ACE_NEW_THROW_EX.

00093 {
00094   // The endpoint should be of the form:
00095   //    N.n@uuid/object_key
00096   // or:
00097   //    uuid/object_key
00098 
00099   TAO_Profile *profile = 0;
00100   ACE_NEW_THROW_EX (profile,
00101                     TAO_COIOP_Profile (this->orb_core ()),
00102                     CORBA::NO_MEMORY (
00103                       CORBA::SystemException::_tao_minor_code (
00104                         TAO::VMCID,
00105                         ENOMEM),
00106                       CORBA::COMPLETED_NO));
00107 
00108   return profile;
00109 }

char TAO_COIOP_Connector::object_key_delimiter void   )  const [virtual]
 

Implements TAO_Connector.

Definition at line 140 of file COIOP_Connector.cpp.

00141 {
00142   return TAO_COIOP_Profile::object_key_delimiter_;
00143 }

int TAO_COIOP_Connector::open TAO_ORB_Core orb_core  )  [virtual]
 

Implements TAO_Connector.

Definition at line 35 of file COIOP_Connector.cpp.

References TAO_Connector::create_connect_strategy(), and TAO_Connector::orb_core().

00036 {
00037   this->orb_core (orb_core);
00038 
00039   // Create our connect strategy
00040   if (this->create_connect_strategy () == -1)
00041     return -1;
00042 
00043   return 0;
00044 }

TAO_COIOP_Endpoint * TAO_COIOP_Connector::remote_endpoint TAO_Endpoint ep  )  [private]
 

Return the remote endpoint, a helper function.

Definition at line 146 of file COIOP_Connector.cpp.

References TAO_Endpoint::tag(), and TAO_TAG_COIOP_PROFILE.

Referenced by set_validate_endpoint().

00147 {
00148   if (endpoint->tag () != TAO_TAG_COIOP_PROFILE)
00149     return 0;
00150 
00151   TAO_COIOP_Endpoint *COIOP_endpoint =
00152     dynamic_cast<TAO_COIOP_Endpoint *> (endpoint );
00153 
00154   return COIOP_endpoint;
00155 }

int TAO_COIOP_Connector::set_validate_endpoint TAO_Endpoint ep  )  [protected, virtual]
 

Implements TAO_Connector.

Definition at line 53 of file COIOP_Connector.cpp.

References remote_endpoint().

00054 {
00055   TAO_COIOP_Endpoint *COIOP_endpoint =
00056     this->remote_endpoint (endpoint);
00057 
00058   if (COIOP_endpoint == 0)
00059     return -1;
00060 
00061   return 0;
00062 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 16:02:20 2008 for TAO_Strategies by doxygen 1.3.6