goodsjpi
Class GoodsFactory
java.lang.Object
goodsjpi.PersistenceFactory
goodsjpi.GoodsFactory
- public class GoodsFactory
- extends PersistenceFactory
Implementation of PersistenceFactory which creates
goods specific persistent objects.
Use lines like
persistence.dbname=goods
persistence.roottype=my.root.object.type
goodsjpi.meta=goodsjpi.PessimisticMetaobject
in the properties file
The global metaobject type may be defined with a
line of the form goodsjpi.meta=
Note that this feature should be used with care !
Constructor Summary |
protected |
GoodsFactory()
Default constructor. |
Method Summary |
java.lang.Object |
getImplementation(java.lang.Class required)
Get a persistence instance compatible with the required class
The required class may be an interface type or a concrete type.
|
java.lang.Object |
getImplementation(java.lang.Class required,
java.lang.Class[] types,
java.lang.Object[] params)
Get a persistence instance compatible with the required class
The required class may be an interface type or a concrete type.
|
java.lang.Object |
getRootImpl()
Retrieve or create the root object of the datastore
The root object type is specified by "persistence.roottype" |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GoodsFactory
protected GoodsFactory()
throws java.io.IOException
- Default constructor. Protected since the singleton is created
by the superclass
getImplementation
public final java.lang.Object getImplementation(java.lang.Class required)
- Get a persistence instance compatible with the required class
The required class may be an interface type or a concrete type.
If it is a concrete type then the returned value will either be
an instance of that type or one of its subclasses, if it is an
interface type then the returned object must implement that interface
The mapping is looked up in the persistence.properties file
- Specified by:
getImplementation
in class PersistenceFactory
- Parameters:
required
- the type of the class or interface for which a
persistent instance is required.
getImplementation
public final java.lang.Object getImplementation(java.lang.Class required,
java.lang.Class[] types,
java.lang.Object[] params)
- Get a persistence instance compatible with the required class
The required class may be an interface type or a concrete type.
If it is a concrete type then the returned value will either be
an instance of that type or one of its subclasses, if it is an
interface type then the returned object must implement that interface
The mapping is looked up in the persistence.properties file
This version of the method calls the constructor whose signature
matches the required types
- Specified by:
getImplementation
in class PersistenceFactory
- Parameters:
required
- the type of the class or interface for which a
persistent instance is required.types
- array of parameter types for the constructorparams
- the arguments to the constructor (primitive types wrapped)
getRootImpl
public java.lang.Object getRootImpl()
throws java.io.IOException
- Retrieve or create the root object of the datastore
The root object type is specified by "persistence.roottype"
- Specified by:
getRootImpl
in class PersistenceFactory
- Returns:
- the root object of the datastore
- Throws:
java.io.IOException