TAO_AV_Core Class Reference

This class encapsulates access to the TAO AV Core's resources and its state. More...

#include <AV_Core.h>

Collaboration diagram for TAO_AV_Core:

Collaboration graph
[legend]
List of all members.

Public Types

enum  EndPoint { TAO_AV_ENDPOINT_A, TAO_AV_ENDPOINT_B }
enum  Protocol {
  TAO_AV_NOPROTOCOL = -1, TAO_AV_TCP = 0, TAO_AV_UDP = 1, TAO_AV_AAL5 = 2,
  TAO_AV_AAL3_4 = 3, TAO_AV_AAL1 = 4, TAO_AV_RTP_UDP = 5, TAO_AV_RTP_AAL5 = 6,
  TAO_AV_IPX = 7, TAO_AV_SFP_UDP = 8, TAO_AV_UDP_MCAST = 9, TAO_AV_RTP_UDP_MCAST = 10,
  TAO_AV_SFP_UDP_MCAST = 11, TAO_AV_QOS_UDP = 12, TAO_AV_USERDEFINED_UDP = 13, TAO_AV_USERDEFINED_UDP_MCAST = 14,
  TAO_AV_SCTP_SEQ = 15
}
enum  Flow_Component { TAO_AV_DATA = 1, TAO_AV_CONTROL = 2, TAO_AV_BOTH = 3 }

Public Member Functions

 TAO_AV_Core (void)
 Default constructor.

 ~TAO_AV_Core (void)
 Destructor.

int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
int run (void)
int stop_run (void)
int init_forward_flows (TAO_Base_StreamEndPoint *endpoint, TAO_AV_FlowSpecSet &flow_spec_set, EndPoint direction, AVStreams::flowSpec &flow_spec)
int init_reverse_flows (TAO_Base_StreamEndPoint *endpoint, TAO_AV_FlowSpecSet &forward_flow_spec_set, TAO_AV_FlowSpecSet &reverse_flow_spec_set, EndPoint direction)
int init_transport_factories (void)
int init_flow_protocol_factories (void)
int load_default_transport_factories (void)
int load_default_flow_protocol_factories (void)
TAO_AV_Acceptorget_acceptor (const char *flowname)
 = Get the acceptor registry

TAO_AV_Connectorget_connector (const char *flowname)
int remove_acceptor (const char *flowname)
int remove_connector (const char *flowname)
TAO_AV_Connector_Registryconnector_registry (void)
TAO_FlowSpec_Entryget_flow_spec_entry (TAO_AV_FlowSpecSet &flow_spec_set, const char *flowname)
TAO_AV_Acceptor_Registryacceptor_registry (void)
TAO_AV_Flow_Protocol_Factoryget_flow_protocol_factory (const char *flow_protocol)
 = Set/get the .

TAO_AV_Transport_Factoryget_transport_factory (const char *transport_protocol)
TAO_AV_Flow_ProtocolFactorySetflow_protocol_factories (void)
TAO_AV_TransportFactorySettransport_factories (void)
void reactor (ACE_Reactor *r)
ACE_Reactorreactor (void)
CORBA::ORB_ptr orb (void)
void orb (CORBA::ORB_ptr orb_)
PortableServer::POA_ptr poa (void)
void poa (PortableServer::POA_ptr poa_)

Static Public Member Functions

int deactivate_servant (PortableServer::Servant servant)
char * get_flowname (const char *flow_spec_entry_str)
ACE_CString get_control_flowname (const char *flowname)

Protected Attributes

TAO_AV_Connector_Registryconnector_registry_
TAO_AV_Acceptor_Registryacceptor_registry_
TAO_AV_TransportFactorySet transport_factories_
 Pointer to the list of transports loaded into this AV_Core instance.

TAO_AV_Flow_ProtocolFactorySet flow_protocol_factories_
 Pointer to the list of flow protocol loaded into this AV_Core instance.

ACE_Reactorreactor_
CORBA::ORB_var orb_
PortableServer::POA_var poa_
CORBA::Boolean stop_run_

Detailed Description

This class encapsulates access to the TAO AV Core's resources and its state.

Definition at line 58 of file AV_Core.h.


Member Enumeration Documentation

enum TAO_AV_Core::EndPoint
 

Enumeration values:
TAO_AV_ENDPOINT_A 
TAO_AV_ENDPOINT_B 

Definition at line 61 of file AV_Core.h.

enum TAO_AV_Core::Flow_Component
 

Enumeration values:
TAO_AV_DATA 
TAO_AV_CONTROL 
TAO_AV_BOTH 

Definition at line 84 of file AV_Core.h.

00085   {
00086     TAO_AV_DATA = 1,
00087     TAO_AV_CONTROL = 2,
00088     TAO_AV_BOTH = 3
00089   };

enum TAO_AV_Core::Protocol
 

Enumeration values:
TAO_AV_NOPROTOCOL 
TAO_AV_TCP 
TAO_AV_UDP 
TAO_AV_AAL5 
TAO_AV_AAL3_4 
TAO_AV_AAL1 
TAO_AV_RTP_UDP 
TAO_AV_RTP_AAL5 
TAO_AV_IPX 
TAO_AV_SFP_UDP 
TAO_AV_UDP_MCAST 
TAO_AV_RTP_UDP_MCAST 
TAO_AV_SFP_UDP_MCAST 
TAO_AV_QOS_UDP 
TAO_AV_USERDEFINED_UDP 
TAO_AV_USERDEFINED_UDP_MCAST 
TAO_AV_SCTP_SEQ 

Definition at line 63 of file AV_Core.h.

00064   {
00065     TAO_AV_NOPROTOCOL = -1,
00066     TAO_AV_TCP        =  0,
00067     TAO_AV_UDP        =  1,
00068     TAO_AV_AAL5       =  2,
00069     TAO_AV_AAL3_4     =  3,
00070     TAO_AV_AAL1       =  4,
00071     TAO_AV_RTP_UDP    =  5,
00072     TAO_AV_RTP_AAL5   =  6,
00073     TAO_AV_IPX        =  7,
00074     TAO_AV_SFP_UDP    =  8,
00075     TAO_AV_UDP_MCAST  =  9,
00076     TAO_AV_RTP_UDP_MCAST = 10,
00077     TAO_AV_SFP_UDP_MCAST = 11,
00078     TAO_AV_QOS_UDP       = 12,
00079     TAO_AV_USERDEFINED_UDP = 13,
00080     TAO_AV_USERDEFINED_UDP_MCAST = 14,
00081     TAO_AV_SCTP_SEQ =  15
00082   };


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_AV_Core::TAO_AV_Core void   ) 
 

Default constructor.

Definition at line 33 of file AV_Core.cpp.

References ACE_NEW.

00034   :connector_registry_ (0),
00035    acceptor_registry_ (0)
00036 {
00037   ACE_NEW (this->connector_registry_,
00038            TAO_AV_Connector_Registry
00039            );
00040   ACE_NEW (this->acceptor_registry_,
00041            TAO_AV_Acceptor_Registry
00042            );
00043 }

TAO_AV_Core::~TAO_AV_Core void   ) 
 

Destructor.

Definition at line 45 of file AV_Core.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), flow_protocol_factories_, TAO_AV_Flow_ProtocolFactorySetItor, TAO_AV_TransportFactorySetItor, and transport_factories_.

00046 {
00047   delete this->connector_registry_;
00048   delete this->acceptor_registry_;
00049 
00050   TAO_AV_TransportFactorySetItor transport_iter =
00051       this->transport_factories_.begin();
00052 
00053   while (transport_iter != this->transport_factories_.end())
00054     {
00055       if ((*transport_iter)->factory()->ref_count != 1)
00056         {
00057           delete (*transport_iter)->factory();
00058         }
00059       delete (*transport_iter);
00060       transport_iter++;
00061     }
00062 
00063   TAO_AV_Flow_ProtocolFactorySetItor flow_iter =
00064       this->flow_protocol_factories_.begin();
00065 
00066   while (flow_iter != this->flow_protocol_factories_.end())
00067     {
00068       if ((*flow_iter)->factory()->ref_count != 1)
00069         {
00070           delete (*flow_iter)->factory();
00071         }
00072       delete (*flow_iter);
00073 
00074       flow_iter++;
00075     }
00076 }


Member Function Documentation

TAO_AV_Acceptor_Registry * TAO_AV_Core::acceptor_registry void   ) 
 

Definition at line 109 of file AV_Core.cpp.

00110 {
00111   return this->acceptor_registry_;
00112 }

TAO_AV_Connector_Registry * TAO_AV_Core::connector_registry void   ) 
 

Definition at line 103 of file AV_Core.cpp.

00104 {
00105   return this->connector_registry_;
00106 }

int TAO_AV_Core::deactivate_servant PortableServer::Servant  servant  )  [static]
 

Definition at line 1128 of file AV_Core.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, and ACE_TRY_CHECK.

01129 {
01130   // Because of reference counting, the POA will automatically delete
01131   // the servant when all pending requests on this servant are
01132   // complete.
01133 
01134   ACE_DECLARE_NEW_CORBA_ENV;
01135   ACE_TRY
01136     {
01137       PortableServer::POA_var poa = servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
01138       ACE_TRY_CHECK;
01139 
01140       PortableServer::ObjectId_var id = poa->servant_to_id (servant
01141                                                             ACE_ENV_ARG_PARAMETER);
01142       ACE_TRY_CHECK;
01143 
01144       poa->deactivate_object (id.in ()
01145                               ACE_ENV_ARG_PARAMETER);
01146       ACE_TRY_CHECK;
01147     }
01148   ACE_CATCHANY
01149     {
01150       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "deactivate_servant");
01151       return -1;
01152     }
01153   ACE_ENDTRY;
01154   ACE_CHECK_RETURN (-1);
01155   return 0;
01156 }

TAO_AV_Flow_ProtocolFactorySet * TAO_AV_Core::flow_protocol_factories void   ) 
 

Definition at line 121 of file AV_Core.cpp.

References flow_protocol_factories_.

00122 {
00123   return &this->flow_protocol_factories_;
00124 }

TAO_AV_Acceptor * TAO_AV_Core::get_acceptor const char *  flowname  ) 
 

= Get the acceptor registry

Definition at line 587 of file AV_Core.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_ENDTRY, ACE_PRINT_EXCEPTION, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, TAO_AV_Acceptor_Registry::begin(), TAO_AV_Acceptor_Registry::end(), ACE_OS::strcmp(), and TAO_AV_AcceptorSetItor.

Referenced by init_reverse_flows().

00588 {
00589 
00590   ACE_TRY_NEW_ENV
00591     {
00592 
00593       TAO_AV_AcceptorSetItor acceptor =  this->acceptor_registry_->begin ();
00594       ACE_TRY_CHECK;
00595 
00596       TAO_AV_AcceptorSetItor end =
00597         this->acceptor_registry_->end ();
00598 
00599       for (;acceptor != end; ++acceptor)
00600         {
00601           if (ACE_OS::strcmp ((*acceptor)->flowname (),flowname) == 0)
00602             return *acceptor;
00603         }
00604     }
00605   ACE_CATCHANY
00606     {
00607       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_AV_Core::get_acceptor");
00608     }
00609   ACE_ENDTRY;
00610   return 0;
00611 }

TAO_AV_Connector * TAO_AV_Core::get_connector const char *  flowname  ) 
 

Definition at line 644 of file AV_Core.cpp.

References TAO_AV_Connector_Registry::begin(), TAO_AV_Connector_Registry::end(), ACE_OS::strcmp(), and TAO_AV_ConnectorSetItor.

00645 {
00646   TAO_AV_ConnectorSetItor connector =
00647     this->connector_registry_->begin ();
00648   TAO_AV_ConnectorSetItor end =
00649     this->connector_registry_->end ();
00650 
00651   for (;connector != end; ++connector)
00652     {
00653       if (ACE_OS::strcmp ((*connector)->flowname (),flowname) == 0)
00654         return *connector;
00655     }
00656   return 0;
00657 }

ACE_CString TAO_AV_Core::get_control_flowname const char *  flowname  )  [static]
 

Definition at line 1173 of file AV_Core.cpp.

References ACE_CString.

Referenced by TAO_AV_UDP_Connector::connect(), TAO_AV_TCP_Connector::connect(), TAO_AV_UDP_Acceptor::open(), TAO_AV_TCP_Acceptor::open(), TAO_AV_UDP_Acceptor::open_default(), and TAO_AV_TCP_Acceptor::open_default().

01174 {
01175   ACE_CString control_flowname;
01176   control_flowname = "c_";
01177   control_flowname = control_flowname + flowname;
01178 
01179   return flowname;
01180 }

TAO_AV_Flow_Protocol_Factory * TAO_AV_Core::get_flow_protocol_factory const char *  flow_protocol  ) 
 

= Set/get the .

Definition at line 679 of file AV_Core.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), flow_protocol_factories_, and TAO_AV_Flow_ProtocolFactorySetItor.

Referenced by TAO_AV_Acceptor_Registry::open(), TAO_AV_Connector_Registry::open(), and TAO_AV_Acceptor_Registry::open_default().

00680 {
00681   if (flow_protocol == 0)
00682     return 0;
00683 
00684   for (TAO_AV_Flow_ProtocolFactorySetItor control_flow_factory =
00685          this->flow_protocol_factories_.begin ();
00686        control_flow_factory !=
00687          this->flow_protocol_factories_.end ();
00688        ++control_flow_factory)
00689     {
00690       if ((*control_flow_factory)->factory ()->match_protocol (flow_protocol))
00691         {
00692           return (*control_flow_factory)->factory ();
00693         }
00694     }
00695 
00696   // Not found.
00697   return 0;
00698 }

TAO_FlowSpec_Entry * TAO_AV_Core::get_flow_spec_entry TAO_AV_FlowSpecSet flow_spec_set,
const char *  flowname
 

Definition at line 571 of file AV_Core.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), ACE_OS::strcmp(), TAO_AV_FlowSpecSet, and TAO_AV_FlowSpecSetItor.

Referenced by init_reverse_flows().

00573 {
00574   TAO_AV_FlowSpecSetItor end = flow_spec_set.end ();
00575   TAO_AV_FlowSpecSetItor begin = flow_spec_set.begin ();
00576   for (;
00577        begin != end;
00578        ++begin)
00579     {
00580       if (ACE_OS::strcmp ((*begin)->flowname (),flowname) == 0)
00581         return (*begin);
00582     }
00583   return 0;
00584 }

