org.postgresql.pljava.sqlj
Class Loader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.postgresql.pljava.sqlj.Loader

public class Loader
extends ClassLoader

Author:
Thomas Hallgren

Method Summary
static void clearSchemaLoaders()
          Removes all cached schema loaders, functions, and type maps.
protected  Class findClass(String name)
           
protected  URL findResource(String name)
           
protected  Enumeration findResources(String name)
           
static ClassLoader getCurrentLoader()
          Obtains the loader that is in effect for the current schema (i.e.
static ClassLoader getSchemaLoader(String schemaName)
          Obtain a loader that has been configured for the class path of the schema named schemaName.
static Map getTypeMap(String schema)
          Returns the SQL type Oid to Java Class map that contains the Java UDT mappings for the given schema.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearSchemaLoaders

public static void clearSchemaLoaders()
Removes all cached schema loaders, functions, and type maps. This method is called by the utility functions that manipulate the data that has been cached. It is not intended to be called from user code.


getCurrentLoader

public static ClassLoader getCurrentLoader()
                                    throws SQLException
Obtains the loader that is in effect for the current schema (i.e. the schema that is first in the search path).

Returns:
A loader
Throws:
SQLException

getSchemaLoader

public static ClassLoader getSchemaLoader(String schemaName)
                                   throws SQLException
Obtain a loader that has been configured for the class path of the schema named schemaName. Class paths are defined using the SQL procedure sqlj.set_classpath.

Parameters:
schemaName - The name of the schema.
Returns:
A loader.
Throws:
SQLException

getTypeMap

public static Map getTypeMap(String schema)
                      throws SQLException
Returns the SQL type Oid to Java Class map that contains the Java UDT mappings for the given schema. This method is called by the function mapping mechanisms. Application code should never call this method.

Parameters:
schema - The schema
Returns:
The Map, possibly empty but never null.
Throws:
SQLException

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException

findResource

protected URL findResource(String name)
Overrides:
findResource in class ClassLoader

findResources

protected Enumeration findResources(String name)
                             throws IOException
Overrides:
findResources in class ClassLoader
Throws:
IOException