blackboard.persist
Class DbPersisterFactory<T extends Persister>

java.lang.Object
  extended by blackboard.persist.DbPersisterFactory<T>

public final class DbPersisterFactory<T extends Persister>
extends java.lang.Object

Helper factory class for implementing the "default" objects in persisters. This requires less code to be written in the persister interface. Now, to create the "default" factory, you do this: public static final DbPersisterFactory Default = DbPersisterFactory.newInstance(persisters); Though it is not an actual class in the persister interface, the client code will interact with it in the same way all current code does.

Since:
Bb 7.2

Method Summary
 T getInstance()
           
static
<T extends Persister>
DbPersisterFactory<T>
newInstance(java.lang.Class<T> cls)
          Create a new instance of the factory for accessing the persister implementation.
static
<T extends Persister>
DbPersisterFactory<T>
newInstance(java.lang.Class<T> cls, java.lang.String key)
          Create a new instance of the factory for accessing the persister implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static final <T extends Persister> DbPersisterFactory<T> newInstance(java.lang.Class<T> cls)
Create a new instance of the factory for accessing the persister implementation. The resulting factory will use the fully qualified classname for locating the persister implementation

Type Parameters:
T - The persister type
Parameters:
cls - The class representing the persister type
Returns:
An instance of the factory

newInstance

public static final <T extends Persister> DbPersisterFactory<T> newInstance(java.lang.Class<T> cls,
                                                                            java.lang.String key)
Create a new instance of the factory for accessing the persister implementation. The resulting factory will use the key parameter to find the persister implementation the persister implementation

Type Parameters:
T - The persister type
Parameters:
cls - The class representing the persister type
key - the key to use for finding the persister implementation
Returns:
An instance of the factory

getInstance

public T getInstance()
                                throws PersistenceException
Throws:
PersistenceException


Copyright © 2012 Blackboard, Inc. All Rights Reserved.