X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnection.pm;h=8f4d44304db1cffc5b473c9f8e69b188c821634c;hp=94bea15a0364194257831a4c879c4cb22648b172;hb=c5736e1ce44d413c01e9497aa49d4174f9bb37bf;hpb=3687a42d0f4ac20dfd2cb31cb76cf9866ee63f14 diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index 94bea15..8f4d443 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -129,17 +129,21 @@ sub send_class_call { sub register_class_call_handler { my ($self) = @_; $self->local_objects_by_id->{'class_call_handler'} ||= do { - my $o = Object::Remote::CodeContainer->new( - code => sub { - my ($class, $method) = (shift, shift); - use_module($class)->$method(@_); - } - ); + my $o = $self->new_class_call_handler; $self->_local_object_to_id($o); $o; }; } +sub new_class_call_handler { + Object::Remote::CodeContainer->new( + code => sub { + my ($class, $method) = (shift, shift); + use_module($class)->$method(@_); + } + ); +} + sub register_remote { my ($self, $remote) = @_; weaken($self->remote_objects_by_id->{$remote->id} = $remote);