char * TAO_AV_Core::get_flowname const char *  flow_spec_entry_str  )  [static]
 

Definition at line 1160 of file AV_Core.cpp.

References ACE_CString, and CORBA::string_dup().

01161 {
01162   ACE_CString flow_spec_entry (flow_spec_entry_str);
01163   int slash_pos = flow_spec_entry.find ('\\');
01164   ACE_CString flow_name;
01165   if (slash_pos != flow_spec_entry.npos)
01166     flow_name = flow_spec_entry.substring (0, slash_pos);
01167   else
01168     flow_name = flow_spec_entry_str;
01169   return CORBA::string_dup (flow_name.c_str ());
01170 }

TAO_AV_Transport_Factory * TAO_AV_Core::get_transport_factory const char *  transport_protocol  ) 
 

Definition at line 701 of file AV_Core.cpp.

References ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), TAO_AV_TransportFactorySetItor, and transport_factories_.

Referenced by TAO_AV_Acceptor_Registry::open(), TAO_AV_Connector_Registry::open(), and TAO_AV_Acceptor_Registry::open_default().

00702 {
00703   if (transport_protocol == 0)
00704     return 0;
00705 
00706   for (TAO_AV_TransportFactorySetItor transport_factory =
00707          this->transport_factories_.begin ();
00708        transport_factory != this->transport_factories_.end ();
00709        ++transport_factory)
00710     {
00711       if ((*transport_factory)->factory ()->match_protocol (transport_protocol))
00712         {
00713           return (*transport_factory)->factory ();
00714         }
00715     }
00716 
00717   // Not found.
00718   return 0;
00719 }

int TAO_AV_Core::init CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa
 

Definition at line 156 of file AV_Core.cpp.

References CORBA::ORB::_duplicate(), ACE_DEBUG, init_flow_protocol_factories(), init_transport_factories(), LM_DEBUG, reactor(), and TAO_debug_level.

00159 {
00160   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init "));
00161   this->orb_ = CORBA::ORB::_duplicate (orb);
00162   this->poa_ = PortableServer::POA::_duplicate (poa);
00163   this->reactor (this->orb_->orb_core ()->reactor ());
00164   this->init_transport_factories ();
00165   this->init_flow_protocol_factories ();
00166   return 0;
00167 }

int TAO_AV_Core::init_flow_protocol_factories void   ) 
 

Definition at line 1079 of file AV_Core.cpp.

References ACE_CString, ACE_DEBUG, ACE_ERROR_RETURN, ACE_TEXT(), ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), flow_protocol_factories_, LM_DEBUG, LM_ERROR, load_default_flow_protocol_factories(), TAO_AV_Flow_ProtocolFactorySetItor, and TAO_debug_level.

Referenced by init().

01080 {
01081   TAO_AV_Flow_ProtocolFactorySetItor end = this->flow_protocol_factories_.end ();
01082   TAO_AV_Flow_ProtocolFactorySetItor factory = this->flow_protocol_factories_.begin ();
01083 
01084   if (factory == end)
01085     {
01086       ACE_DEBUG ((LM_DEBUG,
01087                   "Loading default flow protocol factories\n"));
01088 
01089       this->load_default_flow_protocol_factories ();
01090     }
01091   else
01092     {
01093       for (; factory != end; factory++)
01094         {
01095           const ACE_CString &name = (*factory)->name ();
01096           if (TAO_debug_level > 0)
01097             ACE_DEBUG ((LM_DEBUG,
01098                         "%s \n",
01099                         name.c_str ()));
01100 
01101           (*factory)->factory (
01102                                ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (name.c_str ()));
01103           if ((*factory)->factory () == 0)
01104             {
01105               ACE_ERROR_RETURN ((LM_ERROR,
01106                                  ACE_TEXT ("TAO (%P|%t) Unable to load ")
01107                                  ACE_TEXT ("protocol <%s>, %p\n"),
01108                                  name.c_str (), ""),
01109                                 -1);
01110             }
01111 
01112           (*factory)->factory ()->ref_count = 1;
01113 
01114           if (TAO_debug_level > 0)
01115             {
01116               ACE_DEBUG ((LM_DEBUG,
01117                           ACE_TEXT ("TAO (%P|%t) Loaded protocol <%s>\n"),
01118                           name.c_str ()));
01119             }
01120         }
01121     }
01122 
01123   return 0;
01124 }

int TAO_AV_Core::init_forward_flows TAO_Base_StreamEndPoint endpoint,
TAO_AV_FlowSpecSet flow_spec_set,
EndPoint  direction,
AVStreams::flowSpec flow_spec
 

Definition at line 170 of file AV_Core.cpp.

References ACE_CString, ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, TAO_FlowSpec_Entry::address(), ACE_Unbounded_Set< T >::begin(), TAO_FlowSpec_Entry::carrier_protocol_str(), TAO_FlowSpec_Entry::control_address(), TAO_FlowSpec_Entry::direction(), ACE_Unbounded_Set< T >::end(), TAO_Reverse_FlowSpec_Entry::entry_to_string(), TAO_AV_Flow_Handler::event_handler(), ACE_Unbounded_Set< T >::find(), TAO_FlowSpec_Entry::flow_protocol_str(), TAO_FlowSpec_Entry::flowname(), AVStreams::flowSpec, TAO_FlowSpec_Entry::format(), TAO_FlowSpec_Entry::get_peer_addr(), TAO_FlowSpec_Entry::handler(), ACE_Unbounded_Set< T >::insert(), LM_DEBUG, LM_ERROR, TAO_AV_Connector_Registry::open(), TAO_AV_Acceptor_Registry::open(), ACE_Event_Handler::reactor(), ACE_Unbounded_Set< T >::reset(), TAO_FlowSpec_Entry::role(), ACE_Unbounded_Set< T >::size(), TAO_AV_ENDPOINT_A, TAO_AV_ENDPOINT_B, TAO_AV_FlowSpecSet, TAO_AV_FlowSpecSetItor, and TAO_debug_level.

00174 {
00175   if (TAO_debug_level > 0)
00176     ACE_DEBUG ((LM_DEBUG,
00177                 "TAO_AV_Core::init_forward_flows\n"));
00178 
00179   TAO_AV_FlowSpecSet address_flow_set;
00180   TAO_AV_FlowSpecSet flow_set;
00181   TAO_AV_FlowSpecSetItor end = flow_spec_set.end ();
00182   for (TAO_AV_FlowSpecSetItor start = flow_spec_set.begin ();
00183        start != end; ++start)
00184     {
00185       TAO_FlowSpec_Entry *entry = (*start);
00186       switch (direction)
00187         {
00188         case TAO_AV_Core::TAO_AV_ENDPOINT_B:
00189           {
00190             switch (entry->direction ())
00191               {
00192               case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
00193                 {
00194                   entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
00195                   break;
00196                 }
00197               case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00198                 {
00199                   entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
00200                   break;
00201                 }
00202               }
00203             break;
00204           }
00205         case TAO_AV_Core::TAO_AV_ENDPOINT_A:
00206           {
00207             switch (entry->direction ())
00208               {
00209               case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
00210                 entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
00211                 break;
00212               case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00213                 entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
00214                 break;
00215               }
00216             break;
00217           }
00218         default:
00219           break;
00220         }
00221       ACE_Addr *address = entry->address ();
00222       if (address != 0)
00223         {
00224           if (TAO_debug_level > 0)
00225             ACE_DEBUG ((LM_DEBUG,
00226                         "address given for flow %s\n",
00227                         entry->flowname ()));
00228 
00229           address_flow_set.insert (entry);
00230         }
00231       else
00232         flow_set.insert (entry);
00233     } //End of For Loop
00234 
00235 
00236   int result = -1;
00237   switch (direction)
00238     {
00239     case TAO_AV_Core::TAO_AV_ENDPOINT_A:
00240       if (address_flow_set.size () > 0)
00241         {
00242           result = this->acceptor_registry_->open (endpoint,
00243                                                    this,
00244                                                    address_flow_set);
00245           if (result < 0)
00246             ACE_ERROR_RETURN ((LM_ERROR,
00247                                "TAO_AV_Core::init_forward_flows::acceptor_registry::open failed\n"),
00248                               -1);
00249           TAO_AV_FlowSpecSetItor end = address_flow_set.end ();
00250           for (TAO_AV_FlowSpecSetItor start = address_flow_set.begin ();
00251                start != end; ++start)
00252             {
00253               TAO_FlowSpec_Entry *entry = (*start);
00254               switch (entry->direction ())
00255                 {
00256                 case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
00257                   {
00258                     if (entry->handler () != 0)
00259                       {
00260                         //Yamuna:PLEASE CHECK THIS LATER
00261 #if defined ACE_HAS_RAPI || defined (ACE_HAS_WINSOCK2_GQOS)
00262                         // For IN flows on the A side we should remove the handlers from the reactor.
00263                         ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
00264 
00265                         if (event_handler->reactor () != 0)
00266                           {
00267                             result = event_handler->reactor ()->remove_handler (event_handler,
00268                                                                                 ACE_Event_Handler::READ_MASK);
00269 
00270                             if (result < 0)
00271                               if (TAO_debug_level > 0)
00272                                 ACE_DEBUG ((LM_DEBUG,
00273                                             "TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
00274                           }
00275 #endif //ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS
00276                       }
00277                   }
00278                 default:
00279                   break;
00280                 }
00281               // Now if the address_set has been changed due to the addition of a control entry we should
00282               // add that to the flow_spec_set also.
00283               if (flow_spec_set.find (entry) < 0)
00284                 {
00285                   // entry doesn't exist so add it.
00286                   flow_spec_set.insert (entry);
00287                   //                   size_t len = flow_spec.length ();
00288                   //                   flow_spec.length (len+1);
00289                   //                   flow_spec [len] = entry->entry_to_string ();
00290                 }
00291             }
00292         }
00293       break;
00294     case TAO_AV_Core::TAO_AV_ENDPOINT_B:
00295       {
00296         if (address_flow_set.size () > 0)
00297           {
00298             ACE_DEBUG ((LM_DEBUG,
00299                         "(%N,%l) This connector registry is called\n"));
00300 
00301             result = this->connector_registry_->open (endpoint,
00302                                                       this,
00303                                                       address_flow_set);
00304             if (result == -1)
00305               ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Core::init_Forward_flows: connector_registry open failed\n"),-1);
00306             TAO_AV_FlowSpecSetItor end = address_flow_set.end ();
00307             for (TAO_AV_FlowSpecSetItor start = address_flow_set.begin ();
00308                  start != end; ++start)
00309               {
00310                 TAO_FlowSpec_Entry *entry = (*start);
00311                 switch (entry->direction ())
00312                   {
00313                   case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00314                     {
00315                       if (entry->handler () != 0)
00316                         {
00317                           // @@Naga: This wont be called in the case of Full Profile.
00318                           // For IN flows on the A side we should remove the handlers from the reactor.
00319                           ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
00320                           result = event_handler->reactor ()->remove_handler (event_handler,
00321                                                                               ACE_Event_Handler::READ_MASK);
00322                           if (result < 0)
00323                             if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
00324                         }
00325                     }
00326                   default:
00327                     break;
00328                   }
00329                 // Now if the address_set has been changed due to the addition of a control entry we should
00330                 // add that to the flow_spec_set also.
00331                 if (flow_spec_set.find (entry) < 0)
00332                   {
00333                     // entry doesn't exist so add it.
00334                     flow_spec_set.insert (entry);
00335                   }
00336               }
00337           }
00338         if (flow_set.size () > 0)
00339           {
00340             TAO_AV_FlowSpecSet tmp_flow_set (flow_set);
00341             flow_set.reset ();
00342             TAO_AV_FlowSpecSetItor end = tmp_flow_set.end ();
00343             TAO_AV_FlowSpecSetItor start = tmp_flow_set.begin ();
00344             for (; start != end; ++start)
00345               {
00346                 TAO_FlowSpec_Entry *entry = *start;
00347                 TAO_FlowSpec_Entry *new_entry;
00348                 ACE_CString dir;
00349                 if (entry->direction () == 0)
00350                   dir += "IN";
00351                 else if (entry->direction () == 1)
00352                   dir += "OUT";
00353                 if (entry->get_peer_addr () != 0)
00354                   {
00355                     ACE_NEW_RETURN (new_entry,
00356                                     TAO_Forward_FlowSpec_Entry (entry->flowname (),
00357                                                                 dir.c_str (),
00358                                                                 entry->format (),
00359                                                                 entry->flow_protocol_str (),
00360                                                                 entry->carrier_protocol_str (),
00361                                                                 entry->get_peer_addr (),
00362                                                                 entry->control_address ()),
00363                                     -1);
00364                   }
00365                 else
00366                   {
00367                     ACE_NEW_RETURN (new_entry,
00368                                     TAO_Forward_FlowSpec_Entry (entry->flowname (),
00369                                                                 dir.c_str (),
00370                                                                 entry->format (),
00371                                                                 entry->flow_protocol_str (),
00372                                                                 entry->carrier_protocol_str (),
00373                                                                 entry->address (),
00374                                                                 entry->control_address ()),
00375                                     -1);
00376                   }
00377                 flow_set.insert (new_entry);
00378               }
00379             result = this->acceptor_registry_->open (endpoint,
00380                                                      this,
00381                                                      flow_set);
00382             if (result == -1)
00383               ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Core::init_Forward_flows: Acceptor_registry open failed\n"),-1);
00384             end = address_flow_set.end ();
00385             start = address_flow_set.begin ();
00386             for (; start != end; ++start)
00387               {
00388                 TAO_FlowSpec_Entry *entry = (*start);
00389                 switch (entry->direction ())
00390                   {
00391                   case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00392                     {
00393                       if (entry->handler () != 0)
00394                         {
00395                           // For IN flows on the A side we should remove the handlers from the reactor.
00396                           ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
00397                           result = event_handler->reactor ()->remove_handler (event_handler,
00398                                                                               ACE_Event_Handler::READ_MASK);
00399                           if (result < 0)
00400                             if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
00401                         }
00402                     }
00403                   default:
00404                     break;
00405                   }
00406                 // Now if the address_set has been changed due to the addition of a control entry we should
00407                 // add that to the flow_spec_set also.
00408                 if (flow_spec_set.find (entry) < 0)
00409                   {
00410                     // entry doesn't exist so add it.
00411                     flow_spec_set.insert (entry);
00412                   }
00413               }
00414           }
00415 
00416         AVStreams::flowSpec new_flowspec (static_cast<CORBA::ULong> (flow_spec_set.size ()));
00417         int i=0;
00418         TAO_AV_FlowSpecSetItor connect_end = address_flow_set.end ();
00419         TAO_AV_FlowSpecSetItor connect = address_flow_set.begin ();
00420         for (;connect != connect_end;  ++connect)
00421           {
00422             ACE_Addr *local_addr;
00423             ACE_Addr *local_control_addr;
00424             local_addr = (*connect)->get_local_addr ();
00425             local_control_addr = (*connect)->get_local_control_addr ();
00426             if (local_addr != 0)
00427               {
00428                 TAO_Reverse_FlowSpec_Entry entry ((*connect)->flowname (),
00429                                                   (*connect)->direction_str (),
00430                                                   (*connect)->format (),
00431                                                   (*connect)->flow_protocol_str (),
00432                                                   (*connect)->carrier_protocol_str (),
00433                                                   local_addr,
00434                                                   local_control_addr);
00435                 /*
00436                   ACE_Addr *addr;
00437                   if ((addr = (*connect)->get_peer_addr ()) != 0)
00438                   {
00439                   entry.set_peer_addr (addr);
00440                   };
00441                 */
00442                 int len = new_flowspec.length ();
00443                 if (i == len)
00444                   new_flowspec.length (len+1);
00445                 new_flowspec [i++] = entry.entry_to_string ();
00446                 if (TAO_debug_level > 0)
00447                   ACE_DEBUG ((LM_DEBUG, "reverse Flow Spec Is %s\n", entry.entry_to_string ()));
00448               }
00449           }
00450         connect_end = flow_set.end ();
00451         for (connect = flow_set.begin ();
00452              connect != connect_end;  ++connect)
00453           {
00454             ACE_Addr *local_addr;
00455             ACE_Addr *local_control_addr;
00456             local_addr = (*connect)->get_local_addr ();
00457             local_control_addr = (*connect)->get_local_control_addr ();
00458             if (local_addr != 0)
00459               {
00460                 TAO_Reverse_FlowSpec_Entry entry ((*connect)->flowname (),
00461                                                   (*connect)->direction_str (),
00462                                                   (*connect)->format (),
00463                                                   (*connect)->flow_protocol_str (),
00464                                                   (*connect)->carrier_protocol_str (),
00465                                                   local_addr,
00466                                                   local_control_addr);
00467 
00468                 int len = new_flowspec.length ();
00469                 if (i == len)
00470                   new_flowspec.length (len+1);
00471                 new_flowspec [i++] = entry.entry_to_string ();
00472               }
00473           }
00474         // Change the reverse flow spec to be sent.
00475         //        int index = flow_spec.length () + 1;
00476         int index = new_flowspec.length ();
00477         flow_spec.length (index);
00478         for (i = 0; i < index; i++)
00479           {
00480             flow_spec [i] = new_flowspec [i];
00481           }
00482       }
00483       break;
00484     default:
00485       break;
00486     }
00487   return 0;
00488 }

int TAO_AV_Core::init_reverse_flows TAO_Base_StreamEndPoint endpoint,
TAO_AV_FlowSpecSet forward_flow_spec_set,
TAO_AV_FlowSpecSet reverse_flow_spec_set,
EndPoint  direction
 

Definition at line 491 of file AV_Core.cpp.

References ACE_DEBUG, ACE_ERROR_RETURN, TAO_FlowSpec_Entry::address(), ACE_Unbounded_Set< T >::begin(), TAO_FlowSpec_Entry::direction(), ACE_Unbounded_Set< T >::end(), TAO_FlowSpec_Entry::flowname(), get_acceptor(), get_flow_spec_entry(), ACE_Unbounded_Set< T >::insert(), LM_DEBUG, LM_ERROR, TAO_AV_Connector_Registry::open(), TAO_FlowSpec_Entry::role(), TAO_FlowSpec_Entry::set_peer_addr(), TAO_AV_ENDPOINT_A, TAO_AV_ENDPOINT_B, TAO_AV_FlowSpecSet, TAO_AV_FlowSpecSetItor, and TAO_debug_level.

00495 {
00496   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Core::init_reverse_flows\n"));
00497   TAO_AV_FlowSpecSet acceptor_flow_set;
00498   TAO_AV_FlowSpecSet connector_flow_set;
00499   TAO_AV_FlowSpecSetItor end = reverse_flow_spec_set.end ();
00500   TAO_AV_FlowSpecSetItor start = reverse_flow_spec_set.begin ();
00501   for (;start != end; ++start)
00502     {
00503       TAO_FlowSpec_Entry *entry = (*start);
00504       ACE_Addr *address = entry->address ();
00505       switch (direction)
00506         {
00507         case TAO_AV_Core::TAO_AV_ENDPOINT_B:
00508           {
00509             switch (entry->direction ())
00510               {
00511               case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
00512                 entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
00513                 break;
00514               case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00515                 entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
00516                 break;
00517               }
00518             break;
00519           }
00520         case TAO_AV_Core::TAO_AV_ENDPOINT_A:
00521           {
00522             switch (entry->direction ())
00523               {
00524               case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
00525                 entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
00526                 break;
00527               case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
00528                 entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
00529                 break;
00530               }
00531             break;
00532           }
00533         default: break;
00534         }
00535 
00536       if (address != 0)
00537         {
00538           if (this->get_acceptor (entry->flowname ())!= 0)
00539             {
00540               ACE_Addr *address = entry->address ();
00541               TAO_FlowSpec_Entry *forward_entry =
00542                 this->get_flow_spec_entry (forward_flow_spec_set,
00543                                            entry->flowname ());
00544               if (forward_entry != 0)
00545                 forward_entry->set_peer_addr (address);
00546             }
00547           else
00548             connector_flow_set.insert (entry);
00549         }
00550     }
00551   int result = -1;
00552   switch (direction)
00553     {
00554 
00555     case TAO_AV_Core::TAO_AV_ENDPOINT_A:
00556       {
00557         result = this->connector_registry_->open (endpoint,
00558                                                   this,
00559                                                   connector_flow_set);
00560       }
00561         break;
00562     default:
00563       break;
00564     }
00565   if (result == -1)
00566     ACE_ERROR_RETURN ((LM_ERROR,"acceptor_registry::open"),-1);
00567   return 0;
00568 }

int TAO_AV_Core::init_transport_factories void   ) 
 

Definition at line 841 of file AV_Core.cpp.

References ACE_CString, ACE_DEBUG, ACE_ERROR_RETURN, ACE_TEXT(), ACE_Unbounded_Set< T >::begin(), ACE_Unbounded_Set< T >::end(), LM_DEBUG, LM_ERROR, load_default_transport_factories(), TAO_AV_TransportFactorySetItor, TAO_debug_level, and transport_factories_.

Referenced by init().

00842 {
00843   TAO_AV_TransportFactorySetItor end = this->transport_factories_.end ();
00844   TAO_AV_TransportFactorySetItor factory = this->transport_factories_.begin ();
00845 
00846 
00847   if (factory == end)
00848     {
00849       if (TAO_debug_level > 0)
00850         ACE_DEBUG ((LM_DEBUG,
00851                     "Loading default transport protocols\n"));
00852       this->load_default_transport_factories ();
00853     }
00854   else
00855     {
00856       for (; factory != end; factory++)
00857         {
00858           const ACE_CString &name = (*factory)->name ();
00859           if (TAO_debug_level > 0)
00860             ACE_DEBUG ((LM_DEBUG,
00861                         "%s \n",
00862                         name.c_str ()));
00863 
00864           (*factory)->factory (
00865                                ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (name.c_str ()));
00866           if ((*factory)->factory () == 0)
00867             {
00868               ACE_ERROR_RETURN ((LM_ERROR,
00869                                  ACE_TEXT ("TAO (%P|%t) Unable to load ")
00870                                  ACE_TEXT ("protocol <%s>, %p\n"),
00871                                  name.c_str (), ""),
00872                                 -1);
00873             }
00874           (*factory)->factory ()->ref_count = 1;
00875 
00876           if (TAO_debug_level > 0)
00877             {
00878               ACE_DEBUG ((LM_DEBUG,
00879                           ACE_TEXT ("TAO (%P|%t) Loaded protocol <%s>\n"),
00880                           name.c_str ()));
00881             }
00882         }
00883     }
00884 
00885   return 0;
00886 }

int TAO_AV_Core::load_default_flow_protocol_factories void   ) 
 

