]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/perlmods/OpenSRF/Transport/PeerHandle.pm
moving to UNIVERSAL::require to suck in implementation modules
[OpenSRF.git] / src / perlmods / OpenSRF / Transport / PeerHandle.pm
1 package OpenSRF::Transport::PeerHandle;
2 use OpenSRF::Utils::Logger qw(:level);
3 use OpenSRF::EX;
4 use base qw/OpenSRF::Transport::SlimJabber::PeerConnection/;
5 use vars '@ISA';
6
7 my $peer;
8
9 =head2 peer_handle( $handle )
10
11 Assigns the object that will act as the peer connection handle.
12
13 =cut
14 sub peer_handle {
15         my( $class, $handle ) = @_;
16         if( $handle ) { $peer = $handle; }
17         return $peer;
18 }
19
20
21 =head2 set_peer_client( $peer )
22
23 Sets the class that will act as the superclass of this class.
24 Pass in a string representing the module to be used as the superclass,
25 and that module is 'used' and unshifted into @ISA.  We now have that
26 classes capabilities.  
27
28 =cut
29 sub set_peer_client {
30         my( $class, $peer ) = @_;
31         if( $peer ) {
32                 $peer->use;
33                 if( $@ ) {
34                         throw OpenSRF::EX::PANIC ( "Unable to set peer client: $@" );
35                 }
36                 unshift @ISA, $peer;
37         }
38 }
39
40 1;