From: miker Date: Fri, 11 Mar 2005 13:58:17 +0000 (+0000) Subject: automatic generation of most "Publish" methods X-Git-Tag: osrf_rel_2_0_1~1663 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0aff932c08bc1cd0f831d4db10a33b891a17fcc8;p=OpenSRF.git automatic generation of most "Publish" methods git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@209 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index b79c785..ca3ece8 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -22,11 +22,21 @@ $log = 'OpenSRF::Utils::Logger'; our $in_request = 0; our @pending_requests; +sub package { + my $self = shift; + return $self->{api_name}; +} + sub api_name { my $self = shift; return $self->{api_name}; } +sub api_level { + my $self = shift; + return $self->{api_name}; +} + sub server_class { my $class = shift; if($class) { @@ -207,6 +217,13 @@ sub handler { return 1; } +sub is_registered { + my $self = shift; + my $api_name = shift; + my $api_level = shift || 1; + return exists($_METHODS[$api_level]{$api_name}); +} + sub register_method { my $self = shift; my $app = ref($self) || $self; @@ -309,7 +326,7 @@ sub method_lookup { my $no_remote = shift || 0; # this instead of " || 1;" above to allow api_level 0 - $proto = 1 unless (defined $proto); + $proto = $self->api_level unless (defined $proto); my $class = ref($self) || $self; diff --git a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm index c6c7af5..b33d5a0 100644 --- a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm +++ b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm @@ -175,7 +175,6 @@ sub handler { } else { $log->debug("Request was handled internally", DEBUG); } - $log->debug("Returning to ".join('::',(caller)[0,3]), DEBUG); return 1;