public abstract class AbstractTopiaApplicationContext<K extends TopiaPersistenceContext> extends Object implements TopiaApplicationContext<K>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected com.google.common.collect.ImmutableMap<String,String> |
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> configuration) |
AbstractTopiaApplicationContext(Properties properties) |
| 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() |
com.google.common.collect.ImmutableMap<String,String> |
getConfiguration() |
HibernateProvider |
getHibernateProvider() |
protected abstract Class<? extends TopiaEntity>[] |
getImplementationClasses() |
protected String |
getImplementationClassesAsString() |
List<Class<?>> |
getPersistenceClasses() |
String |
getSchemaName() |
Map<String,TopiaService> |
getServices()
The list of registered services.
|
<T extends TopiaService> |
getServices(Class<T> interfaceService)
Same as
TopiaServiceSupport.getServices() but returns only services that implements
given contract (or is instance of given class). |
TopiaHibernateSessionRegistry |
getSessionRegistry() |
protected TopiaIdFactory |
getTopiaIdFactory() |
protected TopiaListenableSupport |
getTopiaListenableSupport() |
protected void |
init() |
void |
initSchema()
Will make everything possible to ensure the schema is ready to use.
|
protected void |
initServices() |
boolean |
isClosed() |
boolean |
isInitSchema()
If application context should init schema.
|
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 TopiaFiresSupport topiaFiresSupport
protected TopiaServiceSupport topiaServiceSupport
protected HibernateProvider hibernateProvider
protected TopiaHibernateSessionRegistry sessionRegistry
protected boolean closed
protected Set<TopiaPersistenceContext> persistenceContexts
public AbstractTopiaApplicationContext(Properties properties)
protected void init()
protected void initServices()
public boolean isInitSchema()
TopiaConfigurationConstants.CONFIG_PERSISTENCE_INIT_SCHEMA
value and return true by default.isInitSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>public void initSchema()
initSchema in interface TopiaApplicationContext<K extends TopiaPersistenceContext>protected abstract Class<? extends TopiaEntity>[] getImplementationClasses()
protected String getImplementationClassesAsString()
protected void registerPersistenceContext(TopiaPersistenceContext persistenceContext)
public HibernateProvider getHibernateProvider()
protected TopiaListenableSupport getTopiaListenableSupport()
public com.google.common.collect.ImmutableMap<String,String> 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()
TopiaServiceSupportgetServices in interface TopiaServiceSupportpublic <T extends TopiaService> Map<String,T> getServices(Class<T> interfaceService)
TopiaServiceSupportTopiaServiceSupport.getServices() but returns only services that implements
given contract (or is instance of given class).getServices in interface TopiaServiceSupportpublic List<Class<?>> getPersistenceClasses()
getPersistenceClasses 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 TopiaApplicationContext<K extends TopiaPersistenceContext>public boolean isClosed()
isClosed in interface TopiaApplicationContext<K extends TopiaPersistenceContext>Copyright © 2004–2014 CodeLutin. All rights reserved.