|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zkplus.jpa.OpenEntityManagerInViewListener
public class OpenEntityManagerInViewListener
Listener to init and cleanup the JPA entityManager automatically
In WEB-INF/zk.xml, add following lines:
<listener>
<description>Hibernate "OpenEntityManagerInView" Listener</description>
<listener-class>org.zkoss.zkplus.jpa.OpenEntityManagerInViewListener</listener-class>
</listener>
Applicable to EJB version 3.2.ga or later
| Constructor Summary | |
|---|---|
OpenEntityManagerInViewListener()
|
|
| Method Summary | |
|---|---|
void |
cleanup(org.zkoss.zk.ui.Execution exec,
org.zkoss.zk.ui.Execution parent,
List errs)
|
protected void |
handleException(org.zkoss.zk.ui.Execution exec,
Throwable ex)
Default exception handler. |
void |
init(org.zkoss.zk.ui.Execution exec,
org.zkoss.zk.ui.Execution parent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OpenEntityManagerInViewListener()
| Method Detail |
|---|
public void cleanup(org.zkoss.zk.ui.Execution exec,
org.zkoss.zk.ui.Execution parent,
List errs)
throws Exception
cleanup in interface org.zkoss.zk.ui.util.ExecutionCleanupException
public void init(org.zkoss.zk.ui.Execution exec,
org.zkoss.zk.ui.Execution parent)
throws Exception
init in interface org.zkoss.zk.ui.util.ExecutionInitException
protected void handleException(org.zkoss.zk.ui.Execution exec,
Throwable ex)
Default exception handler. This implementation simply rollback the transaction.
Application developer might want to extends this class and override this method to do other things like compensate for any permanent changes during the conversation, and finally restart business conversation... what can be done here depends on the applications design.
exec - the execution to clean up.ex - the Throwable which is not handled during the execution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||