]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/perlmods/OpenSRF/Transport/Listener.pm
Initial revision
[OpenSRF.git] / src / perlmods / OpenSRF / Transport / Listener.pm
1 package OpenSRF::Transport::Listener;
2 use base 'OpenSRF';
3 use OpenSRF::Utils::Logger qw(:level);
4
5
6 =head1 Description
7
8 This is the empty class that acts as the subclass of the transport listener.  My API
9 includes
10
11 new( $app )
12         create a new Listener with appname $app
13
14 initialize()
15         Perform any transport layer connections/authentication.
16
17 listen()
18         Block, wait for, and process incoming messages
19
20 =cut
21
22 =head2 set_listener()
23
24 Sets my superclass.  Pass in a string representing the perl module
25 (e.g. OpenSRF::Transport::Jabber::JInbound) to be used as the
26 superclass and it will be pushed onto @ISA.
27
28 =cut
29
30 sub set_listener {
31         my( $class, $listener ) = @_;
32         if( $listener ) {
33                 eval "use $listener;";
34                 if( $@ ) {
35                         OpenSRF::Utils::Logger->error(
36                                         "Unable to set transport listener: $@", ERROR );
37                 }
38                 unshift @ISA, $listener;
39         }
40 }
41
42
43 1;