com.softwareag.centrasite.appl.framework.persistence.mapper.impl
Class BaseObjectFactory<T extends RegistryBean>

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.persistence.mapper.impl.BaseObjectFactory<T>
All Implemented Interfaces:
ObjectFactory<T>
Direct Known Subclasses:
ClassifiedInstancesObjectFactory

public class BaseObjectFactory<T extends RegistryBean>
extends java.lang.Object
implements ObjectFactory<T>

Base implementation of the ObjectFactory interface. Uses PersistenceContext instance to work with the registry. Extending classes should override the getActualBeanClass(RegistryObject) method.


Constructor Summary
BaseObjectFactory()
           
 
Method Summary
static
<T extends RegistryBean>
BaseObjectFactory<T>
createInstance(PersistenceContext context, java.lang.Class<T> beanClass)
          Factory method for creating instances of this abstract class.
 T createRegistryBean(javax.xml.registry.infomodel.RegistryObject registryObject)
          Creates RegistryBean instance from the given RegistryObject based on configuration.
 javax.xml.registry.infomodel.RegistryObject createRegistryObject(RegistryBean registryBean)
          Creates RegistryObject instance from the given RegistryBean based on configuration.
 java.lang.Class<T> getBaseBeanClass()
          Returns the Class that this factory works on.
 PersistenceContext getContext()
          Returns the PersistenceContext used by this instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseObjectFactory

public BaseObjectFactory()
Method Detail

createInstance

public static <T extends RegistryBean> BaseObjectFactory<T> createInstance(PersistenceContext context,
                                                                           java.lang.Class<T> beanClass)
Factory method for creating instances of this abstract class. Determines the actual implementation based on annotations on the given class.

Parameters:
context - The PersistenceContext instance to be used by the object factory.
beanClass - The bean type for which object factory will be created.

createRegistryBean

public T createRegistryBean(javax.xml.registry.infomodel.RegistryObject registryObject)
                                          throws javax.xml.registry.JAXRException,
                                                 MappingException
Creates RegistryBean instance from the given RegistryObject based on configuration.

Specified by:
createRegistryBean in interface ObjectFactory<T extends RegistryBean>
Returns:
Newly created registry bean.
Throws:
javax.xml.registry.JAXRException
MappingException

createRegistryObject

public javax.xml.registry.infomodel.RegistryObject createRegistryObject(RegistryBean registryBean)
                                                                 throws MappingException,
                                                                        javax.xml.registry.JAXRException
Creates RegistryObject instance from the given RegistryBean based on configuration.

Specified by:
createRegistryObject in interface ObjectFactory<T extends RegistryBean>
Returns:
Newly created registry object.
Throws:
MappingException
javax.xml.registry.JAXRException

getContext

public PersistenceContext getContext()
Returns the PersistenceContext used by this instance.


getBaseBeanClass

public java.lang.Class<T> getBaseBeanClass()
Returns the Class that this factory works on.