/[cvs]/nfo/perl/libs/OEF/Component/WebService/RpcXml.pm
ViewVC logotype

Diff of /nfo/perl/libs/OEF/Component/WebService/RpcXml.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Fri Apr 4 17:28:59 2003 UTC revision 1.6 by jonen, Wed Jul 2 11:00:40 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ##  ------------------------------------------------------------------------  ##  ------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.6  2003/07/02 11:00:40  jonen
6    ##  fixed: die now if http-port is used by other app
7    ##
8    ##  Revision 1.5  2003/07/01 18:11:15  joko
9    ##  fixed: renamed package name according to new filenames
10    ##
11    ##  Revision 1.4  2003/06/06 03:24:14  joko
12    ##  + SymbolAliasing
13    ##
14  ##  Revision 1.3  2003/04/04 17:28:59  joko  ##  Revision 1.3  2003/04/04 17:28:59  joko
15  ##  minor update: commented hardcoded stuff  ##  minor update: commented hardcoded stuff
16  ##  ##
# Line 14  Line 23 
23  ##  ------------------------------------------------------------------------  ##  ------------------------------------------------------------------------
24    
25    
26  package OEF::Component::WebService;  package OEF::Component::WebService::RpcXml;
27    
28  use strict;  use strict;
29  use warnings;  use warnings;
# Line 26  use Data::Dumper; Line 35  use Data::Dumper;
35  use RPC::XML;  use RPC::XML;
36  use RPC::XML::SessionServer;  use RPC::XML::SessionServer;
37  use RPC::XML::Procedure;  use RPC::XML::Procedure;
38    use Data::Mungle::Code::Symbol qw( alias_simple );
39    
40  # this is a global counter for giving unnamed webservices a unique id  # this is a global counter for giving unnamed webservices a unique id
41  our $instance_counter;  our $instance_counter;
# Line 58  sub start { Line 68  sub start {
68        }        }
69      );      );
70            
71        #print Dumper($self->{_daemon}) . "\n";
72        if(!ref($self->{_daemon})) { die($self->{_daemon} . ", maybe same daemon or other daemon on same port is already running??" . "\n"); }
73        
74    # API    # API
75      # load api module    
76        # 1. load api module
77      my $api = DesignPattern::Object->fromPackage($self->{api_module}) or die("Could not load Api-Module '$self->{api_module}'.");      my $api = DesignPattern::Object->fromPackage($self->{api_module}) or die("Could not load Api-Module '$self->{api_module}'.");
78      # build complete bunch of api declaration metadata handling recursive plugin declaration and stuff ...      # build complete bunch of api declaration metadata handling recursive plugin declaration and stuff ...
79      #$api->build([qw( OEF::YAA::API::Jobs )]);      #$api->build([qw( OEF::YAA::API::Jobs )]);
80      $api->build($self->{api_submodules});      $api->build($self->{api_submodules});
81      # get it!      
82        # 2. query it for to-be-published methods ...
83      my $procs = $api->getApiMetadata() or die("Could not load Api-Declarations from '$self->{api_module}'.");      my $procs = $api->getApiMetadata() or die("Could not load Api-Declarations from '$self->{api_module}'.");
84      # ... and propagate metadata for each method to daemon instance which is not yet running      # ... and propagate metadata for each method to daemon instance which is not yet running
85      foreach my $proc (@{$procs}) {      foreach my $proc (@{$procs}) {
86        $self->{_daemon}->add_method($proc);        $self->{_daemon}->add_method($proc);
87      }      }
88        
89        # 3. SymbolAliasing: query it for to-be-established symbols ...
90        my $symbols;
91        $symbols = $api->getSymbolMetadata() if $api->can("getSymbolMetadata");
92        # ... and vivify them each pointing to a reference.
93        foreach my $symbol (@{$symbols}) {
94          $symbol->{slot} = $self->{_daemon};
95          alias_simple($symbol);
96        }
97    
98    # run service / activate instance    # run service / activate instance
99      # Never returns...      # Never returns...

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed