added child exit handling code and example
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 Feb 2007 15:00:06 +0000 (15:00 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 Feb 2007 15:00:06 +0000 (15:00 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@821 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Application/Settings.pm
src/perlmods/OpenSRF/UnixServer.pm

index 8c2e8d6..561b1d8 100644 (file)
@@ -1,8 +1,12 @@
 package OpenSRF::Application::Settings;
 use OpenSRF::Application;
 use OpenSRF::Utils::SettingsParser;
+use OpenSRF::Utils::Logger qw/$logger/;
 use base 'OpenSRF::Application';
 
+sub child_exit {
+    $logger->debug("settings server child exiting...$$");
+}
 
 
 __PACKAGE__->register_method( method => 'get_host_config', api_name => 'opensrf.settings.host_config.get' );
index b80a9b5..30fed99 100644 (file)
@@ -2,7 +2,7 @@ package OpenSRF::UnixServer;
 use strict; use warnings;
 use base qw/OpenSRF/;
 use OpenSRF::EX qw(:try);
-use OpenSRF::Utils::Logger qw(:level);
+use OpenSRF::Utils::Logger qw(:level $logger);
 use OpenSRF::Transport::PeerHandle;
 use OpenSRF::Application;
 use OpenSRF::AppSession;
@@ -18,12 +18,8 @@ use Carp;
 use IO::Socket::INET;
 use IO::Socket::UNIX;
 
-# XXX Need to add actual logging statements in the code
-my $logger = "OpenSRF::Utils::Logger";
-
 sub DESTROY { confess "Dying $$"; }
 
-
 =head1 What am I
 
 All inbound messages are passed on to the UnixServer for processing.
@@ -259,5 +255,12 @@ sub child_init_hook {
        return OpenSRF::Transport::PeerHandle->retrieve;
 }
 
+sub child_finish_hook {
+    $logger->debug("attempting to call child exit handler...");
+       OpenSRF::Application->application_implementation->child_exit
+               if (OpenSRF::Application->application_implementation->can('child_exit'));
+}
+
+
 1;