org.nuiton.topia.framework
Class TopiaContextImpl

java.lang.Object
  extended by org.nuiton.topia.framework.TopiaContextImpl
All Implemented Interfaces:
TopiaContextImplementor, TopiaContext

public class TopiaContextImpl
extends java.lang.Object
implements TopiaContext, TopiaContextImplementor

Le TopiaContextImpl est le point d'entre pour acceder aux donnees. Il est configurer par un fichier de propriete

List des proprietes disponible

topia.persistence.properties.file
le fichier de propriété a utiliser pour configurer hibernate
topia.persistence.directories
la liste des repertoires contenant les mappings hibernates (.hbm.xml) la liste de repertoire est separer par des virgules ','
topia.persistence.classes
la liste des classes que doit géré hibernate. On peut tres bien utiliser topia.persistence.directories pour un ensemble d'entié du meme repertoire et topia.persistence.classes pour d'autres classes
TopiaContextImpl.java Created: 23 déc. 2005 16:58:50

Version:
$Revision: 1646 $ Last update: $Date: 2009-09-24 15:09:10 +0200 (jeu., 24 sept. 2009) $ by : $Author: sletellier $
Author:
poussin

Field Summary
protected  java.util.Set<TopiaContextImplementor> childContext
          Set des sous context creer avec un beginTransaction et donc sur lequel nous sommes listener
protected  boolean closed
          Indique si le contexte a ete ferme
protected  java.util.Properties config
          Propriete de configuration
protected  java.util.Map<java.lang.Class<? extends TopiaEntity>,TopiaDAO<? extends TopiaEntity>> daoCache
          cache des DAO deja chargé pour ce context
protected  TopiaFiresSupport firesSupport
           
protected  org.hibernate.Session hibernate
          La session utilisé par le TopiaContextImpl
protected  org.hibernate.cfg.Configuration hibernateConfiguration
          L'objet configuration utilisé pour la creation de la factory hibernate
protected  org.hibernate.SessionFactory hibernateFactory
          la factory permettant de recuperer la session hibernate.
protected  TopiaContextImplementor parentContext
          Le pere de ce context, les contexts initaux n'ont pas de context pere
protected  java.util.List<java.lang.Class<?>> persistenceClasses
          Liste des classes perssitance
protected  java.util.Map<java.lang.String,TopiaService> services
          key: service name; value: service instance
static java.lang.String TOPIA_PERSISTENCE_CLASSES
           
static java.lang.String TOPIA_PERSISTENCE_DIRECTORIES
           
static java.lang.String TOPIA_PERSISTENCE_PROPERTIES_FILE
           
 
Constructor Summary
  TopiaContextImpl(java.util.Properties config)
          constructeur utilisé par la factory pour creer les contexts initiaux
protected TopiaContextImpl(TopiaContextImplementor parentContext)
          Constructeur utilisé par le beginTransaction pour créer le context fils.
 
Method Summary
 void add(TopiaEntity e)
          Permet d'ajouter dans le TopiaContext une TopiaEntity créé par un autre context.
protected  void addChildContext(TopiaContextImplementor child)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addTopiaContextListener(TopiaContextListener listener)
           
 void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
           
 void addTopiaEntityListener(java.lang.Class<? extends TopiaEntity> entityClass, TopiaEntityListener listener)
           
 void addTopiaEntityListener(TopiaEntityListener listener)
           
 void addTopiaEntityVetoable(java.lang.Class<? extends TopiaEntity> entityClass, TopiaEntityVetoable vetoable)
           
 void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
           
 void addTopiaTransactionListener(TopiaTransactionListener listener)
           
 void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
           
 void backup(java.io.File file, boolean compress)
          Backup database in gzip compressed file Only work for h2 database
 TopiaContext beginTransaction()
           
protected  java.lang.String[] buildQueries(java.lang.Object... entityAndCondition)
          Build the list of queries from the given parameter entityAndCondition>/code>.
protected  void checkClosed(java.lang.String message)
           
 void clear(boolean dropDatabase)
          Only h2 supported for now
 void closeContext()
          Ferme le contexte
 void commitTransaction()
          applique les modifications apporté a ce context sur la base de données.
 void createSchema()
          Permet de créer le schema de la base de données
 int execute(java.lang.String hql, java.lang.Object... args)
          Execute HQL operation on data (Update, Delete)
 void exportXML(java.io.Writer xml, java.lang.Object... entityAndcondition)
          Permet d'exporter certaines données en XML

Note: Si le parametre entityAndCondition est vide, alors on duplique toutes les entités de la base.

protected  void finalize()
          Pour le context root on ferme tous les fils, et la factory hibernate
 java.util.List<?> find(java.lang.String hql, int startIndex, int endIndex, java.lang.Object... args)
          Permet de faire une requete HQL hibernate directement sur la base en precisant la fenetre des elements a remonter avec les parametres startIndex et endIndex.
 java.util.List find(java.lang.String hql, java.lang.Object... args)
          Permet de faire une requete HQL hibernate directement sur la base
 TopiaEntity findByTopiaId(java.lang.String topiaId)
          Permet de rechercher un entite directement par son TopiaId
 java.util.Collection<TopiaService> getAllServices()
           
 java.util.Set<TopiaContextImplementor> getChildContext()
           
 java.util.Properties getConfig()
           
<E extends TopiaEntity>
TopiaDAO<E>
getDAO(java.lang.Class<E> entityClass)
          Get DAO for specified class.
 TopiaFiresSupport getFiresSupport()
           
 org.hibernate.Session getHibernate()
           
 org.hibernate.cfg.Configuration getHibernateConfiguration()
           
 org.hibernate.SessionFactory getHibernateFactory()
           
 TopiaContextImplementor getParentContext()
           
 java.util.List<java.lang.Class<?>> getPersistenceClasses()
           
 TopiaContextImplementor getRootContext()
           
<E extends TopiaService>
E
getService(java.lang.Class<E> interfaceService)
          Take one service, this service must be valid service interface with public static final SERVICE_NAME declaration.
protected  TopiaService getService(java.lang.String name)
           
 java.util.Map<java.lang.String,TopiaService> getServices()
           
 void importXML(java.io.Reader xml)
          Permet d'importer des données en XML
 boolean isClosed()
          Indique si le contexte a ete ferme
 boolean isSchemaExist(java.lang.Class<? extends TopiaEntity> clazz)
          Detect if the table is created on storage for a given persistant class.
protected  java.util.Map<java.lang.String,TopiaService> loadServices(java.util.Properties config)
           
protected  void postInitServices(java.util.Map<java.lang.String,TopiaService> services)
           
protected  void preInitServices(java.util.Map<java.lang.String,TopiaService> services)
           
 void removeChildContext(TopiaContextImplementor child)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removeTopiaContextListener(TopiaContextListener listener)
           
 void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
           
 void removeTopiaEntityListener(java.lang.Class<? extends TopiaEntity> entityClass, TopiaEntityListener listener)
           
 void removeTopiaEntityListener(TopiaEntityListener listener)
           
 void removeTopiaEntityVetoable(java.lang.Class<? extends TopiaEntity> entityClass, TopiaEntityVetoable vetoable)
           
 void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
           
 void removeTopiaTransactionListener(TopiaTransactionListener listener)
           
 void removeTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
           
 void replicate(TopiaContext dstCtxt, java.lang.Object... entityAndCondition)
          Permet de dupliquer de ce context vers un context d'une autre base des données sans modification des entites.
protected  void replicate0(TopiaContextImpl dstContextImpl, java.lang.Object... entities)
           
<T extends TopiaEntity>
void
replicateEntities(TopiaContext dstCtxt, java.util.List<T> entities)
          Permet de dupliquer les entités du type donné vers un autre context.
<T extends TopiaEntity>
void
replicateEntity(TopiaContext dstCtxt, T entity)
          Permet de dupliquer une entité du type donné vers un autre context.
 void restore(java.io.File file)
          Read database from gzip compressed file Only work for h2 database
 void rollbackTransaction()
          annule les modifications apporté a ce context
<E extends TopiaService>
boolean
serviceEnabled(java.lang.Class<E> interfaceService)
          Return true if specific service is available
protected  boolean serviceEnabled(java.lang.String name)
           
 void showCreateSchema()
          Permet d'afficher les requetes SQL de creation de base
 void updateSchema()
          Permet de mettre à jour le schema de la base de données
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOPIA_PERSISTENCE_DIRECTORIES

public static final java.lang.String TOPIA_PERSISTENCE_DIRECTORIES
See Also:
Constant Field Values

TOPIA_PERSISTENCE_CLASSES

public static final java.lang.String TOPIA_PERSISTENCE_CLASSES
See Also:
Constant Field Values

TOPIA_PERSISTENCE_PROPERTIES_FILE

public static final java.lang.String TOPIA_PERSISTENCE_PROPERTIES_FILE
See Also:
Constant Field Values

parentContext

protected TopiaContextImplementor parentContext
Le pere de ce context, les contexts initaux n'ont pas de context pere


hibernateConfiguration

protected org.hibernate.cfg.Configuration hibernateConfiguration
L'objet configuration utilisé pour la creation de la factory hibernate


hibernateFactory

protected org.hibernate.SessionFactory hibernateFactory
la factory permettant de recuperer la session hibernate. Seul les TopiaContextImpl initiaux contiennent un hibernateFactory


hibernate

protected org.hibernate.Session hibernate
La session utilisé par le TopiaContextImpl


closed

protected boolean closed
Indique si le contexte a ete ferme


config

protected java.util.Properties config
Propriete de configuration


daoCache

protected java.util.Map<java.lang.Class<? extends TopiaEntity>,TopiaDAO<? extends TopiaEntity>> daoCache
cache des DAO deja chargé pour ce context


childContext

protected java.util.Set<TopiaContextImplementor> childContext
Set des sous context creer avec un beginTransaction et donc sur lequel nous sommes listener


services

protected java.util.Map<java.lang.String,TopiaService> services
key: service name; value: service instance


firesSupport

protected TopiaFiresSupport firesSupport

persistenceClasses

protected java.util.List<java.lang.Class<?>> persistenceClasses
Liste des classes perssitance

Constructor Detail

TopiaContextImpl

public TopiaContextImpl(java.util.Properties config)
                 throws TopiaNotFoundException
constructeur utilisé par la factory pour creer les contexts initiaux

Parameters:
config -
Throws:
TopiaNotFoundException

TopiaContextImpl

protected TopiaContextImpl(TopiaContextImplementor parentContext)
                    throws org.hibernate.HibernateException,
                           TopiaNotFoundException
Constructeur utilisé par le beginTransaction pour créer le context fils.

Parameters:
parentContext -
Throws:
org.hibernate.HibernateException
TopiaNotFoundException
Method Detail

loadServices

protected java.util.Map<java.lang.String,TopiaService> loadServices(java.util.Properties config)

preInitServices

protected void preInitServices(java.util.Map<java.lang.String,TopiaService> services)

postInitServices

protected void postInitServices(java.util.Map<java.lang.String,TopiaService> services)

getServices

public java.util.Map<java.lang.String,TopiaService> getServices()
Specified by:
getServices in interface TopiaContextImplementor

serviceEnabled

protected boolean serviceEnabled(java.lang.String name)

getService

protected TopiaService getService(java.lang.String name)

serviceEnabled

public <E extends TopiaService> boolean serviceEnabled(java.lang.Class<E> interfaceService)
Description copied from interface: TopiaContext
Return true if specific service is available

Specified by:
serviceEnabled in interface TopiaContext
Returns:

getService

public <E extends TopiaService> E getService(java.lang.Class<E> interfaceService)
                                  throws TopiaNotFoundException
Take one service, this service must be valid service interface with public static final SERVICE_NAME declaration.

Specified by:
getService in interface TopiaContext
Type Parameters:
E -
Returns:
Throws:
TopiaNotFoundException

getAllServices

public java.util.Collection<TopiaService> getAllServices()
Specified by:
getAllServices in interface TopiaContextImplementor

getChildContext

public java.util.Set<TopiaContextImplementor> getChildContext()
Specified by:
getChildContext in interface TopiaContextImplementor
Returns:
Returns the childContext.

addChildContext

protected void addChildContext(TopiaContextImplementor child)

removeChildContext

public void removeChildContext(TopiaContextImplementor child)
Specified by:
removeChildContext in interface TopiaContextImplementor

getParentContext

public TopiaContextImplementor getParentContext()
Specified by:
getParentContext in interface TopiaContextImplementor
Returns:
Returns the parentContext.

getRootContext

public TopiaContextImplementor getRootContext()
Specified by:
getRootContext in interface TopiaContextImplementor

getConfig

public java.util.Properties getConfig()
Specified by:
getConfig in interface TopiaContextImplementor
Returns:
Returns the config.

createSchema

public void createSchema()
                  throws TopiaException
Description copied from interface: TopiaContext
Permet de créer le schema de la base de données

Specified by:
createSchema in interface TopiaContext
Throws:
TopiaException - if any exception

showCreateSchema

public void showCreateSchema()
                      throws TopiaException
Description copied from interface: TopiaContext
Permet d'afficher les requetes SQL de creation de base

Specified by:
showCreateSchema in interface TopiaContext
Throws:
TopiaException - if any exception

updateSchema

public void updateSchema()
                  throws TopiaException
Description copied from interface: TopiaContext
Permet de mettre à jour le schema de la base de données

Specified by:
updateSchema in interface TopiaContext
Throws:
TopiaException - if any exception

getHibernate

public org.hibernate.Session getHibernate()
                                   throws TopiaException
Specified by:
getHibernate in interface TopiaContextImplementor
Returns:
Returns the hibernate.
Throws:
TopiaException - si aucune transaction n'est ouverte

getHibernateFactory

public org.hibernate.SessionFactory getHibernateFactory()
                                                 throws TopiaNotFoundException
Specified by:
getHibernateFactory in interface TopiaContextImplementor
Returns:
Returns the hibernateFactory.
Throws:
TopiaNotFoundException

getHibernateConfiguration

public org.hibernate.cfg.Configuration getHibernateConfiguration()
                                                          throws TopiaNotFoundException
Specified by:
getHibernateConfiguration in interface TopiaContextImplementor
Returns:
Returns the hibernate configuration
Throws:
TopiaNotFoundException

getDAO

public <E extends TopiaEntity> TopiaDAO<E> getDAO(java.lang.Class<E> entityClass)
                                       throws TopiaException
Description copied from interface: TopiaContextImplementor
Get DAO for specified class. If Specialized DAO exists then it returned otherwize TopiaDAO<entityClass> is returned

Specified by:
getDAO in interface TopiaContextImplementor
Returns:
a doa
Throws:
TopiaException

beginTransaction

public TopiaContext beginTransaction()
                              throws TopiaException
Specified by:
beginTransaction in interface TopiaContext
Throws:
TopiaException

commitTransaction

public void commitTransaction()
                       throws TopiaException
Description copied from interface: TopiaContext
applique les modifications apporté a ce context sur la base de données.

Specified by:
commitTransaction in interface TopiaContext
Throws:
TopiaException - if any exception

rollbackTransaction

public void rollbackTransaction()
                         throws TopiaException
Description copied from interface: TopiaContext
annule les modifications apporté a ce context

