GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RESOURCEPOOL::RESOURCE (3)

.ds Aq ’

NAME

ResourcePool::Resource - A ResourcePool wrapper class for a resource

CONTENTS

SYNOPSIS



 use ResourcePool::Resource;

 my $resource = ResourcePool::Resource->new();



DESCRIPTION

This class is a base class for the resources which will be used with ResourcePool. ResourcePool uses this class internally to have a unique interface to interact with the resource.

Each ResourcePool::Resource class gets constructed by the corresponding ResourcePool::Factory class. In fact the Factory classes are just used to store the parameters which are required to construct a resource.

Every class which is derived from ResourcePool::Resource must override the close, fail_close and get_plain_resource methods and should override at least one of precheck or postcheck.

CW$resource->close

Closes a connection gracefully.

<B>Returns:B> undef

CW$resource->fail_close

Closes a failed connection and ignores error (since this connection is known to be broken)

<B>Returns:B> undef

CW$resource->get_plain_resource

Returns the naked resource which can be used by the client. This is the DBI or Net::LDAP handle for example.

<B>Returns:B> a reference to a object

CW$resource->precheck

Checks a connection. This method is called by the get() method of the ResourcePool before it returns a connection. The default implementation always returns true.

<B>Returns:B> true if the connection is valid

CW$resource->postcheck

Checks a connection. This method is called by the free() method of the ResourcePool to check if a connection is still valid. The default implementation always returns true.

<B>Returns:B> true if the connection is valid

SEE ALSO

ResourcePool, ResourcePool::Resource::DBI, ResourcePool::Resource::Net::LDAP

AUTHOR



    Copyright (C) 2001-2009 by Markus Winand <mws@fatalmind.com>

    This program is free software; you can redistribute it and/or
    modify it under the same terms as Perl itself.



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RESOURCEPOOL::RESOURCE (3) 2009-11-25

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.