public abstract class AbstractTopiaApplicationContext<K extends TopiaPersistenceContext> extends Object implements TopiaApplicationContext<K>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected TopiaConfiguration |
configuration |
protected HibernateProvider |
hibernateProvider |
protected Set<TopiaPersistenceContext> |
persistenceContexts
A set of known initialized opened persistence contexts.
|
protected TopiaHibernateSessionRegistry |
sessionRegistry |
protected TopiaFiresSupport |
topiaFiresSupport |
protected TopiaIdFactory |
topiaIdFactory |
protected TopiaServiceSupport |
topiaServiceSupport |
| Constructor and Description |
|---|
AbstractTopiaApplicationContext(Map<String,String> map)
|
AbstractTopiaApplicationContext(Properties properties)
|
AbstractTopiaApplicationContext(TopiaConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Register to the context a PropertyChangeListener about some entity's
property change.
|
void |
addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
Register to the context a TopiaEntitiesVetoable about any TopiaEntity.
|
void |
addTopiaEntityListener(Class<? extends TopiaEntity> entityClass,
TopiaEntityListener listener)
Register to the context a TopiaEntityListener about the given entity
class.
|
void |
addTopiaEntityListener(TopiaEntityListener listener)
Register to the context a TopiaEntityListener about any TopiaEntity.
|
void |
addTopiaEntityVetoable(Class<? extends TopiaEntity> entityClass,
TopiaEntityVetoable vetoable)
Register to the context a TopiaEntityVetoable about the given entity
class.
|
void |
addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
Register to the context a TopiaEntityVetoable about any TopiaEntity.
|
void |
addTopiaSchemaListener(TopiaSchemaListener listener)
Register to the context a TopiaSchemaListener about any schema
modification.
|
void |
addTopiaTransactionListener(TopiaTransactionListener listener)
Register to the context a TopiaTransactionListener about the transaction.
|
void |
addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
Register to the context a TopiaTransactionVetoable about the transaction.
|
void |
close()
Method to call when the application is going for shutdown.
|
void |
createSchema() |
void |
dropSchema() |
TopiaConfiguration |
getConfiguration() |
HibernateProvider |
getHibernateProvider() |
protected abstract Set<Class<? extends TopiaEntity>> |
getImplementationClasses() |
List<Class<?>> |
getPersistenceClasses()
Get the list of entities (ToPIA or not) that Hibernate has to handle.
|
String |
getSchemaName() |
com.google.common.collect.ImmutableSet<String> |
getSchemaNames() |
Map<String,TopiaService> |
getServices() |
<T extends TopiaService> |
getServices(Class<T> interfaceService) |
TopiaHibernateSessionRegistry |
getSessionRegistry() |
protected TopiaFiresSupport |
getTopiaFiresSupport() |
protected TopiaIdFactory |
getTopiaIdFactory() |
protected void |
init() |
void |
initSchema()
Will make everything possible to ensure the schema is ready to use.
|
protected void |
initServices() |
boolean |
isClosed() |
protected boolean |
isInitSchema()
If application context should init schema.
|
boolean |
isOpened() |
boolean |
isSchemaEmpty() |
boolean |
isTableExists(Class<?> clazz) |
protected void |
registerPersistenceContext(TopiaPersistenceContext persistenceContext) |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Unregister the given PropertyChangeListener about some entity's
property change from the context
|
void |
removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
Unregister the given TopiaEntitiesVetoable about any TopiaEntity from the
context
|
void |
removeTopiaEntityListener(Class<? extends TopiaEntity> entityClass,
TopiaEntityListener listener)
Unregister the given TopiaEntityListener about the given entity class
from the context
|
void |
removeTopiaEntityListener(TopiaEntityListener listener)
Unregister the given TopiaEntityListener about any TopiaEntity from the
context
|
void |
removeTopiaEntityVetoable(Class<? extends TopiaEntity> entityClass,
TopiaEntityVetoable vetoable)
Unregister the given TopiaEntityVetoable about the given entity class
from the context
|
void |
removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
Unregister the given TopiaEntityVetoable about any TopiaEntity from the
context
|
void |
removeTopiaSchemaListener(TopiaSchemaListener listener)
Unregister the given TopiaSchemaListener about any schema modification
from the context
|
void |
removeTopiaTransactionListener(TopiaTransactionListener listener)
Unregister the given TopiaTransactionListener about the transaction from
the context
|
void |
removeTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
Unregister the given TopiaTransactionVetoable about the transaction from
the context
|
void |
showCreateSchema() |
void |
updateSchema() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContractClass, getContractClasses, getImplementationClass, getModelName, getModelVersion, newPersistenceContextprotected TopiaIdFactory topiaIdFactory
protected TopiaConfiguration configuration
protected TopiaFiresSupport topiaFiresSupport
protected TopiaServiceSupport topiaServiceSupport
protected HibernateProvider hibernateProvider
protected TopiaHibernateSessionRegistry sessionRegistry
protected boolean closed
protected Set<TopiaPersistenceContext> persistenceContexts
@Deprecated public AbstractTopiaApplicationContext(Properties properties)
properties - FIXME@Deprecated public AbstractTopiaApplicationContext(Map<String,String> map)
map - FIXMEpublic AbstractTopiaApplicationContext(TopiaConfiguration configuration)
protected void init()
protected void initServices()
protected boolean isInitSchema()
TopiaConfiguration.isInitSchema()public void initSchema()
initSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>protected abstract Set<Class<? extends TopiaEntity>> getImplementationClasses()
protected void registerPersistenceContext(TopiaPersistenceContext persistenceContext)
public HibernateProvider getHibernateProvider()
protected TopiaFiresSupport getTopiaFiresSupport()
public TopiaConfiguration getConfiguration()
getConfiguration in interface TopiaApplicationContext<K extends TopiaPersistenceContext>protected TopiaIdFactory getTopiaIdFactory()
public TopiaHibernateSessionRegistry getSessionRegistry()
public void addTopiaEntityListener(TopiaEntityListener listener)
TopiaListenableSupportlistener instance will be notified AFTER any operation on
the entity.addTopiaEntityListener in interface TopiaListenableSupportlistener - the listener instance to registerpublic void addTopiaEntityListener(Class<? extends TopiaEntity> entityClass, TopiaEntityListener listener)
TopiaListenableSupportlistener instance will be notified AFTER any
operation on the entity.addTopiaEntityListener in interface TopiaListenableSupportentityClass - the TopiaEntity's class to listenlistener - the listener instance to registerpublic void removeTopiaEntityListener(TopiaEntityListener listener)
TopiaListenableSupportremoveTopiaEntityListener in interface TopiaListenableSupportlistener - the listener instance to unregisterpublic void removeTopiaEntityListener(Class<? extends TopiaEntity> entityClass, TopiaEntityListener listener)
TopiaListenableSupportremoveTopiaEntityListener in interface TopiaListenableSupportentityClass - the listened TopiaEntity's classlistener - the listener instance to unregisterpublic void addTopiaEntityVetoable(TopiaEntityVetoable vetoable)
TopiaListenableSupportvetoable instance will be notified BEFORE any operation on
the entity.addTopiaEntityVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to registerpublic void addTopiaEntityVetoable(Class<? extends TopiaEntity> entityClass, TopiaEntityVetoable vetoable)
TopiaListenableSupportvetoable instance will be notified BEFORE any
operation on the entity.addTopiaEntityVetoable in interface TopiaListenableSupportentityClass - the TopiaEntity's class to listenvetoable - the vetoable instance to registerpublic void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable)
TopiaListenableSupportremoveTopiaEntityVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to unregisterpublic void removeTopiaEntityVetoable(Class<? extends TopiaEntity> entityClass, TopiaEntityVetoable vetoable)
TopiaListenableSupportremoveTopiaEntityVetoable in interface TopiaListenableSupportentityClass - the listened TopiaEntity's classvetoable - the vetoable instance to unregisterpublic void addTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
TopiaListenableSupportvetoable instance will be notified BEFORE any entity loadaddTopiaEntitiesVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to registerpublic void removeTopiaEntitiesVetoable(TopiaEntitiesVetoable vetoable)
TopiaListenableSupportremoveTopiaEntitiesVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to unregisterpublic void addTopiaTransactionListener(TopiaTransactionListener listener)
TopiaListenableSupportlistener instance will be notified AFTER any operation on
the transaction.addTopiaTransactionListener in interface TopiaListenableSupportlistener - the listener instance to registerpublic void removeTopiaTransactionListener(TopiaTransactionListener listener)
TopiaListenableSupportremoveTopiaTransactionListener in interface TopiaListenableSupportlistener - the listener instance to unregisterpublic void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
TopiaListenableSupportvetoable instance will be notified BEFORE any operation on
the transaction.addTopiaTransactionVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to registerpublic void removeTopiaTransactionVetoable(TopiaTransactionVetoable vetoable)
TopiaListenableSupportremoveTopiaTransactionVetoable in interface TopiaListenableSupportvetoable - the vetoable instance to unregisterpublic void addPropertyChangeListener(PropertyChangeListener listener)
TopiaListenableSupportlistener instance will be notified AFTER
any change on the entity's propertyaddPropertyChangeListener in interface TopiaListenableSupportlistener - the listener instance to registerpublic void removePropertyChangeListener(PropertyChangeListener listener)
TopiaListenableSupportremovePropertyChangeListener in interface TopiaListenableSupportlistener - the listener instance to unregisterpublic void addTopiaSchemaListener(TopiaSchemaListener listener)
TopiaListenableSupportlistener instance will be notified BEFORE and
AFTER any change on the schemaaddTopiaSchemaListener in interface TopiaListenableSupportlistener - the listener instance to registerpublic void removeTopiaSchemaListener(TopiaSchemaListener listener)
TopiaListenableSupportremoveTopiaSchemaListener in interface TopiaListenableSupportlistener - the listener instance to unregisterpublic Map<String,TopiaService> getServices()
getServices in interface TopiaServiceSupportpublic <T extends TopiaService> Map<String,T> getServices(Class<T> interfaceService)
getServices in interface TopiaServiceSupportT - type of serviceinterfaceService - FIXMETopiaServiceSupport.getServices() but returns only services that implements
given contract (or is instance of given class).public List<Class<?>> getPersistenceClasses()
TopiaApplicationContextgetPersistenceClasses in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public boolean isSchemaEmpty()
isSchemaEmpty in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public boolean isTableExists(Class<?> clazz)
isTableExists in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public String getSchemaName()
getSchemaName in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void createSchema()
createSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void showCreateSchema()
showCreateSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void updateSchema()
updateSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void dropSchema()
dropSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void close()
TopiaApplicationContextTopiaPersistenceContextclose in interface Closeableclose in interface AutoCloseableclose in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public com.google.common.collect.ImmutableSet<String> getSchemaNames()
getSchemaNames in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public boolean isClosed()
isClosed in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public boolean isOpened()
isOpened in interface TopiaApplicationContext<K extends TopiaPersistenceContext>TopiaApplicationContext.isClosed())Copyright © 2004–2020 Code Lutin. All rights reserved.