net.sourceforge.jdbdump.connect
Class DatabaseConnectorFactory

java.lang.Object
  extended by net.sourceforge.jdbdump.connect.DatabaseConnectorFactory

public class DatabaseConnectorFactory
extends java.lang.Object

A DatabaseConnectorFactory is an object that lists all the database types that can be backed up and creates connectors to the specific database types. Connectors are the objects that extend the DatabaseConnector class and provide methods that enable you to create backup of a specific database. This class implements two design patterns: Factory and Singleton. Factory pattern makes it easy to produce the proper databse connector. Singleton pattern checks if there is only one instance of DatabaseConnectorFactory.

Author:
tomgur

Field Summary
static DatabaseConnectorFactory singleton
          an object providing Singleton desing pattern implementation
 
Constructor Summary
DatabaseConnectorFactory()
           
 
Method Summary
 DatabaseConnector createConnector(java.lang.String name)
          Creates connector to the database on the basis of provided data and implements the Factory design pattern
static DatabaseConnectorFactory getInstance()
          Imlements Singleton desing pattern
 java.lang.String[] listPlugins()
          Lists all database plugins that are available.
 java.util.ArrayList<java.lang.String> listPlugins(java.lang.String tosubclassname)
          Lists all the classes inheriting a given class in the currently loaded packages.
 java.util.ArrayList<java.lang.String> listPlugins(java.lang.String pckgname, java.lang.Class tosubclass)
          Lists all the classes inheriting a given class in a given package.
 java.util.ArrayList<java.lang.String> listPlugins(java.lang.String pckname, java.lang.String tosubclassname)
          Listss all the classes inheriting a given class in a given package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

public static DatabaseConnectorFactory singleton
an object providing Singleton desing pattern implementation

Constructor Detail

DatabaseConnectorFactory

public DatabaseConnectorFactory()
Method Detail

getInstance

public static DatabaseConnectorFactory getInstance()
Imlements Singleton desing pattern


listPlugins

public java.lang.String[] listPlugins()
Lists all database plugins that are available.

Returns:
a list of available classes extending DatabaseConnector

listPlugins

public java.util.ArrayList<java.lang.String> listPlugins(java.lang.String tosubclassname)
Lists all the classes inheriting a given class in the currently loaded packages.

Parameters:
tosubclassname - the name of the class to inherit from
Throws:
java.lang.ClassNotFoundException

listPlugins

public java.util.ArrayList<java.lang.String> listPlugins(java.lang.String pckname,
                                                         java.lang.String tosubclassname)
Listss all the classes inheriting a given class in a given package.

Parameters:
pckgname - the fully qualified name of the package
tosubclass - the name of the class to inherit from
Throws:
java.lang.ClassNotFoundException

listPlugins

public java.util.ArrayList<java.lang.String> listPlugins(java.lang.String pckgname,
                                                         java.lang.Class tosubclass)
Lists all the classes inheriting a given class in a given package.

Parameters:
pckgname - the fully qualified name of the package
tosubclass - the Class object to inherit from
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException

createConnector

public DatabaseConnector createConnector(java.lang.String name)
Creates connector to the database on the basis of provided data and implements the Factory design pattern

Parameters:
name - - name of the database plugin
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException


Copyright © 2005-2006 AGH International University of Science and Technology. All Rights Reserved.