Definition at line 889 of file AV_Core.cpp.

References ACE_ERROR, ACE_NEW_RETURN, TAO_AV_Flow_Protocol_Item::factory(), flow_protocol_factories_, ACE_Unbounded_Set< T >::insert(), ACE_Dynamic_Service< TYPE >::instance(), LM_WARNING, TAO_AV_Flow_Protocol_Factory::ref_count, and TAO_debug_level.

Referenced by init_flow_protocol_factories().

00890 {
00891   const char *udp_flow = "UDP_Flow_Factory";
00892   const char *tcp_flow = "TCP_Flow_Factory";
00893   const char *rtp_flow = "RTP_Flow_Factory";
00894   const char *rtcp_flow = "RTCP_Flow_Factory";
00895   const char *sfp_flow = "SFP_Flow_Factory";
00896 
00897   TAO_AV_Flow_Protocol_Factory *udp_flow_factory = 0;
00898   TAO_AV_Flow_Protocol_Item *udp_item = 0;
00899 
00900   udp_flow_factory =
00901     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (udp_flow);
00902   if (udp_flow_factory == 0)
00903     {
00904       if (TAO_debug_level)
00905         ACE_ERROR ((LM_WARNING,
00906                     "(%P|%t) WARNING - No %s found in Service Repository."
00907                     "  Using default instance.\n",
00908                     "UDP Flow Factory"));
00909 
00910       ACE_NEW_RETURN (udp_flow_factory,
00911                       TAO_AV_UDP_Flow_Factory,
00912                       -1);
00913     }
00914   else udp_flow_factory->ref_count = 1;
00915 
00916   ACE_NEW_RETURN (udp_item, TAO_AV_Flow_Protocol_Item ("UDP_Flow_Factory"), -1);
00917   udp_item->factory (udp_flow_factory);
00918 
00919   this->flow_protocol_factories_.insert (udp_item);
00920 
00921 #if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
00922 
00923   const char *udp_qos_flow = "UDP_QoS_Flow_Factory";
00924   TAO_AV_Flow_Protocol_Factory *udp_qos_flow_factory = 0;
00925   TAO_AV_Flow_Protocol_Item *udp_qos_flow_item = 0;
00926 
00927   udp_qos_flow_factory =
00928     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (udp_qos_flow);
00929   if (udp_qos_flow_factory == 0)
00930     {
00931       if (TAO_debug_level)
00932         ACE_ERROR ((LM_WARNING,
00933                     "(%P|%t) WARNING - No %s found in Service Repository."
00934                     "  Using default instance.\n",
00935                     "UDP QoS Flow Factory"));
00936 
00937       ACE_NEW_RETURN (udp_qos_flow_factory,
00938                       TAO_AV_UDP_QoS_Flow_Factory,
00939                       -1);
00940     }
00941   else udp_qos_flow_factory->ref_count = 1;
00942 
00943   ACE_NEW_RETURN (udp_qos_flow_item, TAO_AV_Flow_Protocol_Item ("UDP_QoS_Flow_Factory"), -1);
00944   udp_qos_flow_item->factory (udp_qos_flow_factory);
00945 
00946   this->flow_protocol_factories_.insert (udp_qos_flow_item);
00947 
00948 #endif /* defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS) */
00949 
00950 #if defined ACE_HAS_SCTP
00951 
00952   const char *sctp_seq_flow = "SCTP_SEQ_Flow_Factory";
00953   TAO_AV_Flow_Protocol_Factory *sctp_seq_flow_factory = 0;
00954   TAO_AV_Flow_Protocol_Item *sctp_seq_flow_item = 0;
00955 
00956   sctp_seq_flow_factory =
00957     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (sctp_seq_flow);
00958   if (sctp_seq_flow_factory == 0)
00959     {
00960       if (TAO_debug_level)
00961         ACE_ERROR ((LM_WARNING,
00962                     "(%P|%t) WARNING - No %s found in Service Repository."
00963                     "  Using default instance.\n",
00964                     "SCTP SEQ Flow Factory"));
00965 
00966       ACE_NEW_RETURN (sctp_seq_flow_factory,
00967                       TAO_AV_SCTP_SEQ_Flow_Factory,
00968                       -1);
00969     }
00970   else sctp_seq_flow_factory->ref_count = 1;
00971 
00972   ACE_NEW_RETURN (sctp_seq_flow_item, TAO_AV_Flow_Protocol_Item ("SCTP_SEQ_Flow_Factory"), -1);
00973   sctp_seq_flow_item->factory (sctp_seq_flow_factory);
00974 
00975   this->flow_protocol_factories_.insert (sctp_seq_flow_item);
00976 
00977 #endif /* ACE_HAS_SCTP */
00978 
00979   TAO_AV_Flow_Protocol_Factory *tcp_flow_factory = 0;
00980   TAO_AV_Flow_Protocol_Item *tcp_item = 0;
00981 
00982   tcp_flow_factory =
00983     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (tcp_flow);
00984   if (tcp_flow_factory == 0)
00985     {
00986       if (TAO_debug_level)
00987         ACE_ERROR ((LM_WARNING,
00988                     "(%P|%t) WARNING - No %s found in Service Repository."
00989                     "  Using default instance.\n",
00990                     "TCP Flow Factory"));
00991 
00992       ACE_NEW_RETURN (tcp_flow_factory,
00993                       TAO_AV_TCP_Flow_Factory,
00994                       -1);
00995     }
00996   else tcp_flow_factory->ref_count = 1;
00997 
00998   ACE_NEW_RETURN (tcp_item, TAO_AV_Flow_Protocol_Item ("TCP_Flow_Factory"), -1);
00999   tcp_item->factory (tcp_flow_factory);
01000 
01001   this->flow_protocol_factories_.insert (tcp_item);
01002 
01003   TAO_AV_Flow_Protocol_Factory *rtp_flow_factory = 0;
01004   TAO_AV_Flow_Protocol_Item *rtp_item = 0;
01005 
01006   rtp_flow_factory =
01007     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (rtp_flow);
01008   if (rtp_flow_factory == 0)
01009     {
01010       if (TAO_debug_level)
01011         ACE_ERROR ((LM_WARNING,
01012                     "(%P|%t) WARNING - No %s found in Service Repository."
01013                     "  Using default instance.\n",
01014                     "RTP Flow Factory"));
01015 
01016       ACE_NEW_RETURN (rtp_flow_factory,
01017                       TAO_AV_RTP_Flow_Factory,
01018                       -1);
01019     }
01020   else rtp_flow_factory->ref_count = 1;
01021 
01022   ACE_NEW_RETURN (rtp_item, TAO_AV_Flow_Protocol_Item ("RTP_Flow_Factory"), -1);
01023   rtp_item->factory (rtp_flow_factory);
01024 
01025   this->flow_protocol_factories_.insert (rtp_item);
01026 
01027   TAO_AV_Flow_Protocol_Factory *rtcp_flow_factory = 0;
01028   TAO_AV_Flow_Protocol_Item *rtcp_item = 0;
01029 
01030   rtcp_flow_factory =
01031     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (rtcp_flow);
01032   if (rtcp_flow_factory == 0)
01033     {
01034       if (TAO_debug_level)
01035         ACE_ERROR ((LM_WARNING,
01036                     "(%P|%t) WARNING - No %s found in Service Repository."
01037                     "  Using default instance.\n",
01038                     "RTCP Flow Factory"));
01039 
01040       ACE_NEW_RETURN (rtcp_flow_factory,
01041                       TAO_AV_RTCP_Flow_Factory,
01042                       -1);
01043     }
01044   else rtcp_flow_factory->ref_count = 1;
01045 
01046   ACE_NEW_RETURN (rtcp_item, TAO_AV_Flow_Protocol_Item ("RTCP_Flow_Factory"), -1);
01047   rtcp_item->factory (rtcp_flow_factory);
01048 
01049   this->flow_protocol_factories_.insert (rtcp_item);
01050 
01051   TAO_AV_Flow_Protocol_Factory *sfp_flow_factory = 0;
01052   TAO_AV_Flow_Protocol_Item *sfp_item = 0;
01053 
01054   sfp_flow_factory =
01055     ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (sfp_flow);
01056   if (sfp_flow_factory == 0)
01057     {
01058       if (TAO_debug_level)
01059         ACE_ERROR ((LM_WARNING,
01060                     "(%P|%t) WARNING - No %s found in Service Repository."
01061                     "  Using default instance.\n",
01062                     "SFP Flow Factory"));
01063 
01064       ACE_NEW_RETURN (sfp_flow_factory,
01065                       TAO_AV_SFP_Factory,
01066                       -1);
01067     }
01068   else sfp_flow_factory->ref_count = 1;
01069 
01070   ACE_NEW_RETURN (sfp_item, TAO_AV_Flow_Protocol_Item ("SFP_Flow_Factory"), -1);
01071   sfp_item->factory (sfp_flow_factory);
01072 
01073   this->flow_protocol_factories_.insert (sfp_item);
01074 
01075   return 0;
01076 }

int TAO_AV_Core::load_default_transport_factories void   ) 
 

Definition at line 722 of file AV_Core.cpp.

References ACE_ERROR, ACE_NEW_RETURN, TAO_AV_Transport_Item::factory(), ACE_Unbounded_Set< T >::insert(), ACE_Dynamic_Service< TYPE >::instance(), LM_WARNING, TAO_AV_Transport_Factory::ref_count, TAO_debug_level, and transport_factories_.

Referenced by init_transport_factories().

00723 {
00724   const char *udp_factory_str = "UDP_Factory";
00725   const char *tcp_factory_str = "TCP_Factory";
00726 
00727   TAO_AV_Transport_Factory *udp_factory = 0;
00728   TAO_AV_Transport_Item *udp_item = 0;
00729 
00730   udp_factory =
00731     ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (udp_factory_str);
00732   if (udp_factory == 0)
00733     {
00734       if (TAO_debug_level)
00735         ACE_ERROR ((LM_WARNING,
00736                     "(%P|%t) WARNING - No %s found in Service Repository."
00737                     "  Using default instance.\n",
00738                     "UDP Factory"));
00739 
00740       ACE_NEW_RETURN (udp_factory,
00741                       TAO_AV_UDP_Factory,
00742                       -1);
00743     }
00744   else udp_factory->ref_count = 1;
00745 
00746   ACE_NEW_RETURN (udp_item, TAO_AV_Transport_Item ("UDP_Factory"), -1);
00747   udp_item->factory (udp_factory);
00748 
00749   this->transport_factories_.insert (udp_item);
00750 
00751   TAO_AV_Transport_Factory *tcp_factory = 0;
00752   TAO_AV_Transport_Item *tcp_item = 0;
00753 
00754   tcp_factory =
00755     ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (tcp_factory_str);
00756   if (tcp_factory == 0)
00757     {
00758       if (TAO_debug_level)
00759         ACE_ERROR ((LM_WARNING,
00760                     "(%P|%t) WARNING - No %s found in Service Repository."
00761                     "  Using default instance.\n",
00762                     "TCP Factory"));
00763 
00764       ACE_NEW_RETURN (tcp_factory,
00765                       TAO_AV_TCP_Factory,
00766                           -1);
00767     }
00768   else tcp_factory->ref_count = 1;
00769 
00770   ACE_NEW_RETURN (tcp_item, TAO_AV_Transport_Item ("TCP_Factory"), -1);
00771   tcp_item->factory (tcp_factory);
00772 
00773   this->transport_factories_.insert (tcp_item);
00774 
00775 #if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
00776   const char *udp_qos_factory_str = "UDP_QoS_Factory";
00777 
00778   TAO_AV_Transport_Factory *udp_qos_factory = 0;
00779   TAO_AV_Transport_Item *udp_qos_item = 0;
00780 
00781   udp_qos_factory =
00782         ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (udp_qos_factory_str);
00783   if (udp_qos_factory == 0)
00784     {
00785       if (TAO_debug_level)
00786         ACE_ERROR ((LM_WARNING,
00787                     "(%P|%t) WARNING - No %s found in Service Repository."
00788                     "  Using default instance.\n",
00789                     "UDP QoS Factory"));
00790 
00791           ACE_NEW_RETURN (udp_qos_factory,
00792                           TAO_AV_UDP_QoS_Factory,
00793                           -1);
00794     }
00795   else udp_qos_factory->ref_count = 1;
00796 
00797   ACE_NEW_RETURN (udp_qos_item,
00798                   TAO_AV_Transport_Item ("UDP_QoS_Factory"),
00799                   -1);
00800 
00801   udp_qos_item->factory (udp_qos_factory);
00802 
00803   this->transport_factories_.insert (udp_qos_item);
00804 #endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
00805 
00806 #if defined ACE_HAS_SCTP
00807   const char *sctp_seq_factory_str = "SCTP_SEQ_Factory";
00808 
00809   TAO_AV_Transport_Factory *sctp_seq_factory = 0;
00810   TAO_AV_Transport_Item *sctp_seq_item = 0;
00811 
00812   sctp_seq_factory =
00813         ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (sctp_seq_factory_str);
00814   if (sctp_seq_factory == 0)
00815     {
00816       if (TAO_debug_level)
00817         ACE_ERROR ((LM_WARNING,
00818                     "(%P|%t) WARNING - No %s found in Service Repository."
00819                     "  Using default instance.\n",
00820                     "SCTP SEQ Factory"));
00821 
00822       ACE_NEW_RETURN (sctp_seq_factory,
00823                       TAO_AV_SCTP_SEQ_Factory,
00824                       -1);
00825     }
00826   else sctp_seq_factory->ref_count = 1;
00827 
00828   ACE_NEW_RETURN (sctp_seq_item,
00829                   TAO_AV_Transport_Item ("SCTP_SEQ_Factory"),
00830                   -1);
00831 
00832   sctp_seq_item->factory (sctp_seq_factory);
00833 
00834   this->transport_factories_.insert (sctp_seq_item);
00835 #endif /* ACE_HAS_SCTP */
00836 
00837   return 0;
00838 }

void TAO_AV_Core::orb CORBA::ORB_ptr  orb_  ) 
 

Definition at line 85 of file AV_Core.cpp.

00086 {
00087   this->orb_ = orb;
00088 }

CORBA::ORB_ptr TAO_AV_Core::orb void   ) 
 

Definition at line 79 of file AV_Core.cpp.

00080 {
00081   return this->orb_.in ();
00082 }

void TAO_AV_Core::poa PortableServer::POA_ptr  poa_  ) 
 

Definition at line 97 of file AV_Core.cpp.

00098 {
00099   this->poa_ = poa;
00100 }

PortableServer::POA_ptr TAO_AV_Core::poa void   ) 
 

Definition at line 91 of file AV_Core.cpp.

00092 {
00093   return this->poa_.in ();
00094 }

ACE_Reactor * TAO_AV_Core::reactor void   ) 
 

Definition at line 149 of file AV_Core.cpp.

Referenced by init().

00150 {
00151   return this->reactor_;
00152 }

void TAO_AV_Core::reactor ACE_Reactor r  ) 
 

Definition at line 143 of file AV_Core.cpp.

Referenced by TAO_AV_UDP_Connector::activate_svc_handler(), TAO_AV_UDP_Acceptor::activate_svc_handler(), and TAO_AV_TCP_Connector::open().

