diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/orbsvcs/Logging_Service/Notify_Logging_Service | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/orbsvcs/Logging_Service/Notify_Logging_Service')
8 files changed, 0 insertions, 588 deletions
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore deleted file mode 100644 index bf00697bc77..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Notify_Logging_Service diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am deleted file mode 100644 index 42c6388bae0..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am +++ /dev/null @@ -1,73 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_ROOT = $(top_srcdir) - - -## Makefile.Notify_Logging_Service.am - -if !BUILD_MINIMUM_CORBA - -bin_PROGRAMS = Notify_Logging_Service - -Notify_Logging_Service_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs \ - -DTAO_HAS_TYPED_EVENT_CHANNEL - -Notify_Logging_Service_SOURCES = \ - Notify_Logging_Server.cpp \ - Notify_Logging_Service.cpp \ - Notify_Logging_Service.h - -Notify_Logging_Service_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin_Serv.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Serv.la \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \ - $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Skel.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -endif !BUILD_MINIMUM_CORBA - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp deleted file mode 100644 index 14b848c2d27..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//$Id$ -#include "Notify_Logging_Service.h" -#include "ace/OS_main.h" -#include "orbsvcs/Shutdown_Utilities.h" -#include "tao/debug.h" - -ACE_RCSID (Notify_Logging_Service, - Notify_Logging_Server, - "$Id$") - - -class Logging_Svc_Shutdown - : public Shutdown_Functor -{ -public: - Logging_Svc_Shutdown (Notify_Logging_Service& svc); - - void operator() (int which_signal); - -private: - Notify_Logging_Service& svc_; -}; - -Logging_Svc_Shutdown::Logging_Svc_Shutdown (Notify_Logging_Service& svc) - : svc_ (svc) -{ -} - -void -Logging_Svc_Shutdown::operator() (int which_signal) -{ - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "Notify_Logging_Service: shutting down on signal %d\n", - which_signal)); - - ACE_DECLARE_NEW_CORBA_ENV; - (void) this->svc_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -// Driver function for the Notify_Logging_Service. - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - Notify_Logging_Service service; - - Logging_Svc_Shutdown killer (service); - Service_Shutdown kill_contractor (killer); - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - int rc; - - rc = service.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (rc == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Failed to initialize the Telecom Log Service.\n"), - 1); - - rc = service.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - if (rc == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Failed to start the Telecom Log Service.\n"), - 1); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Failed to start the Telecom Log Service.\n"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp deleted file mode 100644 index fd898bddc31..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "Notify_Logging_Service.h" -#include "ace/Get_Opt.h" -#include "ace/Dynamic_Service.h" -#include "tao/debug.h" -#include "tao/IORTable/IORTable.h" -#include "orbsvcs/Notify/Service.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID (Notify_Logging_Service, - Notify_Logging_Service, - "$Id$") - - -Notify_Logging_Service::Notify_Logging_Service (void) - : service_name_ (NOTIFY_KEY), - ior_file_name_ (0), - pid_file_name_ (0), - bind_to_naming_service_ (1), - nthreads_ (0) -{ - // No-Op. -} - -Notify_Logging_Service::~Notify_Logging_Service (void) -{ - // No-Op. -} - -int -Notify_Logging_Service::init_ORB (int& argc, char *argv [] - ACE_ENV_ARG_DECL) -{ - this->orb_ = CORBA::ORB_init (argc, - argv, - "" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->notify_service_ = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFY_DEF_EMO_FACTORY_NAME); - - if (this->notify_service_ == 0) - { - ACE_DEBUG ((LM_DEBUG, "Notify Service not found! check conf. file\n")); - return -1; - } - - CORBA::Object_var poa_obj = - this->orb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (CORBA::is_nil (poa_obj.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to resolve the RootPOA.\n"), - -1); - - this->poa_ = - PortableServer::POA::_narrow (poa_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - PortableServer::POAManager_var poa_manager = - this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; -} - -int -Notify_Logging_Service::parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:t::x")); - int opt; - - while ((opt = get_opt ()) != EOF) - { - switch (opt) - { - case 'n': - service_name_ = get_opt.opt_arg(); - break; - - case 'o': - ior_file_name_ = get_opt.opt_arg(); - break; - - case 'p': - pid_file_name_ = get_opt.opt_arg(); - break; - - case 't': - nthreads_ = ACE_OS::atoi (get_opt.opt_arg ()); - break; - - case 'x': - bind_to_naming_service_ = 0; - break; - - case '?': - default: - ACE_DEBUG ((LM_DEBUG, - "Usage: %s " - "-n service_name " - "-o ior_file_name " - "-p pid_file_name " - "-x [disable naming service bind] " - "\n", - argv[0])); - return -1; - } - } - - return 0; -} - -int -Notify_Logging_Service::init (int argc, char *argv[] - ACE_ENV_ARG_DECL) -{ - // initalize the ORB. - if (this->init_ORB (argc, argv - ACE_ENV_ARG_PARAMETER) != 0) - return -1; - - if (this->parse_args (argc, argv) == -1) - return -1; - - this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Activate the factory - this->notify_factory_ = - notify_service_->create (this->poa_.in () - ACE_ENV_ARG_PARAMETER); - - ACE_NEW_THROW_EX (this->notify_log_factory_, - TAO_NotifyLogFactory_i (this->notify_factory_.in ()), - CORBA::NO_MEMORY ()); - - DsNotifyLogAdmin::NotifyLogFactory_var obj = - notify_log_factory_->activate (this->orb_.in (), - this->poa_.in () - ACE_ENV_ARG_PARAMETER); - - ACE_CHECK_RETURN (-1); - - CORBA::String_var ior = - this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (true) - { - CORBA::Object_var table_object = - this->orb_->resolve_initial_references ("IORTable" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in ()); - ACE_CHECK_RETURN (-1); - - adapter->bind("NotifyLogService", ior.in ()); - ACE_CHECK_RETURN (-1); - } - - if (ior_file_name_ != 0) - { - FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w")); - if (iorf == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_file_name_), - -1); - } - - ACE_OS::fprintf (iorf, "%s\n", ior.in ()); - ACE_OS::fclose (iorf); - } - - if (pid_file_name_ != 0) - { - FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w")); - if (pidf != 0) - { - ACE_OS::fprintf (pidf, - "%ld\n", - static_cast<long> (ACE_OS::getpid ())); - ACE_OS::fclose (pidf); - } - } - - if (bind_to_naming_service_) - { - // Resolve the naming service. - resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Register the Factory - ACE_ASSERT (!CORBA::is_nil (this->naming_.in ())); - - CosNaming::Name name (1); - name.length (1); - name[0].id = CORBA::string_dup (this->service_name_); - ACE_CHECK_RETURN (-1); - - this->naming_->rebind (name, - obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - - return 0; -} - -void -Notify_Logging_Service::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL) -{ - CORBA::Object_var naming_obj = - this->orb_->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Need to check return value for errors. - if (CORBA::is_nil (naming_obj.in ())) - ACE_THROW (CORBA::UNKNOWN ()); - - this->naming_ = - CosNaming::NamingContext::_narrow (naming_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -int -Notify_Logging_Service::run (ACE_ENV_SINGLE_ARG_DECL) -{ - if (this->nthreads_ > 0) - { - if (this->activate ((THR_NEW_LWP | THR_JOINABLE), this->nthreads_) != 0) - return -1; - - this->thr_mgr ()->wait (); - return 0; - } - - this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return 0; -} - -int -Notify_Logging_Service::svc () -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - return -1; - } - ACE_ENDTRY; - - return 0; -} - -void -Notify_Logging_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL) -{ - // @@ JTC - factory object isn't activated on root poa. -#if 0 - // Deactivate. - PortableServer::ObjectId_var oid = - this->poa_->reference_to_id (this->notify_log_factory_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // deactivate from the poa. - this->poa_->deactivate_object (oid.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif - - if (bind_to_naming_service_) - { - CosNaming::Name name (1); - name.length (1); - name[0].id = CORBA::string_dup (this->service_name_); - ACE_CHECK; - - this->naming_->unbind (name - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - // shutdown the ORB. - if (!CORBA::is_nil (this->orb_.in ())) - this->orb_->shutdown (); -} diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h deleted file mode 100644 index c6d5f3a459b..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- C++ -*- */ - -// ============================================================================ -/** - * @file Notify_Logging_Service.h - * - * $Id$ - * - * Front End of the Telecom Log Service - * Notify_Logging_Service - * - * - * @author D A Hanvey (d.hanvey@qub.ac.uk) - */ -// ============================================================================ - -#ifndef NOTIFY_LOGGING_SERVICE_H -#define NOTIFY_LOGGING_SERVICE_H - -#include "ace/Task.h" -#include "tao/PortableServer/PortableServer.h" -#include "orbsvcs/CosNamingC.h" -#include "orbsvcs/Notify/Service.h" -#include "orbsvcs/DsLogAdminC.h" -#include "orbsvcs/DsNotifyLogAdminC.h" -#include "orbsvcs/Log/NotifyLogFactory_i.h" - -#define NOTIFY_KEY "NotifyLogFactory" - -class Notify_Logging_Service - : public ACE_Task_Base -{ - // = TITLE - // Notify_Logging_Service - // - // = DESCRIPTION - // Implementation of the Telecom Log Service - - public: - // = Initialization and termination methods. - Notify_Logging_Service (void); - // Constructor. - - virtual ~Notify_Logging_Service (void); - // Destructor. - - int init (int argc, char *argv[] ACE_ENV_ARG_DECL); - // Initializes the Telecom Log Service. - // Returns 0 on success, -1 on error. - - int run (ACE_ENV_SINGLE_ARG_DECL); - // Run the Telecom Log Service. - // Returns 0 on success, -1 on error. - - void shutdown (ACE_ENV_SINGLE_ARG_DECL); - // Shutdown the Telecom Service. - // Returns 0 on success, -1 on error. - -protected: - int init_ORB (int& argc, char *argv [] - ACE_ENV_ARG_DECL); - // initialize the ORB. - - int parse_args (int argc, char *argv[]); - // Parses the command line arguments. - - void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL); - // Resolve the naming service. - - int svc (); - // Run worker threads. - - // = Data members - - TAO_Notify_Service* notify_service_; - - CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_; - // The Factory. - - TAO_NotifyLogFactory_i *notify_log_factory_; - // The Notify Log Factory. - - CORBA::ORB_var orb_; - // The ORB that we use. - - PortableServer::POA_var poa_; - // Reference to the root poa. - - CosNaming::NamingContext_var naming_; - // A naming context. - - const char* service_name_; - // The name we use to bind with the NameService - - const char* ior_file_name_; - // The name of the file where we output the factory IOR. - - const char* pid_file_name_; - // The name of the file where we output the process id. - - int bind_to_naming_service_; - // If true, bind to naming service - - int nthreads_; - // Number of worker threads. -}; -#endif /* NOTIFY_LOGGING_SERVICE_H */ diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc deleted file mode 100644 index 3990281b3e6..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc +++ /dev/null @@ -1,5 +0,0 @@ -// $Id$ - -project: namingexe, iortable, core, dsnotifylogadmin_serv, valuetype { - exename = Notify_Logging_Service -} diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README deleted file mode 100755 index 282768d11e9..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README +++ /dev/null @@ -1,14 +0,0 @@ -The service is registered with the naming service with the name -"NotifyLogFactory" . - -To run the Notify Logging Service: ------------------------- -1. you should have a running Naming Service. - if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service - -2. execute the Notify_Logging_Service - at $TAO_ROOT/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service - - -The idl spec is $TAO_ROOT/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl -see also $TAO_ROOT/orbsvcs/orbsvcs/DsLogNotification.idl diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf deleted file mode 100755 index 8ffdb5ee8f1..00000000000 --- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf +++ /dev/null @@ -1,3 +0,0 @@ -##$Id$ -## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" |