net.sf.gilead.core.store.stateful
Class AbstractStatefulProxyStore

java.lang.Object
  extended by net.sf.gilead.core.store.stateful.AbstractStatefulProxyStore
All Implemented Interfaces:
IProxyStore
Direct Known Subclasses:
HttpSessionProxyStore, InMemoryProxyStore

public abstract class AbstractStatefulProxyStore
extends java.lang.Object
implements IProxyStore

Abstract class for stateful proxy store.

Author:
bruno.marchesson

Field Summary
protected  IPersistenceUtil _persistenceUtil
          The associated persistence util
 
Constructor Summary
AbstractStatefulProxyStore()
           
 
Method Summary
 void cleanUp()
          Clean up the proxy store after a complete serialization process
protected  java.lang.String computeKey(java.lang.Object pojo, java.io.Serializable id, java.lang.String property)
          Compute the hashmap key
protected  java.lang.String computeKey(java.lang.Object pojo, java.lang.String property)
          Compute the hashmap key
protected abstract  void delete(java.lang.String key)
          Delete the key from the underlying storage
protected abstract  java.util.Map<java.lang.String,java.io.Serializable> get(java.lang.String key)
          Get the proxy informations associated with the key
 IPersistenceUtil getPersistenceUtil()
           
 java.util.Map<java.lang.String,java.io.Serializable> getProxyInformations(java.lang.Object pojo, java.lang.String property)
          Get the proxy informations for the argument pojo and properties
 void removeProxyInformations(java.lang.Object pojo, java.lang.String property)
          Remove the proxy informations from the property of the argument object.
 void setPersistenceUtil(IPersistenceUtil persistenceUtil)
           
protected abstract  void store(java.lang.String key, java.util.Map<java.lang.String,java.io.Serializable> proxyInformation)
          Store the value in the map.
 void storeProxyInformations(java.lang.Object cloneBean, java.lang.Object persistentBean, java.lang.String property, java.util.Map<java.lang.String,java.io.Serializable> proxyInformations)
          Store the argument proxy informations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_persistenceUtil

protected IPersistenceUtil _persistenceUtil
The associated persistence util

Constructor Detail

AbstractStatefulProxyStore

public AbstractStatefulProxyStore()
Method Detail

getPersistenceUtil

public IPersistenceUtil getPersistenceUtil()
Returns:
the persistence Util implementation

setPersistenceUtil

public void setPersistenceUtil(IPersistenceUtil persistenceUtil)
Parameters:
persistenceUtil - the persistence Util to set

storeProxyInformations

public void storeProxyInformations(java.lang.Object cloneBean,
                                   java.lang.Object persistentBean,
                                   java.lang.String property,
                                   java.util.Map<java.lang.String,java.io.Serializable> proxyInformations)
Description copied from interface: IProxyStore
Store the argument proxy informations.

Specified by:
storeProxyInformations in interface IProxyStore
Parameters:
cloneBean - the cloned, target bean
persistentBean - the persistent, source bean
property - the proxy property name
proxyInformations - the associated proxy informations

getProxyInformations

public java.util.Map<java.lang.String,java.io.Serializable> getProxyInformations(java.lang.Object pojo,
                                                                                 java.lang.String property)
Description copied from interface: IProxyStore
Get the proxy informations for the argument pojo and properties

Specified by:
getProxyInformations in interface IProxyStore
Parameters:
pojo - the root pojo
property - the proxy property name
Returns:
the proxy informations if they exists, null otherwise

removeProxyInformations

public void removeProxyInformations(java.lang.Object pojo,
                                    java.lang.String property)
Description copied from interface: IProxyStore
Remove the proxy informations from the property of the argument object.

Specified by:
removeProxyInformations in interface IProxyStore
property - the proxy property name

cleanUp

public void cleanUp()
Clean up the proxy store after a complete serialization process

Specified by:
cleanUp in interface IProxyStore

store

protected abstract void store(java.lang.String key,
                              java.util.Map<java.lang.String,java.io.Serializable> proxyInformation)
Store the value in the map.


get

protected abstract java.util.Map<java.lang.String,java.io.Serializable> get(java.lang.String key)
Get the proxy informations associated with the key

Returns:
the value if found, null otherwise

delete

protected abstract void delete(java.lang.String key)
Delete the key from the underlying storage

Parameters:
key -

computeKey

protected java.lang.String computeKey(java.lang.Object pojo,
                                      java.io.Serializable id,
                                      java.lang.String property)
Compute the hashmap key

Parameters:
pojo -
property -
Returns:

computeKey

protected java.lang.String computeKey(java.lang.Object pojo,
                                      java.lang.String property)
Compute the hashmap key

Parameters:
pojo -
property -
Returns: