net.sf.farrago.plugin
Interface FarragoPlugin

All Superinterfaces:
ClosableAllocation, FarragoAllocation
All Known Subinterfaces:
FarragoMedDataWrapper
All Known Implementing Classes:
FlatFileDataWrapper, FlatFileDataWrapper, FtrsDataWrapper, LcsDataWrapper, MedAbstractDataWrapper, MedJdbcForeignDataWrapper, MedMdrForeignDataWrapper, MedMockForeignDataWrapper, MedMockLocalDataWrapper, MedMqlForeignDataWrapper

public interface FarragoPlugin
extends FarragoAllocation

FarragoPlugin defines an abstract plugin interface. Some JDBC infrastructure is borrowed (SQLException and DriverPropertyInfo). The property info calls are designed to work in the same iterative fashion as Driver.getPropertyInfo(java.lang.String, java.util.Properties).

Implementations of FarragoPlugin must provide a public default constructor in order to be loaded via DDL statements. FarragoPlugin extends FarragoAllocation; when closeAllocation is called, all resources acquired by the plugin should be released.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/plugin/FarragoPlugin.java#11 $
Author:
John V. Sichi

Method Summary
 String getDescription(Locale locale)
          Obtains a description of this plugin.
 String getLibraryName()
          return the library name used to initialize this plugin
 DriverPropertyInfo[] getPluginPropertyInfo(Locale locale, Properties props)
          Obtains information about the properties applicable to plugin initialization (the props parameter to the initialize method).
 Properties getProperties()
          return the options with which this plugin was initialized
 String getSuggestedName()
          Obtains a suggested name for this plugin in the SQL catalog.
 void initialize(FarragoRepos repos, Properties props)
          Initializes this plugin with a given set of properties.
 void setLibraryName(String libraryName)
          set the library name used to initialize this plugin
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 

Method Detail

getSuggestedName

String getSuggestedName()
Obtains a suggested name for this plugin in the SQL catalog.

Returns:
suggested name

getDescription

String getDescription(Locale locale)
Obtains a description of this plugin.

Parameters:
locale - Locale for formatting description
Returns:
localized description

getPluginPropertyInfo

DriverPropertyInfo[] getPluginPropertyInfo(Locale locale,
                                           Properties props)
Obtains information about the properties applicable to plugin initialization (the props parameter to the initialize method).

Parameters:
locale - Locale for formatting property info
props - proposed list of property name/value pairs which will be sent to initialize()
Returns:
0 or more property info descriptors

initialize

void initialize(FarragoRepos repos,
                Properties props)
                throws SQLException
Initializes this plugin with a given set of properties. This is called after an uninitialized instance has been created via Class.forName. As much validation as possible should be performed.

Parameters:
repos - FarragoRepos which can be used for metadata access
props - plugin properties
Throws:
SQLException - if plugin initialization is unsuccessful

setLibraryName

void setLibraryName(String libraryName)
set the library name used to initialize this plugin

Parameters:
libraryName - library name

getLibraryName

String getLibraryName()
return the library name used to initialize this plugin

Returns:
library name

getProperties

Properties getProperties()
return the options with which this plugin was initialized

Returns:
plugin properties