ensembl-hive  2.7.0
Bio::EnsEMBL::Utils::Proxy Class Reference
+ Inheritance diagram for Bio::EnsEMBL::Utils::Proxy:

Public Member Functions

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

Detailed Description

Synopsis

#Simple arounds logging proxy
package myproxy;
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 __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.

Member Function Documentation

◆ __proxy()

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

◆ __resolver()

protected Bio::EnsEMBL::Utils::Proxy::__resolver ( )

Undocumented method

Code:
click to view

◆ AUTOLOAD()

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

◆ can()

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

◆ DESTROY()

public void Bio::EnsEMBL::Utils::Proxy::DESTROY ( )
  Example           :
-
  Description : Provided because of AutoLoad
  Returntype    : None 
  Exceptions    : None
  Caller        : -
  Status        : -
 
Code:
click to view

◆ isa()

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

◆ new()

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

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Utils::Proxy::can
public Code can()
Bio::EnsEMBL::Utils::Proxy
Definition: Proxy.pm:38
Bio::EnsEMBL::Utils::Proxy::__resolver
protected __resolver()
Bio::EnsEMBL::Utils::Proxy::isa
public Boolean isa()
Bio::EnsEMBL::Utils::Proxy::__proxy
protected Any __proxy()
Bio::EnsEMBL::Utils::Proxy::DESTROY
public void DESTROY()
Bio::EnsEMBL::Utils::Proxy::AUTOLOAD
public void AUTOLOAD()
Bio::EnsEMBL::Utils::Proxy::new
public Bio::EnsEMBL::Utils::Proxy new()