PAJES 3.0.21

org.pajes.db.entity
Class Registry

java.lang.Object
  extended by org.pajes.db.entity.Registry

public class Registry
extends java.lang.Object

Singleton registry of active Manager instances.


Method Summary
static void destroy()
          Destroys the Registry.
static ConnectionPool getDefaultPool()
          Returns the default ConnectionPool.
static Manager getManager(java.lang.Class<? extends Manager> entityManagerClass)
          Returns the instance of the specified Manager class.
static Manager getManager(java.lang.String primaryTableName)
          Returns the Manager instance that manages the specified table..
static java.util.Collection<Manager> getManagers()
          Returns all the Manager instances that have been registered.
static void setDefaultPool(ConnectionPool pool)
          Sets a default ConnectionPool to allow automatic registration of Manager instances.
static void setSuperClass(java.lang.Class<? extends Manager> manager)
          Sets the allowed super class of all Managers registered.
 java.lang.String toString()
          Returns a String representation of the Registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

destroy

public static void destroy()
Destroys the Registry.


getDefaultPool

public static ConnectionPool getDefaultPool()
Returns the default ConnectionPool.

Returns:
The default pool.

getManager

public static Manager getManager(java.lang.Class<? extends Manager> entityManagerClass)
Returns the instance of the specified Manager class.

Parameters:
entityManagerClass - the Manager class.
Returns:
the requested Manager instance.
Throws:
EntityException - if an exception occurred creating the requested manager.

getManager

public static Manager getManager(java.lang.String primaryTableName)
Returns the Manager instance that manages the specified table..

Parameters:
primaryTableName - the name of the database table..
Returns:
the appropriate Manager instance.

getManagers

public static java.util.Collection<Manager> getManagers()
Returns all the Manager instances that have been registered.

Returns:
the Collection of Manager instances.

setDefaultPool

public static void setDefaultPool(ConnectionPool pool)
Sets a default ConnectionPool to allow automatic registration of Manager instances.

Parameters:
pool - The new defaultPool value

setSuperClass

public static void setSuperClass(java.lang.Class<? extends Manager> manager)
Sets the allowed super class of all Managers registered.

Parameters:
manager - The allowed super class.
Throws:
EntityException - if the specified Class is not a sub-class of Manager.

toString

public java.lang.String toString()
Returns a String representation of the Registry.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of the Registry.

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.