Re: TPluginManager and TFile

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Mon, 8 Feb 2010 16:22:44 +0100


Hi,

   the issue is that at the time you define your handlers, the system (and possible user handlers) have not yet been read from the plugin directories. Either you add your plugins in an own plugin directory and specify a ~/.rootrc entry like:

Root.PluginPath: :$(ROOTSYS)/etc/plugins:~/root-plugins

or, simpler, you do:

// load all TFile handlers from the plugin directory gROOT->GetPluginManager->FindHandler("TFile", 0); // override the TFile handler for rfio
gROOT->GetPluginManager()->AddHandler("TFile", "^rfio:", "HTRFIOFile","RFIOtsm","HTRFIOFile(const char*, Option_t *, const char *, Int_t)");

idem for the TSystem.

Cheers, Fons.

On 08/02/10 13:30, Joern Wuestenfeld wrote:
> Hello,
>
> I have a problem regarding the functionality of the plugin mechanism in
> ROOT. I'm using version 5.22 and have implemented a library supporting
> the RFIO mechanism for a special system. Now in my rootlogon.C I have
> the following two lines:
>
> gROOT->GetPluginManager()->AddHandler("TFile", "^rfio:",
> "HTRFIOFile","RFIOtsm","HTRFIOFile(const char*, Option_t *, const char
> *, Int_t)");
> gROOT->GetPluginManager()->AddHandler("TSystem", "^rfio:",
> "HTRFIOSystem","RFIOtsm","HTRFIOSystem()");
>
> Once I startup ROOT, I get the following list of plugins:
>
> =====================================================================
> Base Regexp Class Plugin
> =====================================================================
> TSystem ^castor: TRFIOSystem RFIO [*]
> TSystem ^dcache: TDCacheSystem DCache [*]
> TSystem ^dcap: TDCacheSystem DCache [*]
> TSystem ^alien: TAlienSystem RAliEn [*]
> TSystem ^root: TXNetSystem Netx
> TVirtualPad * TPad Gpad
> TVirtualX x11 TGX11 GX11
> TVirtualX x11ttf TGX11TTF GX11TTF
> TVirtualX win32 TGWin32 Win32 [*]
> TVirtualX win32gdk TGWin32 Win32gdk [*]
> TVirtualX qt TGQt GQt [*]
> TGuiFactory root TRootGuiFactory Gui
> TGuiFactory qt TQtRootGuiFactory QtRoot [*]
> TFile ^rfio: HTRFIOFile RFIOtsm
> TSystem ^rfio: HTRFIOSystem RFIOtsm
> =====================================================================
> 15 plugin handlers registered
> [*] 8 plugins not available
> =====================================================================
>
> Now I try to open a file via the RFIO mecanism using TFile::Open:
>
> TFile *f = TFile::Open("rfio://server/test.root","READ")
>
> I get an error message as:
>
> Error in <TUnixSystem::DynamicPathName>: RFIO[.so | .sl | .dl | .a |
> .dll] does not exist in .:.....
>
> Now the list of plugins contains much more:
>
> =====================================================================
> Base Regexp Class Plugin
> =====================================================================
> TSystem ^castor: TRFIOSystem RFIO [*]
> TSystem ^dcache: TDCacheSystem DCache [*]
> TSystem ^dcap: TDCacheSystem DCache [*]
> TSystem ^alien: TAlienSystem RAliEn [*]
> TSystem ^root: TXNetSystem Netx
> TVirtualPad * TPad Gpad
> TVirtualX x11 TGX11 GX11
> TVirtualX x11ttf TGX11TTF GX11TTF
> TVirtualX win32 TGWin32 Win32 [*]
> TVirtualX win32gdk TGWin32 Win32gdk [*]
> TVirtualX qt TGQt GQt [*]
> TGuiFactory root TRootGuiFactory Gui
> TGuiFactory qt TQtRootGuiFactory QtRoot [*]
> TSystem ^rfio: HTRFIOSystem RFIOtsm
> TFile ^http: TWebFile Net
> TFile ^rfio: TRFIOFile RFIO [*]
> TFile ^castor: TCastorFile RCastor [*]
> TFile ^dcache: TDCacheFile DCache [*]
> TFile ^dcap: TDCacheFile DCache [*]
> TFile ^gsidcap: TDCacheFile DCache [*]
> TFile ^gfal: TGFALFile GFAL [*]
> TFile ^chirp: TChirpFile Chirp [*]
> TFile ^alien: TAlienFile RAliEn [*]
> TFile .+[.]xml$ TXMLFile XMLIO
> TFile ^mysql: TSQLFile SQL
> TFile ^oracle: TSQLFile SQL
> TFile ^root: TXNetFile Netx
> =====================================================================
> 27 plugin handlers registered
> [*] 16 plugins not available
> =====================================================================
>
> And my plugin, which was available after startup is gone / replaced by
> the standard root plugin for rfio.
> How can that happen? How can I prevent this. I did not find any option
> to the TPluginManager->AddHandler function, that would set a defined
> plugin static.
>
> Hope to get some light onto this,
>
> Jörn
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Mon Feb 08 2010 - 16:22:59 CET

This archive was generated by hypermail 2.2.0 : Mon Feb 08 2010 - 23:50:01 CET