summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-19 22:46:50 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-19 22:46:50 +0000
commit4e7f860d0ebbd1cfce14edde93bd3b7044eec2a4 (patch)
tree0be3074ebefe1f30d2783d6d1e066fc85c350032
parent783766cf6669bf74fbaeebc0d859d515c9f4b432 (diff)
downloadATCD-4e7f860d0ebbd1cfce14edde93bd3b7044eec2a4.tar.gz
Added connection_caching_strategy, purge_percent options as well as enum for the different caching strategies.
-rw-r--r--TAO/tao/default_resource.cpp55
-rw-r--r--TAO/tao/default_resource.h19
2 files changed, 73 insertions, 1 deletions
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index 433ac742f64..cccb6d1d48a 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -29,7 +29,9 @@ TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void)
use_locked_data_blocks_ (1),
reactor_type_ (TAO_REACTOR_SELECT_MT),
cdr_allocator_type_ (TAO_ALLOCATOR_THREAD_LOCK),
- protocol_factories_ ()
+ protocol_factories_ (),
+ connection_caching_type_ (TAO_CONNECTION_CACHING_STRATEGY),
+ purge_percentage_ (TAO_PURGE_PERCENT)
{
}
@@ -179,6 +181,45 @@ TAO_Default_Resource_Factory::init (int argc, char **argv)
}
}
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-ORBConnectionCachingStrategy") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ char *name = argv[curarg];
+
+ if (ACE_OS::strcasecmp (name,
+ "lru") == 0)
+ this->connection_caching_type_ = TAO_LRU;
+ else if (ACE_OS::strcasecmp (name,
+ "lfu") == 0)
+ this->connection_caching_type_ = TAO_LFU;
+ else if (ACE_OS::strcasecmp (name,
+ "fifo") == 0)
+ this->connection_caching_type_ = TAO_FIFO;
+ else if (ACE_OS::strcasecmp (name,
+ "null") == 0)
+ this->connection_caching_type_ = TAO_NULL;
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Default_Factory - unknown argument"
+ " <%s> for -ORBConnectionCachingStrategy\n", name));
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-ORBPurgePercentage") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ this->purge_percentage_ = ACE_OS::atoi (argv[curarg]);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Default_Factory - unknown argument"
+ "for -ORBPurgePercentage\n"));
+ }
+
return 0;
}
@@ -454,6 +495,18 @@ TAO_Default_Resource_Factory::output_cdr_buffer_allocator (void)
return allocator;
}
+int
+TAO_Default_Resource_Factory::get_connection_caching_strategy_type (void) const
+{
+ return this->connection_caching_type_;
+}
+
+double
+TAO_Default_Resource_Factory::get_purge_percentage (void) const
+{
+ return this->purge_percentage_;
+}
+
// ****************************************************************
ACE_STATIC_SVC_DEFINE (TAO_Default_Resource_Factory,
diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h
index 551311386e1..cbe3ba04b2c 100644
--- a/TAO/tao/default_resource.h
+++ b/TAO/tao/default_resource.h
@@ -75,6 +75,14 @@ public:
TAO_REACTOR_TP
};
+ enum
+ {
+ TAO_LRU, // Use Least Recently Used caching strategy
+ TAO_LFU, // Use Least Frequently Used caching strategy
+ TAO_FIFO, // Use First In First Out caching strategy
+ TAO_NULL // Dont use any strategy.
+ };
+
int cdr_allocator_source (void);
// Modify and get the source for the CDR allocators
@@ -91,6 +99,8 @@ public:
virtual TAO_ProtocolFactorySet *get_protocol_factories (void);
virtual int init_protocol_factories (void);
+ virtual int get_connection_caching_strategy_type (void) const;
+ virtual double get_purge_percentage (void) const;
protected:
virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
// Obtain the reactor implementation
@@ -111,6 +121,15 @@ protected:
TAO_ProtocolFactorySet protocol_factories_;
// list of loaded protocol factories.
+
+ int connection_caching_type_;
+ // Specifies the typeof caching strategy we should use for
+ // connection management.
+
+ double purge_percentage_;
+ // Specifies the percentage of entries which should get purged on
+ // demand.
+
};
#if defined (__ACE_INLINE__)