App::CallDispatcher - synchronous (potentially remote) call_dispatcher invocation


App-Context documentation Contained in the App-Context distribution.

Index


Code Index:

NAME

Top

App::CallDispatcher - synchronous (potentially remote) call_dispatcher invocation

SYNOPSIS

Top

    use App;

    $context = App->context();
    $call_dispatcher = $context->service("CallDispatcher");  # or ...
    $call_dispatcher = $context->call_dispatcher();

    $call_dispatcher->call($request, $response);
    $response = $call_dispatcher->call($request);
    $response = $call_dispatcher->call(%named);

DESCRIPTION

Top

A CallDispatcher service is a means by which a function call (perhaps remote) may be made synchronously.

Class Group: CallDispatcher

Top

The following classes might be a part of the CallDispatcher Class Group.

* Class: App::CallDispatcher
* Class: App::CallDispatcher::HTTPSimple
* Class: App::CallDispatcher::SOAP
* Class: App::CallDispatcher::pRPC
* Class: App::CallDispatcher::PlRPC
* Class: App::CallDispatcher::Messaging

Class: App::CallDispatcher

Top

A CallDispatcher service is a means by which a function call (perhaps remote) may be made synchronously or asynchronously.

 * Throws: App::Exception::CallDispatcher
 * Since:  0.01

Class Design

...

Constructor Methods:

Top

new()

The constructor is inherited from App::Service|App::Service/"new()".

Public Methods:

Top

call()

    * Signature: @returnvals = $call_dispatcher->call($service, $name, $method, $args);
    * Param:     $service           string  [in]
    * Param:     $name              string  [in]
    * Param:     $method            string  [in]
    * Param:     $args              ARRAY   [in]
    * Return:    @returnvals        any
    * Throws:    App::Exception::CallDispatcher
    * Since:     0.01

    Sample Usage: 

    @returnvals = $call_dispatcher->call("Repository","db",
        "get_rows",["city",{city_cd=>"LAX"},["city_cd","state","country"]]);

The default call dispatcher is a local call dispatcher. It simply passes the call() on to the local context for execution. It results in an in-process method call rather than a remote method call.

Protected Methods:

Top

service_type()

Returns 'CallDispatcher';

    * Signature: $service_type = App::CallDispatcher->service_type();
    * Param:     void
    * Return:    $service_type  string
    * Since:     0.01

    $service_type = $cdisp->service_type();

ACKNOWLEDGEMENTS

Top

 * Author:  Stephen Adkins <spadkins@gmail.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.

SEE ALSO

Top

App::Context|App::Context, App::Service|App::Service


App-Context documentation Contained in the App-Context distribution.
#############################################################################
## $Id: CallDispatcher.pm 6783 2006-08-11 17:43:28Z spadkins $
#############################################################################

package App::CallDispatcher;
$VERSION = (q$Revision: 6783 $ =~ /(\d[\d\.]*)/)[0];  # VERSION numbers generated by svn

use App;
use App::Service;
@ISA = ( "App::Service" );

use strict;

#############################################################################
# CLASS GROUP
#############################################################################

#############################################################################
# CLASS
#############################################################################

#############################################################################
# CONSTRUCTOR METHODS
#############################################################################

#############################################################################
# new()
#############################################################################

#############################################################################
# PUBLIC METHODS
#############################################################################

#############################################################################
# call()
#############################################################################

sub call {
    my ($self, $service, $name, $method, $args) = @_;
    my $context = $self->{context};
    my @returnvals = $context->call($service, $name, $method, $args);
}

#############################################################################
# PROTECTED METHODS
#############################################################################

#############################################################################
# Method: service_type()
#############################################################################

sub service_type () { 'CallDispatcher'; }

1;