com.softwareag.centrasite.appl.framework.persistence.impl
Class BackedDynamicRegistryBeanHandler

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.persistence.impl.BackedDynamicRegistryBeanHandler
All Implemented Interfaces:
BackedBeanInfo, BeanInfo, java.lang.reflect.InvocationHandler

public class BackedDynamicRegistryBeanHandler
extends java.lang.Object
implements BackedBeanInfo, java.lang.reflect.InvocationHandler

InvocationHandler implementation for backed with RegistryObject proxies implementing the BackedBeanInfo interface.


Constructor Summary
BackedDynamicRegistryBeanHandler(PersistenceContext context, DynamicRegistryBean bean, BackedBeanMapper<DynamicRegistryBean> beanMapper)
           
 
Method Summary
 DynamicRegistryBean getBean()
          Returns the registry bean.
 Key getKey()
          Returns the objects key.
 java.util.Set<javax.xml.registry.infomodel.RegistryObject> getModifiedObjects()
          Retrieves all modified RegistryObject including the primary backed object.
 PersistenceContext getPersistenceContext()
          Returns the pool, which created this bean.
 java.util.Set<PropertyMapper> getPropertiesToMap()
          Retrieves the PropertyMapper instances that need to be invoked by the BeanMapper working on this proxy.
 javax.xml.registry.infomodel.RegistryObject getRegistryObject()
          Retrieves the backed RegistryObject
 java.lang.Object invoke(java.lang.Object pProxy, java.lang.reflect.Method pMethod, java.lang.Object[] pArgs)
          Handle the bean methods: - getters: ensure the bean is populated from the RO - setters: ensure the RO is populated from the bean - non-getter/setter: simply pass through to bean - "system" methods : simply pass through to this object
 boolean isCreated()
          Returns, whether this is object has already been created in the registry.
 boolean isDeleted()
          Returns, whether the object is marked as deleted.
 boolean isModified()
          Returns, whether the object is modified.
 void setBean(DynamicRegistryBean bean)
          Sets the registry bean.
 void setCreated(boolean created)
          Sets, whether the object is created or retrieved from the registry.
 void setDeleted(boolean deleted)
          Sets, whether the object is marked as deleted.
 void setModified(boolean modified)
          Sets, whether the object is modified.
 void setRegistryObject(javax.xml.registry.infomodel.RegistryObject ro)
          Sets the backed RegistryObject
 void toBean()
          Forces all property values to be loaded from the underlying registry object.
 void toJaxr()
          Forces all property values to be updated into the underlying registry object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackedDynamicRegistryBeanHandler

public BackedDynamicRegistryBeanHandler(PersistenceContext context,
                                        DynamicRegistryBean bean,
                                        BackedBeanMapper<DynamicRegistryBean> beanMapper)
Parameters:
context -
bean -
beanMapper -
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object pProxy,
                               java.lang.reflect.Method pMethod,
                               java.lang.Object[] pArgs)
                        throws java.lang.Throwable
Handle the bean methods: - getters: ensure the bean is populated from the RO - setters: ensure the RO is populated from the bean - non-getter/setter: simply pass through to bean - "system" methods : simply pass through to this object

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

getRegistryObject

public javax.xml.registry.infomodel.RegistryObject getRegistryObject()
Retrieves the backed RegistryObject

Specified by:
getRegistryObject in interface BackedBeanInfo
Returns:
RegistryObject

setRegistryObject

public void setRegistryObject(javax.xml.registry.infomodel.RegistryObject ro)
Description copied from interface: BackedBeanInfo
Sets the backed RegistryObject

Specified by:
setRegistryObject in interface BackedBeanInfo

toBean

public void toBean()
            throws MappingException,
                   javax.xml.registry.JAXRException
Description copied from interface: BackedBeanInfo
Forces all property values to be loaded from the underlying registry object.

Specified by:
toBean in interface BackedBeanInfo
Throws:
MappingException
javax.xml.registry.JAXRException

toJaxr

public void toJaxr()
            throws MappingException,
                   javax.xml.registry.JAXRException
Description copied from interface: BackedBeanInfo
Forces all property values to be updated into the underlying registry object.

Specified by:
toJaxr in interface BackedBeanInfo
Throws:
MappingException
javax.xml.registry.JAXRException

getModifiedObjects

public java.util.Set<javax.xml.registry.infomodel.RegistryObject> getModifiedObjects()
Retrieves all modified RegistryObject including the primary backed object.

Specified by:
getModifiedObjects in interface BackedBeanInfo
Returns:
Set

getPropertiesToMap

public java.util.Set<PropertyMapper> getPropertiesToMap()
Description copied from interface: BackedBeanInfo
Retrieves the PropertyMapper instances that need to be invoked by the BeanMapper working on this proxy. This is a workaround for handing modifications on collection properties. It is expected that the implementation for this method will return the property mappers for all collection properties that have been retrieved and possibly modified.

Specified by:
getPropertiesToMap in interface BackedBeanInfo
Returns:
Set

isModified

public boolean isModified()
Description copied from interface: BeanInfo
Returns, whether the object is modified.

Specified by:
isModified in interface BeanInfo

getBean

public DynamicRegistryBean getBean()
Description copied from interface: BeanInfo
Returns the registry bean.

Specified by:
getBean in interface BeanInfo

getKey

public Key getKey()
Description copied from interface: BeanInfo
Returns the objects key.

Specified by:
getKey in interface BeanInfo

getPersistenceContext

public PersistenceContext getPersistenceContext()
Description copied from interface: BeanInfo
Returns the pool, which created this bean.

Specified by:
getPersistenceContext in interface BeanInfo

isCreated

public boolean isCreated()
Description copied from interface: BeanInfo
Returns, whether this is object has already been created in the registry.

Specified by:
isCreated in interface BeanInfo

isDeleted

public boolean isDeleted()
Description copied from interface: BeanInfo
Returns, whether the object is marked as deleted.

Specified by:
isDeleted in interface BeanInfo

setBean

public void setBean(DynamicRegistryBean bean)
Description copied from interface: BeanInfo
Sets the registry bean. This is used by the update method.

Specified by:
setBean in interface BeanInfo

setDeleted

public void setDeleted(boolean deleted)
Description copied from interface: BeanInfo
Sets, whether the object is marked as deleted.

Specified by:
setDeleted in interface BeanInfo

setModified

public void setModified(boolean modified)
Description copied from interface: BeanInfo
Sets, whether the object is modified.

Specified by:
setModified in interface BeanInfo

setCreated

public void setCreated(boolean created)
Description copied from interface: BeanInfo
Sets, whether the object is created or retrieved from the registry.

Specified by:
setCreated in interface BeanInfo