|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bsf.smartValueObject.demo.DemoMediator
Mock Mediator for the Demo.
Nested Class Summary | |
static class |
DemoMediator.CompanyEntity
Mock class for real entity. |
private class |
DemoMediator.CompanyLocalHome
LocalHome mock for Company. |
static class |
DemoMediator.SubsidiaryEntity
Mock class for real entity. |
private class |
DemoMediator.SubsidiaryLocalHome
LocalHome mock for Subsidiary. |
Field Summary | |
private DemoMediator.CompanyLocalHome |
companyHome
|
private java.lang.String |
indexField
The index field in the VO (would be configured on runtime). |
private static org.apache.commons.logging.Log |
log
|
private java.util.Map |
storageCompany
Our storage, to avoid EJB local entities. |
private java.util.Map |
storageSubsidiary
Our storage, to avoid EJB local entities. |
private DemoMediator.SubsidiaryLocalHome |
subsidiaryHome
|
private java.util.Map |
versionCache
|
private java.lang.Class |
voClazzCompany
Class of the VO (would be configured on runtime). |
Fields inherited from interface org.bsf.smartValueObject.mediator.Mediator |
INDEXFIELD |
Constructor Summary | |
DemoMediator()
|
Method Summary | |
private void |
checkConcurrency(java.lang.Object vo)
|
private static void |
copyProperties(java.lang.Object dst,
java.lang.Object src)
Wrapper around BeanUtils.copyProperties. |
void |
deleteGraph(java.lang.Object graph)
Deletes a graph. |
private DemoMediator.CompanyEntity |
getCompanyEntityByVO(org.bsf.smartValueObject.demo.CompanyVO vo)
Gets company entity from VO. |
java.lang.Object |
getGraph(java.lang.Object prototype)
Retrieves graph based on given prototype. |
private java.lang.Object |
getPK(java.lang.Object o)
Gets primary key from object (from the field specied in indexField). |
private DemoMediator.SubsidiaryEntity |
getSubsidiaryEntitybyVO(org.bsf.smartValueObject.demo.SubsidiaryVO vo)
Gets subsidiary entitiy from VO. |
private java.lang.Long |
getVersionCache(java.lang.Object vo)
|
private DemoMediator.CompanyEntity |
newCompany(org.bsf.smartValueObject.demo.CompanyVO vo,
java.io.PrintWriter logger)
Creates new company based on VO. |
private static org.bsf.smartValueObject.demo.CompanyVO |
newCompanyVO()
Creates new CompanyVO object. |
private static org.bsf.smartValueObject.demo.CompanyVO |
newCompanyVO(DemoMediator.CompanyEntity ce)
|
private DemoMediator.SubsidiaryEntity |
newSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo)
Creates new subsidiary based on VO. |
private static org.bsf.smartValueObject.demo.SubsidiaryVO |
newSubsidiaryVO()
Creates new SubsidiaryVO object. |
private static org.bsf.smartValueObject.demo.SubsidiaryVO |
newSubsidiaryVO(DemoMediator.SubsidiaryEntity se)
Creates new SubsidiaryVO object and initializes its field with the given SubsidiaryEntity. |
private void |
removeCompany(org.bsf.smartValueObject.demo.CompanyVO vo)
Removes company based on VO. |
private void |
removeSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo)
Removes subsidiary based on VO. |
private void |
removeVersionCache(java.lang.Object vo)
|
private DemoMediator.CompanyEntity |
updateCompany(org.bsf.smartValueObject.demo.CompanyVO vo,
java.io.PrintWriter logger)
Updates (or creates) company based on VO. |
void |
updateGraph(java.lang.Object graph)
Stores graph. |
java.lang.String |
updateGraphAndReport(java.lang.Object graph)
Stores graph and return summary of changes. |
private void |
updateSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo)
Updates subsidiary based on VO. |
private void |
updateVersionCache(java.lang.Object vo)
|
private void |
verifyGraph(java.lang.Object graph)
Verifies if the graph argument is valid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static org.apache.commons.logging.Log log
private java.util.Map storageCompany
private java.util.Map storageSubsidiary
private java.lang.Class voClazzCompany
private java.lang.String indexField
private java.util.Map versionCache
private DemoMediator.CompanyLocalHome companyHome
private DemoMediator.SubsidiaryLocalHome subsidiaryHome
Constructor Detail |
public DemoMediator()
Method Detail |
public java.lang.Object getGraph(java.lang.Object prototype) throws MediatorException
getGraph
in interface Mediator
prototype
-
MediatorException
public void updateGraph(java.lang.Object graph) throws MediatorException
updateGraph
in interface Mediator
graph
-
MediatorException
public java.lang.String updateGraphAndReport(java.lang.Object graph) throws MediatorException
graph
-
MediatorException
public void deleteGraph(java.lang.Object graph) throws MediatorException
deleteGraph
in interface Mediator
graph
- the root element of the graph.
MediatorException
private DemoMediator.CompanyEntity newCompany(org.bsf.smartValueObject.demo.CompanyVO vo, java.io.PrintWriter logger) throws MediatorException
vo
-
MediatorException
private DemoMediator.CompanyEntity updateCompany(org.bsf.smartValueObject.demo.CompanyVO vo, java.io.PrintWriter logger) throws MediatorException
vo
-
MediatorException
private void removeCompany(org.bsf.smartValueObject.demo.CompanyVO vo) throws MediatorException
vo
-
MediatorException
private DemoMediator.SubsidiaryEntity newSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo) throws MediatorException
vo
-
MediatorException
private void updateSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo) throws MediatorException
vo
-
MediatorException
private void removeSubsidiary(org.bsf.smartValueObject.demo.SubsidiaryVO vo) throws MediatorException
vo
-
MediatorException
private java.lang.Object getPK(java.lang.Object o) throws MediatorException
o
-
MediatorException
private DemoMediator.CompanyEntity getCompanyEntityByVO(org.bsf.smartValueObject.demo.CompanyVO vo) throws MediatorException
vo
-
MediatorException
private DemoMediator.SubsidiaryEntity getSubsidiaryEntitybyVO(org.bsf.smartValueObject.demo.SubsidiaryVO vo) throws MediatorException
vo
-
MediatorException
private void verifyGraph(java.lang.Object graph) throws MediatorException
graph
-
MediatorException
private void updateVersionCache(java.lang.Object vo) throws MediatorException
MediatorException
private java.lang.Long getVersionCache(java.lang.Object vo) throws MediatorException
MediatorException
private void removeVersionCache(java.lang.Object vo) throws MediatorException
MediatorException
private void checkConcurrency(java.lang.Object vo) throws MediatorException
MediatorException
private static void copyProperties(java.lang.Object dst, java.lang.Object src) throws MediatorException
dst
- src
-
MediatorException
private static org.bsf.smartValueObject.demo.CompanyVO newCompanyVO()
private static org.bsf.smartValueObject.demo.SubsidiaryVO newSubsidiaryVO()
private static org.bsf.smartValueObject.demo.SubsidiaryVO newSubsidiaryVO(DemoMediator.SubsidiaryEntity se) throws MediatorException
se
-
MediatorException
private static org.bsf.smartValueObject.demo.CompanyVO newCompanyVO(DemoMediator.CompanyEntity ce) throws MediatorException
MediatorException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |