summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-14 19:08:22 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-14 19:08:22 +0000
commitc70acc0e8e14be1c6335b20b1ab19af028a4cec9 (patch)
treec5375aa38c287704399f333e58c42409254bac97
parente14281d006ab60367878cdd85d503f948cff9ba7 (diff)
downloadATCD-c70acc0e8e14be1c6335b20b1ab19af028a4cec9.tar.gz
Thu May 14 14:10:40 1998 Michael Kircher <mk1@cs.wustl.edu>
-rw-r--r--TAO/tests/Quoter/Factory_Trader.cpp29
-rw-r--r--TAO/tests/Quoter/Factory_Trader.h12
-rw-r--r--TAO/tests/Quoter/Makefile18
-rwxr-xr-xTAO/tests/Quoter/run_test.sh38
4 files changed, 82 insertions, 15 deletions
diff --git a/TAO/tests/Quoter/Factory_Trader.cpp b/TAO/tests/Quoter/Factory_Trader.cpp
index a9590342557..65681e0a9ee 100644
--- a/TAO/tests/Quoter/Factory_Trader.cpp
+++ b/TAO/tests/Quoter/Factory_Trader.cpp
@@ -26,10 +26,17 @@ const char * Factory_Trader::GENERIC_FACTORY_INTERFACE_REPOSITORY_ID = "IDL:CosL
Factory_Trader::Factory_Trader ()
+#ifdef TRADER_AVAILABLE
+
: trading_Components_ptr_ (0),
trader_ptr_(0),
support_Attributes_ptr_(0)
+
+#endif // TRADER_AVAILABLE
{
+
+#ifdef TRADER_AVAILABLE
+
TAO_TRY
{
// create the trader
@@ -52,17 +59,24 @@ Factory_Trader::Factory_Trader ()
TAO_TRY_ENV.print_exception ("Factory_Trader constructor: Exception.\n");
}
TAO_ENDTRY;
+#endif // TRADER_AVAILABLE
}
Factory_Trader::~Factory_Trader ()
{
+#ifdef TRADER_AVAILABLE
+
delete this->trader_ptr_;
+
+#endif // TRADER_AVAILABLE
}
void
Factory_Trader::add_type ()
{
+#ifdef TRADER_AVAILABLE
+
TAO_TRY
{
// define the new type
@@ -113,6 +127,8 @@ Factory_Trader::add_type ()
ACE_ERROR ((LM_ERROR, "Factory_Trader::init: Failed adding a new type."));
}
TAO_ENDTRY;
+
+#endif // TRADER_AVAILABLE
}
@@ -122,6 +138,8 @@ Factory_Trader::export (const char * name,
const char * description,
const CORBA::Object_ptr object_ptr)
{
+#ifdef TRADER_AVAILABLE
+
TAO_TRY
{
if (CORBA::is_nil(object_ptr))
@@ -166,12 +184,15 @@ Factory_Trader::export (const char * name,
ACE_ERROR ((LM_ERROR, "Factory_Trader::export: Failed to export factory.\n"));
}
TAO_ENDTRY;
+
+#endif // TRADER_AVAILABLE
}
CORBA::Object_ptr
Factory_Trader::query (const CORBA::String constraint)
{
+#ifdef TRADER_AVAILABLE
TAO_TRY
{
@@ -246,4 +267,12 @@ Factory_Trader::query (const CORBA::String constraint)
ACE_ERROR ((LM_ERROR, "Factory_Trader::query: Failed.\n"));
}
TAO_ENDTRY;
+
+#else // TRADER_AVAILABLE
+
+ return 0;
+
+#endif // TRADER_AVAILABLE
}
+
+
diff --git a/TAO/tests/Quoter/Factory_Trader.h b/TAO/tests/Quoter/Factory_Trader.h
index 39888b5ce24..fdfec0d32aa 100644
--- a/TAO/tests/Quoter/Factory_Trader.h
+++ b/TAO/tests/Quoter/Factory_Trader.h
@@ -14,14 +14,17 @@
//
// ============================================================================
+#if !defined (FACTORY_TRADER_H)
+#define FACTORY_TRADER_H
#include "tao/corba.h"
+
+#ifdef TRADER_AVAILABLE
#include "orbsvcs/Trader/Trader.h"
#include "orbsvcs/Trader/Service_Type_Repository.h"
#include "orbsvcs/CosLifeCycleC.h"
+#endif // TRADER_AVAILABLE
-#if !defined (FACTORY_TRADER_H)
-#define FACTORY_TRADER_H
class Factory_Trader
{
@@ -43,10 +46,15 @@ public:
static const char * GENERIC_FACTORY_INTERFACE_REPOSITORY_ID;
private:
+
+#ifdef TRADER_AVAILABLE
+
TAO_Service_Type_Repository repository_;
TAO_Trader_Factory::TAO_TRADER *trader_ptr_;
TAO_Trading_Components_Impl *trading_Components_ptr_;
TAO_Support_Attributes_Impl *support_Attributes_ptr_;
+
+#endif // TRADER_AVAILABLE
};
#endif // FACTORY_TRADER_H
diff --git a/TAO/tests/Quoter/Makefile b/TAO/tests/Quoter/Makefile
index 8ccd641dae4..cd8f0c608f1 100644
--- a/TAO/tests/Quoter/Makefile
+++ b/TAO/tests/Quoter/Makefile
@@ -3,6 +3,8 @@
#
# needed for the trading service stuff
+ifdef trader
+
ifndef TAO_ROOT
TAO_ROOT = $(ACE_ROOT)/TAO
endif # TAO_ROOT
@@ -36,9 +38,16 @@ endif
LDFLAGS += -L$(STL_ROOT)/lib
+endif # trader
# end of the trading service stuff
-BIN = client server Factory_Finder Generic_Factory #Life_Cycle_Service
+BIN = client server Factory_Finder Generic_Factory Life_Cycle_Service
+
+ifdef trader
+
+CPPFLAGS += -DTRADER_AVAILABLE
+
+endif # trader
BUILD = $(BIN)
@@ -76,9 +85,16 @@ GENERIC_FACTORY_OBJS = $(COMMON_OBJS) Generic_Factory.o Generic_Factory_Impl.o
LIFE_CYCLE_SERVICE_OBJS = $(COMMON_OBJS) Life_Cycle_Service.o Life_Cycle_Service_Impl.o \
Factory_Trader.o Criteria_Evaluator.o
+ifdef trader
LDLIBS = -lorbsvcs -lospace -lTAO
+else
+
+LDLIBS = -lorbsvcs -lTAO
+
+endif
+
#----------------------------------------------------------------------------
# Include macros and targets
#----------------------------------------------------------------------------
diff --git a/TAO/tests/Quoter/run_test.sh b/TAO/tests/Quoter/run_test.sh
index aacfdbc1a5c..38c0e85dbe1 100755
--- a/TAO/tests/Quoter/run_test.sh
+++ b/TAO/tests/Quoter/run_test.sh
@@ -9,8 +9,12 @@
#
# =DESCRIPTION
# This script restarts the Naming, Scheduling and Event Service,
-# if "clean" is specified as a parameter, then the old
-# services are only killed and not restarted
+# "clean" if it is specified as a parameter, then the old
+# services are only killed and not restarted
+# "lifecycle" if it is specified as a parameter, then
+# the LifeCycle Service Object is used
+# inbetween to ask the Generic Factory to
+# create an Quoter.
# save the old working dir
old_dir=$cwd
@@ -60,8 +64,6 @@ if [ -r /tmp/logfile_$login ]; then
rm /tmp/logfile_$login
fi
-echo // Logfile for the script "ss" which startes Name, Scheduling and Event Service > /tmp/logfile_$login
-
nameserviceport=`expr 20023 + $uid`
serverport=`expr 20024 + $uid`
factoryfinderport=`expr 20025 + $uid`
@@ -73,7 +75,7 @@ clientport=`expr 20028 + $uid`
cd $TAO_ROOT/orbsvcs/Naming_Service
./Naming_Service -ORBport $nameserviceport >> /tmp/logfile_$login 2>&1 &
-sleep 2
+sleep 2
IOR=`cat /tmp/logfile_$login | grep IOR | cut -c21-300 | cut -f1 -d">" `
@@ -86,25 +88,37 @@ cd $TAO_ROOT/tests/Quoter
echo // Started server on port $serverport
-sleep 2
+sleep 1
./Factory_Finder -ORBnameserviceior $IOR -ORBport $factoryfinderport >> /tmp/logfile_$login 2>&1 &
echo // Started Factory Finder on port $factoryfinderport
-#sleep 2
+if [ $1 ]; then
+ if [ $1 = "lifecycle" ]; then
+
+ sleep 1
-# ./Life_Cycle_Service -ORBnameserviceior $IOR -ORBport $lifecycleserviceport >> /tmp/logfile_$login 2>&1 &
+ ./Life_Cycle_Service -ORBnameserviceior $IOR -ORBport $lifecycleserviceport >> /tmp/logfile_$login 2>&1 &
-#echo // Started the Life Cycle Service on port $lifecycleserviceport
+ echo // Started Life Cycle Service on port $lifecycleserviceport
+ sleep 1
-sleep 2
+ ./Generic_Factory -l -ORBnameserviceior $IOR -ORBport $genericfactoryport >> /tmp/logfile_$login 2>&1 &
-./Generic_Factory -ORBnameserviceior $IOR -ORBport $genericfactoryport >> /tmp/logfile_$login 2>&1 &
+ echo // Started Generic Factory on port $genericfactoryport
+ echo // using the LifeCycle Service;
-echo // Started Generic Factory on port $genericfactoryport
+ fi
+else
+ sleep 1
+
+ ./Generic_Factory -ORBnameserviceior $IOR -ORBport $genericfactoryport >> /tmp/logfile_$login 2>&1 &
+ echo // Started Generic Factory on port $genericfactoryport
+
+fi
echo "// Enjoy the use ;-)"
echo See what is running: