summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarvindk <arvindk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-01-04 17:24:01 +0000
committerarvindk <arvindk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-01-04 17:24:01 +0000
commit7577db278c11b9ddff8728035832fa7a9bc80650 (patch)
tree787489efdbfa57ca3a1f53356f8fd798ad22ed8d
parent9f309e10261af3d093612a137c9cad1b344c855f (diff)
downloadATCD-7577db278c11b9ddff8728035832fa7a9bc80650.tar.gz
ChangelogTag: Tue Jan 4 09:17:53 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
-rw-r--r--TAO/tao/Default_Endpoint_Selector_Factory.cpp15
-rw-r--r--TAO/tao/Default_Endpoint_Selector_Factory.h3
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp89
-rw-r--r--TAO/tao/IIOP_Acceptor.h16
-rw-r--r--TAO/tao/IIOP_Connection_Handler.cpp39
-rw-r--r--TAO/tao/IIOP_Connection_Handler.h3
6 files changed, 145 insertions, 20 deletions
diff --git a/TAO/tao/Default_Endpoint_Selector_Factory.cpp b/TAO/tao/Default_Endpoint_Selector_Factory.cpp
index 8b0814e80e8..cb11d4db932 100644
--- a/TAO/tao/Default_Endpoint_Selector_Factory.cpp
+++ b/TAO/tao/Default_Endpoint_Selector_Factory.cpp
@@ -2,7 +2,10 @@
#include "tao/Default_Endpoint_Selector_Factory.h"
+
+#if !defined (TAO_HAS_COLLOCATION)
#include "tao/Invocation_Endpoint_Selectors.h"
+#endif
#include "ace/Log_Msg.h"
@@ -14,22 +17,34 @@ ACE_RCSID (tao,
TAO_Default_Endpoint_Selector_Factory::TAO_Default_Endpoint_Selector_Factory (void)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
ACE_NEW (this->default_endpoint_selector_,
TAO_Default_Endpoint_Selector);
+#endif
}
TAO_Default_Endpoint_Selector_Factory::~TAO_Default_Endpoint_Selector_Factory (void)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
delete this->default_endpoint_selector_;
+#endif
+
}
TAO_Invocation_Endpoint_Selector *
TAO_Default_Endpoint_Selector_Factory::get_selector (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
// Trivial endpoint selector. Just return the default selector.
return this->default_endpoint_selector_;
+#else
+ return 0;
+#endif
}
// ****************************************************************
diff --git a/TAO/tao/Default_Endpoint_Selector_Factory.h b/TAO/tao/Default_Endpoint_Selector_Factory.h
index 00558b91983..4ca028a6a0a 100644
--- a/TAO/tao/Default_Endpoint_Selector_Factory.h
+++ b/TAO/tao/Default_Endpoint_Selector_Factory.h
@@ -62,10 +62,13 @@ public:
virtual TAO_Invocation_Endpoint_Selector *get_selector (
ACE_ENV_SINGLE_ARG_DECL);
+#if !defined (TAO_HAS_COLLOCATION)
protected:
/// The possible endpoint selector strategies that can be
/// returned by this factory
TAO_Default_Endpoint_Selector *default_endpoint_selector_;
+#endif
+
};
ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Endpoint_Selector_Factory)
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 5f7d76ff640..4041a5356a0 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -4,10 +4,13 @@
#include "tao/debug.h"
#include "tao/Protocols_Hooks.h"
#include "tao/Codeset_Manager.h"
-#include "tao/Transport.h"
#include "tao/ORB_Core.h"
#include "tao/CDR.h"
+#if !defined (TAO_HAS_COLLOCATION)
+# include "tao/Transport.h"
+#endif
+
#if !defined(__ACE_INLINE__)
#include "tao/IIOP_Acceptor.i"
#endif /* __ACE_INLINE__ */
@@ -21,6 +24,7 @@ ACE_RCSID (tao,
IIOP_Acceptor,
"$Id$")
+#if !defined (TAO_HAS_COLLOCATION)
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
@@ -50,21 +54,46 @@ template class TAO_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTO
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+#else
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+
+template class ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr>;
+template class ACE_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
+template class ACE_Strategy_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
+template class ACE_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
+template class TAO_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
+
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+
+#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr>
+#pragma instantiate ACE_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
+#pragma instantiate ACE_Strategy_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
+#pragma instantiate ACE_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
+#pragma instantiate TAO_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
+
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+
+#endif
+
TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (CORBA::Boolean flag)
- : TAO_Acceptor (IOP::TAG_INTERNET_IOP),
- addrs_ (0),
- port_span_ (1),
- hosts_ (0),
- hostname_in_ior_ (0),
- endpoint_count_ (0),
- version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
- orb_core_ (0),
- lite_flag_ (flag),
- base_acceptor_ (),
- creation_strategy_ (0),
- concurrency_strategy_ (0),
- accept_strategy_ (0)
+ : TAO_Acceptor (IOP::TAG_INTERNET_IOP)
+ , addrs_ (0)
+ , port_span_ (1)
+ , hosts_ (0)
+ , hostname_in_ior_ (0)
+ , endpoint_count_ (0)
+ , version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)
+ , orb_core_ (0)
+ , lite_flag_ (flag)
+ , base_acceptor_ ()
+#if !defined (TAO_HAS_COLLOCATION)
+ , creation_strategy_ (0)
+ , concurrency_strategy_ (0)
+ , accept_strategy_ (0)
+#endif
{
+
}
TAO_IIOP_Acceptor::~TAO_IIOP_Acceptor (void)
@@ -73,10 +102,14 @@ TAO_IIOP_Acceptor::~TAO_IIOP_Acceptor (void)
// strategies.
this->close ();
+#if !defined (TAO_HAS_COLLOCATION)
+
delete this->creation_strategy_;
delete this->concurrency_strategy_;
delete this->accept_strategy_;
+#endif
+
delete [] this->addrs_;
for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
@@ -259,6 +292,7 @@ TAO_IIOP_Acceptor::is_collocated (const TAO_Endpoint *endpoint)
int
TAO_IIOP_Acceptor::close (void)
{
+
return this->base_acceptor_.close ();
}
@@ -270,6 +304,7 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
const char *address,
const char *options)
{
+
this->orb_core_ = orb_core;
if (this->hosts_ != 0)
@@ -396,6 +431,7 @@ TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
int minor,
const char *options)
{
+
this->orb_core_ = orb_core;
if (this->hosts_ != 0)
@@ -439,6 +475,8 @@ int
TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr,
ACE_Reactor *reactor)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
ACE_NEW_RETURN (this->creation_strategy_,
CREATION_STRATEGY (this->orb_core_,
this->lite_flag_),
@@ -451,16 +489,30 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr,
ACE_NEW_RETURN (this->accept_strategy_,
ACCEPT_STRATEGY (this->orb_core_),
-1);
+#endif
+
+ // this->creation_strategy_ = 0;
+ //this->concurrency_strategy_ = 0;
+ //this->accept_strategy_ = 0;
unsigned short requested_port = addr.get_port_number ();
if (requested_port == 0)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
// don't care, i.e., let the OS choose an ephemeral port
if (this->base_acceptor_.open (addr,
reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) == -1)
+#else
+ if (this->base_acceptor_.open (addr,
+ reactor,
+ 0,
+ 0,
+ 0) == -1)
+#endif
{
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
@@ -490,11 +542,20 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr,
// Now try to actually open on that port
a.set_port_number ((u_short)p);
+
+#if !defined (TAO_HAS_COLLOCATION)
if (this->base_acceptor_.open (a,
reactor,
this->creation_strategy_,
this->accept_strategy_,
this->concurrency_strategy_) != -1)
+#else
+ if (this->base_acceptor_.open (a,
+ reactor,
+ 0,
+ 0,
+ 0) != -1)
+#endif
{
found_a_port = true;
break;
diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h
index 1faf926a88e..04996e5a35f 100644
--- a/TAO/tao/IIOP_Acceptor.h
+++ b/TAO/tao/IIOP_Acceptor.h
@@ -28,7 +28,7 @@
#include "ace/SOCK_Acceptor.h"
#include "tao/Transport_Acceptor.h"
-#include "tao/IIOP_Connection_Handler.h"
+# include "tao/IIOP_Connection_Handler.h"
#include "tao/Acceptor_Impl.h"
#include "tao/GIOP_Message_Version.h"
@@ -55,10 +55,17 @@ public:
/// Returns the array of endpoints in this acceptor
const ACE_INET_Addr *endpoints (void);
- typedef ACE_Strategy_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> BASE_ACCEPTOR;
+
+ typedef ACE_Strategy_Acceptor<TAO_IIOP_Connection_Handler,
+ ACE_SOCK_ACCEPTOR> BASE_ACCEPTOR;
+
+#if !defined (TAO_HAS_COLLOCATION)
+
typedef TAO_Creation_Strategy<TAO_IIOP_Connection_Handler> CREATION_STRATEGY;
typedef TAO_Concurrency_Strategy<TAO_IIOP_Connection_Handler> CONCURRENCY_STRATEGY;
- typedef TAO_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> ACCEPT_STRATEGY;
+ typedef TAO_Accept_Strategy<TAO_IIOP_Connection_Handler,
+ ACE_SOCK_ACCEPTOR> ACCEPT_STRATEGY;
+#endif
/**
* The TAO_Acceptor methods, check the documentation in
@@ -196,10 +203,13 @@ private:
/// the concrete acceptor, as a pointer to it's base class.
BASE_ACCEPTOR base_acceptor_;
+#if !defined (TAO_HAS_COLLOCATION)
/// Acceptor strategies.
CREATION_STRATEGY *creation_strategy_;
CONCURRENCY_STRATEGY *concurrency_strategy_;
+
ACCEPT_STRATEGY *accept_strategy_;
+#endif
};
diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp
index a42e8f49e97..086f4b226fb 100644
--- a/TAO/tao/IIOP_Connection_Handler.cpp
+++ b/TAO/tao/IIOP_Connection_Handler.cpp
@@ -41,12 +41,19 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (
TAO_Connection_Handler (orb_core),
dscp_codepoint_ (IPDSFIELD_DSCP_DEFAULT << 2)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
TAO_IIOP_Transport* specific_transport = 0;
ACE_NEW (specific_transport,
TAO_IIOP_Transport (this, orb_core, flag));
// store this pointer (indirectly increment ref count)
this->transport (specific_transport);
+#else
+ ACE_UNUSED_ARG (orb_core);
+ ACE_UNUSED_ARG (flag);
+#endif
+
}
TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core)
@@ -58,7 +65,11 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core
TAO_IIOP_Connection_Handler::~TAO_IIOP_Connection_Handler (void)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
delete this->transport ();
+#endif
+
}
int
@@ -70,6 +81,8 @@ TAO_IIOP_Connection_Handler::open_handler (void *v)
int
TAO_IIOP_Connection_Handler::open (void*)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
TAO_IIOP_Protocol_Properties protocol_properties;
// Initialize values from ORB params.
@@ -183,15 +196,21 @@ TAO_IIOP_Connection_Handler::open (void*)
client, this->peer ().get_handle ()));
}
+ /*
// Set that the transport is now connected, if fails we return -1
// Use C-style cast b/c otherwise we get warnings on lots of
// compilers
if (!this->transport ()->post_open ((size_t) this->get_handle ()))
return -1;
+ */
this->state_changed (TAO_LF_Event::LFS_SUCCESS);
return 0;
+
+#else
+ return 0;
+#endif
}
int
@@ -260,6 +279,8 @@ TAO_IIOP_Connection_Handler::release_os_resources (void)
int
TAO_IIOP_Connection_Handler::add_transport_to_cache (void)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
ACE_INET_Addr addr;
// Get the peername.
@@ -280,12 +301,17 @@ TAO_IIOP_Connection_Handler::add_transport_to_cache (void)
// Idle the transport..
return cache.cache_idle_transport (&prop,
this->transport ());
+#else
+ return 0;
+#endif
}
int
TAO_IIOP_Connection_Handler::process_listen_point_list (
IIOP::ListenPointList &listen_list)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
// Get the size of the list
const CORBA::ULong len = listen_list.length ();
@@ -323,6 +349,7 @@ TAO_IIOP_Connection_Handler::process_listen_point_list (
// Mark the connection as bidirectional
prop.set_bidir_flag (1);
+ /*
// The property for this handler has changed. Recache the
// handler with this property
int retval =
@@ -333,14 +360,22 @@ TAO_IIOP_Connection_Handler::process_listen_point_list (
// Make the handler idle and ready for use
this->transport ()->make_idle ();
+ */
}
return 0;
+#else
+ ACE_UNUSED_ARG (listen_list);
+ return 0;
+#endif
+
}
int
TAO_IIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean set_network_priority)
{
+
+#if !defined (TAO_HAS_COLLOCATION)
int tos = IPDSFIELD_DSCP_DEFAULT << 2;
if (set_network_priority)
@@ -378,6 +413,10 @@ TAO_IIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean set_network_prio
}
return 0;
+#else
+ ACE_UNUSED_ARG (set_network_priority);
+ return 0;
+#endif
}
// ****************************************************************
diff --git a/TAO/tao/IIOP_Connection_Handler.h b/TAO/tao/IIOP_Connection_Handler.h
index 1fb383b735a..92b98683fe0 100644
--- a/TAO/tao/IIOP_Connection_Handler.h
+++ b/TAO/tao/IIOP_Connection_Handler.h
@@ -23,7 +23,6 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/SOCK_Stream.h"
-
#include "tao/Connection_Handler.h"
#include "tao/Basic_Types.h"
@@ -54,11 +53,9 @@ class TAO_Pluggable_Messaging;
* the Connector
*/
-
class TAO_Export TAO_IIOP_Connection_Handler : public TAO_IIOP_SVC_HANDLER,
public TAO_Connection_Handler
{
-
public:
TAO_IIOP_Connection_Handler (ACE_Thread_Manager * = 0);