Specified by:
rollbackTransaction in interface TopiaContext
Throws:
TopiaException - if any exception

closeContext

public void closeContext()
                  throws TopiaException
Description copied from interface: TopiaContext
Ferme le contexte

Specified by:
closeContext in interface TopiaContext
Throws:
TopiaException - if any exception

finalize

protected void finalize()
                 throws java.lang.Throwable
Pour le context root on ferme tous les fils, et la factory hibernate

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable
See Also:
Object.finalize()

isClosed

public boolean isClosed()
Description copied from interface: TopiaContext
Indique si le contexte a ete ferme

Specified by:
isClosed in interface TopiaContext
Returns:
true si le context est ferme, false autrement

checkClosed

protected void checkClosed(java.lang.String message)
                    throws TopiaException
Throws:
TopiaException

findByTopiaId

public TopiaEntity findByTopiaId(java.lang.String topiaId)
                          throws TopiaException
Description copied from interface: TopiaContext
Permet de rechercher un entite directement par son TopiaId

Specified by:
findByTopiaId in interface TopiaContext
Parameters:
topiaId - l'id de l'entite recherche
Returns:
l'entite trouvee (ou null si non trouve)
Throws:
TopiaException - if any exception

find

public java.util.List find(java.lang.String hql,
                           java.lang.Object... args)
                    throws TopiaException
Description copied from interface: TopiaContext
Permet de faire une requete HQL hibernate directement sur la base

Specified by:
find in interface TopiaContext
Parameters:
hql - la requete a faire
args - les arguments de la requete
Returns:
La liste des resultats
Throws:
TopiaException - si une erreur survient durant la requete

find

public java.util.List<?> find(java.lang.String hql,
                              int startIndex,
                              int endIndex,
                              java.lang.Object... args)
                       throws TopiaException
Description copied from interface: TopiaContext
Permet de faire une requete HQL hibernate directement sur la base en precisant la fenetre des elements a remonter avec les parametres startIndex et endIndex.

Specified by:
find in interface TopiaContext
Parameters:
hql - la requete a faire
startIndex - la position du premier element a remonter
endIndex - la position du dernier element a remonter
args - les arguments de la requete
Returns:
La liste des resultats
Throws:
TopiaException - si une erreur survient durant la requete

execute

public int execute(java.lang.String hql,
                   java.lang.Object... args)
            throws TopiaException
Execute HQL operation on data (Update, Delete)

Specified by:
execute in interface TopiaContext
Parameters:
hql -
args -
Returns:
The number of entities updated or deleted.
Throws:
TopiaException

add

public void add(TopiaEntity e)
         throws TopiaException
Description copied from interface: TopiaContext
Permet d'ajouter dans le TopiaContext une TopiaEntity créé par un autre context.

Specified by:
add in interface TopiaContext
Parameters:
e - l'entity a ajouter
Throws:
TopiaException - if any exception

importXML

public void importXML(java.io.Reader xml)
               throws TopiaException
Description copied from interface: TopiaContext
Permet d'importer des données en XML

Specified by:
importXML in interface TopiaContext
Parameters:
xml - le flux XML
Throws:
TopiaException - si une erreur survient durant l'import

exportXML

public void exportXML(java.io.Writer xml,
                      java.lang.Object... entityAndcondition)
               throws TopiaException
Description copied from interface: TopiaContext
Permet d'exporter certaines données en XML

Note: Si le parametre entityAndCondition est vide, alors on duplique toutes les entités de la base.

Specified by:
exportXML in interface TopiaContext
Parameters:
xml - le flux XML dans lequel il faut ecrire
entityAndcondition - paramètre qui vont par deux, qui represente la classe de l'entity a exporter et la condition where que doit respecter l'objet pour etre exporter (entityClass, condition)
Throws:
TopiaException - si une erreur survient durant l'export

replicate

