diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-04-28 00:27:44 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-04-28 00:27:44 +0000 |
commit | 8e7cf678cd059b0f60c30cb5d07049b5c8718e72 (patch) | |
tree | ed844dd570ed195df9a5c852712f05743dba81ac /netsvcs | |
parent | 41b81b9d3d19ea44692ecb1777e92b697c825a40 (diff) | |
download | ATCD-8e7cf678cd059b0f60c30cb5d07049b5c8718e72.tar.gz |
*** empty log message ***
Diffstat (limited to 'netsvcs')
-rw-r--r-- | netsvcs/lib/Server_Logging_Handler.cpp | 55 | ||||
-rw-r--r-- | netsvcs/lib/Server_Logging_Handler.h | 47 |
2 files changed, 51 insertions, 51 deletions
diff --git a/netsvcs/lib/Server_Logging_Handler.cpp b/netsvcs/lib/Server_Logging_Handler.cpp index ee1e97047ed..4e9e5138ed9 100644 --- a/netsvcs/lib/Server_Logging_Handler.cpp +++ b/netsvcs/lib/Server_Logging_Handler.cpp @@ -11,15 +11,6 @@ template <ACE_PEER_STREAM_1, class COUNTER, ACE_SYNCH_1> COUNTER ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::request_count_ = (COUNTER) 0; #endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ -int -ACE_Server_Logging_Acceptor::make_svc_handler (SERVER_LOGGING_HANDLER *&handler) -{ - ACE_NEW_RETURN (handler, SERVER_LOGGING_HANDLER (ACE_Service_Config::thr_mgr (), - &this->lock_), - -1); - return 0; -} - int ACE_Server_Logging_Acceptor::parse_args (int argc, char *argv[]) { @@ -91,10 +82,7 @@ ACE_Server_Logging_Acceptor::init (int argc, template <ACE_PEER_STREAM_1, class COUNTER, ACE_SYNCH_1> ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::ACE_Server_Logging_Handler - (ACE_Thread_Manager *, - ACE_SYNCH_MUTEX_T *lock) - : lock_ (*lock) - + (ACE_Thread_Manager *) { this->host_name_[0] = '\0'; // Initialize to a known state. } @@ -144,7 +132,7 @@ ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::handle_logg { // Serialize output, if necessary (i.e., if we are running // in separate threads). - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); + ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, *this->lock_, -1)); lp.print (this->host_name_, 0, stderr); } @@ -201,25 +189,15 @@ ACE_Server_Logging_Handler<ACE_PEER_STREAM_2, COUNTER, ACE_SYNCH_2>::handle_inpu return this->handle_logging_record () > 0 ? 0 : -1; } -class ACE_Thr_Server_Logging_Acceptor : public ACE_Strategy_Acceptor<ACE_Thr_Server_Logging_Handler, LOGGING_PEER_ACCEPTOR> - // = TITLE - // This class implements the ACE multi-threaded logging service. - // - // = DESCRIPTION - // This class contains the service-specific methods that can't - // easily be factored into the <ACE_Strategy_Acceptor>. +int +ACE_Thr_Server_Logging_Acceptor::make_svc_handler (ACE_Thr_Server_Logging_Handler *&handler) { -public: - virtual int init (int argc, char *argv[]); - // Dynamic linking hook. - - int parse_args (int argc, char *argv[]); - // Parse svc.conf arguments. - -private: - ACE_Schedule_All_Threaded_Strategy<ACE_Thr_Server_Logging_Handler> scheduling_strategy_; - // The scheduling strategy is designed for multi-threaded services. -}; + ACE_NEW_RETURN (handler, + ACE_Thr_Server_Logging_Handler (ACE_Service_Config::thr_mgr (), + &this->lock_), + -1); + return 0; +} int ACE_Thr_Server_Logging_Acceptor::parse_args (int argc, char *argv[]) @@ -296,12 +274,6 @@ ACE_Thr_Server_Logging_Acceptor::init (int argc, ACE_SVC_FACTORY_DEFINE (ACE_Server_Logging_Acceptor) ACE_SVC_FACTORY_DEFINE (ACE_Thr_Server_Logging_Acceptor) -// No-op... - -ACE_Thr_Server_Logging_Handler::ACE_Thr_Server_Logging_Handler (ACE_Thread_Manager *) -{ -} - // Override definition in the ACE_Svc_Handler class (spawn a new // thread if we're configured with ACE_HAS_THREADS!). @@ -332,6 +304,13 @@ ACE_Thr_Server_Logging_Handler::open (void *) return 0; } +ACE_Thr_Server_Logging_Handler::ACE_Thr_Server_Logging_Handler + (ACE_Thread_Manager *, + ACE_SYNCH_MUTEX *lock) +{ + this->lock_ = lock; +} + // Process remote logging records. int diff --git a/netsvcs/lib/Server_Logging_Handler.h b/netsvcs/lib/Server_Logging_Handler.h index e1cddddd0cc..4f61190cdf8 100644 --- a/netsvcs/lib/Server_Logging_Handler.h +++ b/netsvcs/lib/Server_Logging_Handler.h @@ -34,8 +34,8 @@ class ACE_Server_Logging_Handler : public ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE // Defines the classes that perform server logging daemon // functionality. public: - ACE_Server_Logging_Handler (ACE_Thread_Manager * = 0, - ACE_SYNCH_MUTEX_T *lock = 0); + ACE_Server_Logging_Handler (ACE_Thread_Manager * = 0); + // Constructor. virtual int open (void * = 0); // Hook called by <Server_Logging_Acceptor> when connection is @@ -56,7 +56,7 @@ protected: char host_name_[MAXHOSTNAMELEN + 1]; // Name of the host we are connected to. - ACE_SYNCH_MUTEX_T &lock_; + ACE_SYNCH_MUTEX_T *lock_; // Reference to the lock used to serialize output. }; @@ -87,16 +87,7 @@ protected: int parse_args (int argc, char *argv[]); // Parse svc.conf arguments. - virtual int make_svc_handler (SERVER_LOGGING_HANDLER *&); - // Factory that creates a new <SERVER_LOGGING_HANDLER>. We need to - // specialize this since the <lock_> held by this Acceptor must be - // passed into the <SERVER_LOGGING_HANDLER>. - private: - ACE_SYNCH_MUTEX lock_; - // Lock used to serialize output by the various - // <ACE_Server_Logging_Handler>'s. - ACE_Schedule_All_Reactive_Strategy<SERVER_LOGGING_HANDLER> scheduling_strategy_; // The scheduling strategy is designed for Reactive services. }; @@ -119,7 +110,8 @@ class ACE_Svc_Export ACE_Thr_Server_Logging_Handler : public ACE_Server_Logging_ // Each client is handled in its own separate thread. { public: - ACE_Thr_Server_Logging_Handler (ACE_Thread_Manager * = 0); + ACE_Thr_Server_Logging_Handler (ACE_Thread_Manager * = 0, + ACE_SYNCH_MUTEX * = 0); virtual int open (void * = 0); // Override activation definition in the ACE_Svc_Handler class (will @@ -129,6 +121,35 @@ public: // Process remote logging records. }; +class ACE_Thr_Server_Logging_Acceptor : public ACE_Strategy_Acceptor<ACE_Thr_Server_Logging_Handler, LOGGING_PEER_ACCEPTOR> + // = TITLE + // This class implements the ACE multi-threaded logging service. + // + // = DESCRIPTION + // This class contains the service-specific methods that can't + // easily be factored into the <ACE_Strategy_Acceptor>. +{ +public: + virtual int init (int argc, char *argv[]); + // Dynamic linking hook. + + int parse_args (int argc, char *argv[]); + // Parse svc.conf arguments. + + virtual int make_svc_handler (ACE_Thr_Server_Logging_Handler *&); + // Factory that creates a new <SERVER_LOGGING_HANDLER>. We need to + // specialize this since the <lock_> held by this Acceptor must be + // passed into the <SERVER_LOGGING_HANDLER>. + +private: + ACE_SYNCH_MUTEX lock_; + // Lock used to serialize output by the various + // <ACE_Server_Logging_Handler>'s. + + ACE_Schedule_All_Threaded_Strategy<ACE_Thr_Server_Logging_Handler> scheduling_strategy_; + // The scheduling strategy is designed for multi-threaded services. +}; + ACE_SVC_FACTORY_DECLARE (ACE_Server_Logging_Acceptor) ACE_SVC_FACTORY_DECLARE (ACE_Thr_Server_Logging_Acceptor) |