00144 {
00145   this->reactor_ = r;
00146 }

int TAO_AV_Core::remove_acceptor const char *  flowname  ) 
 

Definition at line 614 of file AV_Core.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_ENDTRY, ACE_PRINT_EXCEPTION, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, TAO_AV_Acceptor_Registry::begin(), TAO_AV_Acceptor_Registry::close(), TAO_AV_Acceptor_Registry::end(), ACE_OS::strcmp(), and TAO_AV_AcceptorSetItor.

00615 {
00616 
00617   ACE_TRY_NEW_ENV
00618     {
00619 
00620       TAO_AV_AcceptorSetItor acceptor =  this->acceptor_registry_->begin ();
00621       ACE_TRY_CHECK;
00622 
00623       TAO_AV_AcceptorSetItor end =
00624         this->acceptor_registry_->end ();
00625 
00626       for (;acceptor != end; ++acceptor)
00627         {
00628           if (ACE_OS::strcmp ((*acceptor)->flowname (),flowname) == 0)
00629             {
00630               this->acceptor_registry_->close (*acceptor);
00631               return 0;
00632             }
00633         }
00634     }
00635   ACE_CATCHANY
00636     {
00637       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_AV_Core::get_acceptor");
00638     }
00639   ACE_ENDTRY;
00640   return -1;
00641 }

int TAO_AV_Core::remove_connector const char *  flowname  ) 
 

Definition at line 660 of file AV_Core.cpp.

References TAO_AV_Connector_Registry::begin(), TAO_AV_Connector_Registry::close(), TAO_AV_Connector_Registry::end(), ACE_OS::strcmp(), and TAO_AV_ConnectorSetItor.

00661 {
00662   TAO_AV_ConnectorSetItor connector =
00663     this->connector_registry_->begin ();
00664   TAO_AV_ConnectorSetItor end =
00665     this->connector_registry_->end ();
00666 
00667   for (;connector != end; ++connector)
00668     {
00669       if (ACE_OS::strcmp ((*connector)->flowname (),flowname) == 0)
00670         {
00671           this->connector_registry_->close (*connector);
00672           return 0;
00673         }
00674     }
00675   return -1;
00676 }

int TAO_AV_Core::run void   ) 
 

Definition at line 134 of file AV_Core.cpp.

References stop_run_.

00135 {
00136   this->stop_run_ = 0;
00137   while (!this->stop_run_ && this->orb_->work_pending ())
00138     this->orb_->perform_work ();
00139   return 0;
00140 }

int TAO_AV_Core::stop_run void   ) 
 

Definition at line 127 of file AV_Core.cpp.

References stop_run_.

00128 {
00129   this->stop_run_ = 1;
00130   return 0;
00131 }

TAO_AV_TransportFactorySet * TAO_AV_Core::transport_factories void   ) 
 

Definition at line 115 of file AV_Core.cpp.

References transport_factories_.

00116 {
00117   return &this->transport_factories_;
00118 }


Member Data Documentation

TAO_AV_Acceptor_Registry* TAO_AV_Core::acceptor_registry_ [protected]
 

The registry which maintains a list of acceptor factories for each loaded protocol.

Definition at line 150 of file AV_Core.h.

TAO_AV_Connector_Registry* TAO_AV_Core::connector_registry_ [protected]
 

The connector registry which all active connecters must register themselves with.

Definition at line 146 of file AV_Core.h.

TAO_AV_Flow_ProtocolFactorySet TAO_AV_Core::flow_protocol_factories_ [protected]
 

Pointer to the list of flow protocol loaded into this AV_Core instance.

Definition at line 156 of file AV_Core.h.

Referenced by flow_protocol_factories(), get_flow_protocol_factory(), init_flow_protocol_factories(), load_default_flow_protocol_factories(), and ~TAO_AV_Core().

CORBA::ORB_var TAO_AV_Core::orb_ [protected]
 

Definition at line 159 of file AV_Core.h.

PortableServer::POA_var TAO_AV_Core::poa_ [protected]
 

Definition at line 160 of file AV_Core.h.

ACE_Reactor* TAO_AV_Core::reactor_ [protected]
 

Definition at line 158 of file AV_Core.h.

CORBA::Boolean TAO_AV_Core::stop_run_ [protected]
 

Definition at line 161 of file AV_Core.h.

Referenced by run(), and stop_run().

TAO_AV_TransportFactorySet TAO_AV_Core::transport_factories_ [protected]
 

Pointer to the list of transports loaded into this AV_Core instance.

Definition at line 153 of file AV_Core.h.

Referenced by get_transport_factory(), init_transport_factories(), load_default_transport_factories(), transport_factories(), and ~TAO_AV_Core().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:46:58 2006 for TAO_AV by doxygen 1.3.6