Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::Utils::Proxy Class Reference
Inheritance diagram for Bio::EnsEMBL::Utils::Proxy:

List of all members.


Class Summary

Synopsis

  #Simple arounds logging proxy
  package myproxy;
  use base qw/Bio::EnsEMBL::Utils::Proxy/;
  sub __resolver {
    my ($invoker, $package, $method) = @_;
    return sub {
      my ($self, @args);
      warn "Entering into ${package}::${method}";
      my @capture = $self-\>$method(@args);
      warn "Exiting from ${package}::${method}";
      return @capture;
    };
  }
  
  1;

Description

This class offers Proxy objects similar to those found in Java's 
java.lang.reflect.Proxy object. This class should be overriden and 
then implement __resolver(). The C<__resolver()> method returns a 
subroutine to the intended action which the proxy object installs into
the calling class' scope.
All methods internal to the proxy are prefixed with a double underscore
to avoid corruption/intrusion into the normal public and private scope of 
most classes.
 

Definition at line 38 of file Proxy.pm.

Available Methods

protected Any __proxy ()
protected __resolver ()
public void AUTOLOAD ()
public Code can ()
public void DESTROY ()
public Boolean isa ()
public Bio::EnsEMBL::Utils::Proxy new ()

Method Documentation

protected Any Bio::EnsEMBL::Utils::Proxy::__proxy ( )
 
  Example			: -
  Description	: The proxy accessor
  Returntype 	: Any the proxied object
  Exceptions 	: None 
  Caller     	: -
  Status     	: -
 
Code:
click to view
protected Bio::EnsEMBL::Utils::Proxy::__resolver ( )

Undocumented method

Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::ProxyDBConnection, and Bio::EnsEMBL::PaddedSlice.

public void Bio::EnsEMBL::Utils::Proxy::AUTOLOAD ( )
  Example     : -
  Description : Performs calls to __resolver() and installs the subroutine
                into the current package scope.
  Returntype  : None 
  Exceptions  : Thrown if __resolver() could not return a subroutine
  Caller      : -
  Status      : -
 
Code:
click to view
public Code Bio::EnsEMBL::Utils::Proxy::can ( )
  Args       	: Method name to test
  Example			: $obj->can('__proxy');
  Description	: Overriden to provide can() support for proxies. Will return
                true if this object implements the given method or the
                proxied object can
  Returntype 	: Code; performs same as a normal can
  Exceptions 	: None
  Caller     	: caller
  Status     	: status
 
Code:
click to view
public void Bio::EnsEMBL::Utils::Proxy::DESTROY ( )
  Example			: -
  Description	: Provided because of AutoLoad
  Returntype 	: None 
  Exceptions 	: None
  Caller     	: -
  Status     	: -
 
Code:
click to view
public Boolean Bio::EnsEMBL::Utils::Proxy::isa ( )
  Args        : Object type to test
  Example     : $obj->isa('Bio::EnsEMBL::Utils::Proxy');
  Description : Overriden to provide isa() support for proxies. Will return
                true if this object is assignable to the given type or the
                proxied object is
  Returntype  : Boolean; performs same as a normal can
  Exceptions  : None
  Caller      : caller
  Status      : status
 
Code:
click to view
public Bio::EnsEMBL::Utils::Proxy Bio::EnsEMBL::Utils::Proxy::new ( )
  Arg [1]    	: The object to proxy  
  Example			: my $newobj = Bio::EnsEMBL::Utils::Proxy->new($myobj);
  Description	: Provides a new instance of a proxy
  Returntype 	: Bio::EnsEMBL::Utils::Proxy the new instance
  Exceptions 	: None 
  Caller     	: public
  Status     	: -
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::ProxyDBConnection, and Bio::EnsEMBL::PaddedSlice.


The documentation for this class was generated from the following file: