org.nuiton.topia.framework
Interface TopiaContextImplementor

All Superinterfaces:
TopiaContext
All Known Implementing Classes:
TopiaContextImpl

public interface TopiaContextImplementor
extends TopiaContext

Technical contract of a TopiaContext. Any implementation of the TopiaContext should also implements this contract.

Version:
$Id: TopiaContextImplementor.java 2222 2011-03-11 17:29:42Z echatellier $
Author:
poussin

Method Summary
 Collection<TopiaService> getAllServices()
          Deprecated. since 2.3.4 : useless method, use getServices() instead
 Set<TopiaContextImplementor> getChildContext()
          Retrieve a thread-safe copy of children context set.
 Properties getConfig()
           
<E extends TopiaEntity>
TopiaDAO<E>
getDAO(Class<E> entityClass)
          Get DAO for specified class.
<E extends TopiaEntity,D extends TopiaDAO<E>>
D
getDAO(Class<E> entityClass, Class<D> daoClass)
          Get DAO for specified class.
 TopiaFiresSupport getFiresSupport()
           
 org.hibernate.Session getHibernate()
           
 org.hibernate.cfg.Configuration getHibernateConfiguration()
           
 org.hibernate.SessionFactory getHibernateFactory()
           
 TopiaContextImplementor getParentContext()
           
 List<Class<?>> getPersistenceClasses()
           
 TopiaContextImplementor getRootContext()
           
 Map<String,TopiaService> getServices()
           
 boolean isSchemaExist(Class<?> clazz)
          Detect if the table is created on storage for a given persistant class.
 void removeChildContext(TopiaContextImplementor child)
           
 void setUseFlushMode(boolean useFlushMode)
          Tells to the context if it has to use a flush mode before each query.
 
Methods inherited from interface org.nuiton.topia.TopiaContext
add, addPropertyChangeListener, addTopiaContextListener, addTopiaEntitiesVetoable, addTopiaEntityListener, addTopiaEntityListener, addTopiaEntityVetoable, addTopiaEntityVetoable, addTopiaTransactionListener, addTopiaTransactionVetoable, backup, beginTransaction, clear, closeContext, commitTransaction, createQuery, createSchema, execute, executeSQL, exportXML, find, find, findByQuery, findByTopiaId, getService, importXML, isClosed, removePropertyChangeListener, removeTopiaContextListener, removeTopiaEntitiesVetoable, removeTopiaEntityListener, removeTopiaEntityListener, removeTopiaEntityVetoable, removeTopiaEntityVetoable, removeTopiaTransactionListener, removeTopiaTransactionVetoable, replicate, replicateEntities, replicateEntity, restore, rollbackTransaction, serviceEnabled, showCreateSchema, updateSchema
 

Method Detail

getChildContext

Set<TopiaContextImplementor> getChildContext()
Retrieve a thread-safe copy of children context set.

Returns:
Returns the childContext.

getParentContext

TopiaContextImplementor getParentContext()
Returns:
Returns the parentContext.

getRootContext

TopiaContextImplementor getRootContext()

getConfig

Properties getConfig()
Returns:
Returns the config.

getHibernate

org.hibernate.Session getHibernate()
                                   throws TopiaException
Returns:
Returns the hibernate.
Throws:
TopiaException - si aucune transaction n'est ouverte

getHibernateFactory

org.hibernate.SessionFactory getHibernateFactory()
                                                 throws TopiaNotFoundException
Returns:
Returns the hibernateFactory.
Throws:
TopiaNotFoundException

getHibernateConfiguration

org.hibernate.cfg.Configuration getHibernateConfiguration()
                                                          throws TopiaNotFoundException
Returns:
Returns the hibernate configuration
Throws:
TopiaNotFoundException

setUseFlushMode

void setUseFlushMode(boolean useFlushMode)
Tells to the context if it has to use a flush mode before each query. By default, we use a flush mode, but in some case it costs to much doing this, that's why you can desactivate it setting the value to false.

Parameters:
useFlushMode - the new value to set
Since:
2.5

isSchemaExist

boolean isSchemaExist(Class<?> clazz)
                      throws TopiaException
Detect if the table is created on storage for a given persistant class.

Parameters:
clazz - the researched class
Returns:
Returns the hibernate.
Throws:
TopiaException - si aucune transaction n'est ouverte

getDAO

<E extends TopiaEntity> TopiaDAO<E> getDAO(Class<E> entityClass)
                                       throws TopiaException
Get DAO for specified class. If Specialized DAO exists then it returned otherwize TopiaDAO<entityClass> is returned

Type Parameters:
E - type of entity
Parameters:
entityClass - type of entity
Returns:
the required dao
Throws:
TopiaException - if any error

getDAO

<E extends TopiaEntity,D extends TopiaDAO<E>> D getDAO(Class<E> entityClass,
                                                       Class<D> daoClass)
                             throws TopiaException
Get DAO for specified class. If Specialized DAO exists then it returned otherwize TopiaDAO<entityClass> is returned

Type Parameters:
E - type of entity
Parameters:
entityClass - type of entity
daoClass - the concrete dao class to use
Returns:
the required dao
Throws:
TopiaException - if any error

getFiresSupport

TopiaFiresSupport getFiresSupport()

removeChildContext

void removeChildContext(TopiaContextImplementor child)

getServices

Map<String,TopiaService> getServices()

getAllServices

@Deprecated
Collection<TopiaService> getAllServices()
Deprecated. since 2.3.4 : useless method, use getServices() instead

Returns:
a collection of TopiaService

getPersistenceClasses

List<Class<?>> getPersistenceClasses()


Copyright © 2004-2011 CodeLutin. All Rights Reserved.