File Coverage

File:blib/lib/OpenSRF/Transport/Listener.pm
Coverage:58.6%

linestmtbrancondsubpodtimecode
1package OpenSRF::Transport::Listener;
2
9
9
9
50
31
58
use base 'OpenSRF';
3
9
9
9
62
35
59
use OpenSRF::Utils::Logger qw(:level);
4
9
9
9
101
38
131
use OpenSRF::Transport::SlimJabber::Inbound;
5
9
9
9
1220
34
72
use base 'OpenSRF::Transport::SlimJabber::Inbound';
6
7 - 21
=head1 Description

This is the empty class that acts as the subclass of the transport listener.  My API
includes

new( $app )
	create a new Listener with appname $app

initialize()
	Perform any transport layer connections/authentication.

listen()
	Block, wait for, and process incoming messages

=cut
22
23 - 29
=head2 set_listener()

Sets my superclass.  Pass in a string representing the perl module
(e.g. OpenSRF::Transport::Jabber::JInbound) to be used as the
superclass and it will be pushed onto @ISA.

=cut
30
31sub set_listener {
32
0
1
        my( $class, $listener ) = @_;
33
0
        OpenSRF::Utils::Logger->debug("Loading Listener $listener");
34
0
        if( $listener ) {
35
0
                $listener->use;
36
0
                if( $@ ) {
37
0
                        OpenSRF::Utils::Logger->error(
38                                        "Unable to set transport listener: $@", ERROR );
39                }
40
0
                unshift @ISA, $listener;
41        }
42}
43
44
451;