public void replicate(TopiaContext dstCtxt,
                      java.lang.Object... entityAndCondition)
               throws TopiaException,
                      java.lang.IllegalArgumentException
Description copied from interface: TopiaContext
Permet de dupliquer de ce context vers un context d'une autre base des données sans modification des entites.

Note: Si le parametre entityAndCondition est vide, alors on duplique toutes les entités de la base.

Note 2: Il se peut que la replication simple ne soit pas suffisante (par example si l'on veut repliquer q'une partie d'une entité), on utilisera donc la seconde méthode #replicateEntities(TopiaContext, List).

Specified by:
replicate in interface TopiaContext
Parameters:
dstCtxt - le context de la base destination
entityAndCondition - paramètre qui vont par deux, qui represente la classe de l'entity a exporter et la condition where que doit respecter l'objet pour etre exporter (entityClass, condition)
Throws:
TopiaException - si une erreur pendant la duplication
java.lang.IllegalArgumentException - si l'un des context n'est pas ouvert, ou si on essaye de dupliquer dans la même base.

replicateEntity

public <T extends TopiaEntity> void replicateEntity(TopiaContext dstCtxt,
                                                    T entity)
                     throws TopiaException,
                            java.lang.IllegalArgumentException
Description copied from interface: TopiaContext
Permet de dupliquer une entité du type donné vers un autre context.

Specified by:
replicateEntity in interface TopiaContext
Type Parameters:
T - le type des entités à répliquer
Parameters:
dstCtxt - le context de la base destination
entity - l'entité à répliquer
Throws:
TopiaException - si une erreur pendant la duplication
java.lang.IllegalArgumentException - si l'un des context n'est pas ouvert, ou si on essaye de dupliquer dans la même base.

replicateEntities

public <T extends TopiaEntity> void replicateEntities(TopiaContext dstCtxt,
                                                      java.util.List<T> entities)
                       throws TopiaException,
                              java.lang.IllegalArgumentException
Description copied from interface: TopiaContext
Permet de dupliquer les entités du type donné vers un autre context.

Specified by:
replicateEntities in interface TopiaContext
Type Parameters:
T - le type des entités à répliquer
Parameters:
dstCtxt - le context de la base destination
entities - les entités à répliquer
Throws:
TopiaException - si une erreur pendant la duplication
java.lang.IllegalArgumentException - si l'un des context n'est pas ouvert, ou si on essaye de dupliquer dans la même base.

getFiresSupport

public TopiaFiresSupport getFiresSupport()
Specified by:
getFiresSupport in interface TopiaContextImplementor

backup

public void backup(java.io.File file,
                   boolean compress)
            throws TopiaException
Backup database in gzip compressed file Only work for h2 database

Specified by:
backup in interface TopiaContext
Parameters:
file - file to write backup
compress - if true then use gzip to compress file
Throws:
TopiaException - if any exception
See Also:
TopiaContext.backup(java.io.File,boolean)

restore

public void restore(java.io.File file)
             throws TopiaException
Read database from gzip compressed file Only work for h2 database

Specified by:
restore in interface TopiaContext
Parameters:
file - le fichier ou prendre les informations, il peut-etre compressé avec gzip ou non.
Throws:
TopiaException - if any exception
See Also:
TopiaContext.restore(java.io.File)

clear

public void clear(boolean dropDatabase)
           throws TopiaException
Only h2 supported for now

Specified by:
clear in interface TopiaContext
Parameters:
dropDatabase - si vrai alors supprime aussi la base de données si la base utilise des fichiers les fichiers seront supprimé (ex: h2) ou sera fait sur la base (pastgresql)
Throws:
TopiaException - if any exception
See Also:
TopiaContext.clear(boolean)

getPersistenceClasses

public java.util.List<java.lang.Class<?>> getPersistenceClasses()
Specified by:
getPersistenceClasses in interface TopiaContextImplementor

isSchemaExist

public boolean isSchemaExist(java.lang.Class<? extends TopiaEntity> clazz)
                      throws TopiaException
Description copied from interface: TopiaContextImplementor
Detect if the table is created on storage for a given persistant class.

Specified by:
isSchemaExist in interface TopiaContextImplementor
Parameters:
clazz - the researched class
Returns:
Returns the hibernate.
Throws:
TopiaException - si aucune transaction n'est ouverte

addTopiaEntityListener

public void addTopiaEntityListener(TopiaEntityListener listener)
Specified by:
addTopiaEntityListener in interface TopiaContext

addTopiaEntityListener

public void addTopiaEntityListener(java.lang.Class<? extends TopiaEntity> entityClass,
                                   TopiaEntityListener listener)
Specified by:
addTopiaEntityListener in interface TopiaContext

addTopiaEntityVetoable

public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
Specified by:
addTopiaEntityVetoable in interface TopiaContext

addTopiaEntityVetoable

public void addTopiaEntityVetoable(java.lang.Class<? extends TopiaEntity> entityClass,
                                   TopiaEntityVetoable vetoable)
Specified by:
addTopiaEntityVetoable in interface TopiaContext

addTopiaTransactionListener

public void addTopiaTransactionListener(TopiaTransactionListener listener)
Specified by:
addTopiaTransactionListener in interface TopiaContext

addTopiaTransactionVetoable

public void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
Specified by:
addTopiaTransactionVetoable in interface TopiaContext

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface TopiaContext

addTopiaContextListener

public void addTopiaContextListener(TopiaContextListener listener)
Specified by:
addTopiaContextListener in interface TopiaContext

removeTopiaEntityListener

public void removeTopiaEntityListener(TopiaEntityListener listener)
Specified by:
removeTopiaEntityListener in interface TopiaContext

removeTopiaEntityListener

public void removeTopiaEntityListener(java.lang.Class<? extends TopiaEntity> entityClass,
                                      TopiaEntityListener listener)
Specified by:
removeTopiaEntityListener in interface TopiaContext

removeTopiaEntityVetoable

public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
Specified by:
removeTopiaEntityVetoable in interface TopiaContext

removeTopiaEntityVetoable

public void removeTopiaEntityVetoable(java.lang.Class<? extends TopiaEntity> entityClass,
                                      TopiaEntityVetoable vetoable)
Specified by:
removeTopiaEntityVetoable in interface TopiaContext

removeTopiaTransactionListener

public void removeTopiaTransactionListener(TopiaTransactionListener listener)
Specified by:
removeTopiaTransactionListener in interface TopiaContext

removeTopiaTransactionVetoable

public void removeTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
Specified by:
removeTopiaTransactionVetoable in interface TopiaContext

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface TopiaContext

removeTopiaContextListener

public void removeTopiaContextListener(TopiaContextListener listener)
Specified by:
removeTopiaContextListener in interface TopiaContext

addTopiaEntitiesVetoable

public void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
Specified by:
addTopiaEntitiesVetoable in interface TopiaContext

removeTopiaEntitiesVetoable

public void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
Specified by:
removeTopiaEntitiesVetoable in interface TopiaContext

buildQueries

protected java.lang.String[] buildQueries(java.lang.Object... entityAndCondition)
                                   throws TopiaException,
                                          java.lang.IllegalArgumentException
Build the list of queries from the given parameter entityAndCondition>/code>. If no parameter is given, then build the queries for all entities is db, with no condition.

Parameters:
entityAndCondition - the list of tuples (Class,String)
Returns:
the list of queries.
Throws:
TopiaException - if any pb of db while getting entities classes.
java.lang.IllegalArgumentException - if any pb with the given parameter (mainly ClassCastException).

replicate0

protected void replicate0(TopiaContextImpl dstContextImpl,
                          java.lang.Object... entities)
                   throws TopiaException
Throws:
TopiaException


Copyright © 2004-2009 CodeLutin. All Rights Reserved.