Changeset 10579 for trunk/Nebulous/lib
- Timestamp:
- Dec 8, 2006, 12:23:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/lib/Nebulous/Server/SOAP.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/lib/Nebulous/Server/SOAP.pm
r4440 r10579 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SOAP.pm,v 1. 2 2005-06-30 02:35:06jhoblitt Exp $3 # $Id: SOAP.pm,v 1.3 2006-12-08 22:23:25 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SOAP; … … 8 8 use warnings FATAL => qw( all ); 9 9 10 our $VERSION = '0.0 1';10 our $VERSION = '0.02'; 11 11 12 import SOAP::Data 'name'; 13 use Apache2::Const -compile => qw(OK); 12 14 use Nebulous::Server; 13 15 use SOAP::Lite; 14 import SOAP::Data 'name';15 16 16 17 our $AUTOLOAD; 18 19 our @args; 20 our $neb; 21 22 sub new_on_init { 23 my $self = shift; 24 25 require mod_perl2; 26 require Apache2::Module; 27 require Apache2::ServerUtil; 28 29 @args = @_; 30 31 my $s = Apache2::ServerUtil->server; 32 $s->push_handlers(PerlChildInitHandler => \&init); 33 34 return $self; 35 } 36 37 sub init { 38 my $self = shift; 39 40 $neb = Nebulous::Server->new(@args); 41 42 return Apache2::Const::OK; 43 } 17 44 18 45 sub AUTOLOAD { … … 22 49 return undef if $method eq 'DESTROY'; 23 50 24 return name( result => Nebulous::Server->$method( @_ ) ); 51 die "process $$ has not been initialized" 52 unless defined $neb; 53 54 die "method $method does not exist in Nebulous::Server" 55 unless defined ${Nebulous::Server::}{$method}; 56 57 # create a sub and install it in the package so successive calls to the 58 # same method don't have to go through AUTOLOAD 59 my $method_sub; 60 eval q| 61 $method_sub = sub { 62 my $self = shift; 63 return name( result => $neb->| . $method . q|( @_ ) ); 64 } 65 |; 66 die $@ if $@; 67 68 no strict 'refs'; 69 *{"${package}::${method}"} = $method_sub; 70 use strict; 71 72 # invoke the method we just created 73 return $self->$method(@_); 25 74 } 26 75
Note:
See TracChangeset
for help on using the changeset viewer.
