|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanPool
This is the main interface for interaction with the Bean-JAXR Mapper. It provides CRUD interface with additional ability to query the registry. An application would use the following typical pattern
RegistryProvider registryProvider = new StandaloneRegistryProvider(); SessionContext sessionContext = SessionContext.createInstance(registryProvider); BeanPool beanPool = sessionContext.getBeanPool(); Finding finding = beanPool.create(Finding.class); finding.setComment("Brand new finding"); finding.setCorrectiveMeasure("Some corrective measure"); beanPool.update(finding);Have in mind that the
BeanPool
is not thread-safe. It should be used
by one thread only. In multithreaded enviroment a one pool for each thread.
Method Summary | ||
---|---|---|
void |
addPersistenceListener(PersistenceEventListener listener)
Method for adding a PersistenceEventListener to listen on events
for this BeanPool . |
|
|
attach(T bean)
Insert a bean in the pool. |
|
void |
clear()
Clears the pool. |
|
void |
clearJaxrCache()
Clears the underlying JAXR object cache. |
|
|
create(java.lang.Class<T> beanClass)
Creates a new bean instance of the given class. |
|
Search |
createSearch()
Create a Search instance for all registered bean types. |
|
Search |
createSearch(java.lang.Class<? extends RegistryBean> beanClass)
Create a Search instance for the given registry bean type. |
|
Search |
createSearch(java.util.List<java.lang.Class<? extends RegistryBean>> beanClasses)
Create a Search instance for the given registry bean types. |
|
|
delete(java.util.Collection<T> beans)
Deletes a Collection of beans from the registry. |
|
|
delete(T bean)
Deletes a bean from the registry. |
|
RegistryBean |
detach(RegistryBean bean)
This is a method to remove(detach) from the BeanPool . |
|
void |
flush()
Flushes all changes made to the beans to the Registry. |
|
FlushMode |
getFlushMode()
Retrieves the current FlushMode |
|
java.util.Collection<PersistenceEventListener> |
getPersistenceListeners()
Retrieves the list of currently registerred PersistenceEventListener instances for this BeanPool . |
|
|
insert(T bean)
Deprecated. use attach(RegistryBean) |
|
|
read(java.lang.Class<T> beanClass,
java.lang.String id)
Read for the registry a bean of specified type and having a given id. |
|
void |
removePersistenceListener(PersistenceEventListener listener)
Removes a priorly registerred PersistenceEventListener . |
|
|
run(Query<T> pQuery)
Called to perform a registry query. |
|
void |
setFlushMode(FlushMode flushMode)
Sets the FlushMode |
|
|
update(java.util.Collection<T> beans)
Updates a Collection of beans already managed by the
BeanPool . |
|
|
update(T bean)
Updates a bean already stored in the BeanPool . |
Method Detail |
---|
<T extends RegistryBean> T create(java.lang.Class<T> beanClass) throws JBMException
BeanPool
.
T
- type extending the RegistryBean
interface.beanClass
-
RegistryBean
JBMException
<T extends RegistryBean> T insert(T bean) throws JBMException
attach(RegistryBean)
T
- type extending the RegistryBean
interface.bean
-
RegistryBean
- the bean that is manager by
the BeanPool
.
JBMException
<T extends RegistryBean> T attach(T bean) throws JBMException
T
- type extending the RegistryBean
interface.bean
-
RegistryBean
- the bean that is manager by
the BeanPool
.
JBMException
<T extends RegistryBean> T read(java.lang.Class<T> beanClass, java.lang.String id) throws JBMException
T
- type extending the RegistryBean
interface.beanClass
-
JBMException
<T extends RegistryBean> void update(T bean) throws JBMException
BeanPool
.
T
- type extending the RegistryBean
interface.bean
-
JBMException
<T extends RegistryBean> void update(java.util.Collection<T> beans) throws JBMException
Collection
of beans already managed by the
BeanPool
.
T
- type extending the RegistryBean
interface.beans
-
JBMException
<T extends RegistryBean> void delete(T bean) throws JBMException
T
- type extending the RegistryBean
interface.bean
-
JBMException
<T extends RegistryBean> void delete(java.util.Collection<T> beans) throws JBMException
Collection
of beans from the registry.
T
- type extending the RegistryBean
interface.beans
-
JBMException
<T extends RegistryBean> java.util.List<T> run(Query<T> pQuery) throws CSAppFrameworkException
Query.run(com.softwareag.centrasite.appl.framework.persistence.QueryContext)
.
CSAppFrameworkException
void flush() throws JBMException
JBMException
void clear() throws JBMException
JBMException
FlushMode getFlushMode()
FlushMode
FlushMode
void setFlushMode(FlushMode flushMode)
FlushMode
flushMode
- RegistryBean detach(RegistryBean bean)
BeanPool
. Its
lifecycle will not be managed by the pool anymore. The bean can be
attached back to the pool at anytime by invoking the
update(RegistryBean)
method.
void addPersistenceListener(PersistenceEventListener listener)
PersistenceEventListener
to listen on events
for this BeanPool
.
listener
- void removePersistenceListener(PersistenceEventListener listener)
PersistenceEventListener
.
listener
- java.util.Collection<PersistenceEventListener> getPersistenceListeners()
PersistenceEventListener
instances for this BeanPool
.
List
Search createSearch(java.util.List<java.lang.Class<? extends RegistryBean>> beanClasses) throws CSAppFrameworkException
Search
instance for the given registry bean types.
beanClasses
-
CSAppFrameworkException
Search createSearch(java.lang.Class<? extends RegistryBean> beanClass) throws CSAppFrameworkException
Search
instance for the given registry bean type.
beanClass
-
Search
instance.
CSAppFrameworkException
Search createSearch() throws CSAppFrameworkException
Search
instance for all registered bean types.
Search
instance.
CSAppFrameworkException
void clearJaxrCache() throws CSAppFrameworkException
CSAppFrameworkException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |