"Fossies" - the Fresh Open Source Software Archive

Member "metadot/metadot/Metadot/AccessBrokerFactory.pm" (1 Jul 2005, 2570 Bytes) of package /linux/www/old/Metadot6.4.5.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AccessBrokerFactory.pm" see the Fossies "Dox" file reference documentation.

    1 ###########################################################################
    2 # <LICENSEINFO>
    3 # Copyright (C) Daniel Guermeur - 1999-2001
    4 # Copyright (C) Metadot Corporation - 2001-2005
    5 #
    6 # This file is part of Metadot Portal Server software $Name: Release_6_4_5_4 $
    7 #
    8 # Metadot Portal Server software is free software; you can
    9 # redistribute it and/or modify it under the terms of the GNU General Public
   10 # License as published by the Free Software Foundation; either version 2 of
   11 # the License, or (at your option) any later version.
   12 #
   13 # Metadot Portal Server software is distributed in the hope that it
   14 # will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
   15 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
   16 # Public License for more details.
   17 #
   18 # You should have received a copy of the GNU General Public License along with
   19 # Metadot Portal Server; if not, write to the Free Software
   20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   21 #
   22 # For more information, please contact info@metadot.com.
   23 #</LICENSEINFO>
   24 ############################################################################
   25 package Metadot::AccessBrokerFactory;
   26 use strict;
   27 
   28 use DBAccess;
   29 use MetadotConfig;
   30 
   31 #we store in this hash the different instantiated reg types.
   32 #if we need a particular reg type, we first check to see
   33 #if it is in this hash
   34 my %broker_types;
   35 
   36 sub get_access_broker {
   37     my $class = shift;
   38 
   39     my $access_broker_type = MetadotConfig->get_access_broker_type() || 'Default';
   40 
   41     if ( $broker_types{$access_broker_type} ) {
   42 
   43         return $broker_types{$access_broker_type};
   44 
   45     } else {
   46         require "Metadot/AccessBroker/$access_broker_type.pm";
   47 
   48         my $broker = "Metadot::AccessBroker::$access_broker_type"->new();
   49         $broker_types{$access_broker_type} = $broker;
   50         return $broker;
   51     }
   52 }
   53 
   54 1;
   55 
   56 
   57 =head1 NAME
   58 
   59 RegisterFactory -
   60 
   61 =head1 SYNOPSIS
   62 
   63     use Metadot::RegisterFactory;
   64     $register = Metadot::RegisterFactory->get_register();
   65 
   66 
   67 =head1 DESCRIPTION
   68 
   69 RegisterFactory is responsible for returning an appropriate subclass of
   70 Metadot::Register.  It does that by first examining the type of register
   71 that it should return, and then checking to see if it has a previously
   72 instantiated register of that type available to return.  If it does,
   73 it returns that instantiated register.  If not, it instantiates
   74 the appropriate register type, adds it to its cache, and then returns it.
   75 
   76 Returns the appropriate register type
   77     $register = Metadot::RegisterFactory->get_register();
   78 
   79