|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.RequestCycle
org.apache.wicket.protocol.http.WebRequestCycle
org.wamblee.wicket.transactions.OpenTransactionInViewRequestCycle
public class OpenTransactionInViewRequestCycle
This class provides an Open Transaction in View implementation for
wicket. It provides a custom request cycle that uses the
UserTransaction to make sure that all work is done within a single
transaction. In Hibernate context, this is referred to as open session in
view.
The method used by this class is more correctly called Open Transaction in View and has a similar effect to open session in view. It is however more general because it supports any (JTA) transactional resource. Also it is more efficient/scalable than most open session in view implementations because a database connection is only obtained from the connection pool when it is needed.
To use this request cycle, add it in your wicket Application subclass
by overriding
Application.newRequestCycle(org.apache.wicket.Request, Response). For
example:
@Override
public RequestCycle newRequestCycle(Request aRequest, Response aResponse) {
return new OpenTransactionInViewRequestCycle(this, (WebRequest) aRequest,
aResponse);
}
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.RequestCycle |
|---|
application, processor, request, response |
| Constructor Summary | |
|---|---|
OpenTransactionInViewRequestCycle(org.apache.wicket.protocol.http.WebApplication aApplication,
org.apache.wicket.protocol.http.WebRequest aRequest,
org.apache.wicket.Response aResponse)
Constructs the request cycle. |
|
| Method Summary | |
|---|---|
protected void |
onBeginRequest()
|
protected void |
onEndRequest()
|
org.apache.wicket.Page |
onRuntimeException(org.apache.wicket.Page aPage,
RuntimeException aE)
|
| Methods inherited from class org.apache.wicket.protocol.http.WebRequestCycle |
|---|
getProcessor, getWebRequest, getWebResponse, getWebSession, isRedirect, newBrowserInfoPage, newClientInfo, redirectTo |
| Methods inherited from class org.apache.wicket.RequestCycle |
|---|
detach, get, getApplication, getClientInfo, getMetaData, getOriginalResponse, getPageParameters, getRedirect, getRequest, getRequestTarget, getResponse, getResponsePage, getResponsePageClass, getSession, getStartTime, isUrlForNewWindowEncoding, logRuntimeException, onAfterTargetsDetached, onRequestTargetSet, request, request, request, set, setAutomaticallyClearFeedbackMessages, setMetaData, setRedirect, setRequest, setRequestTarget, setResponse, setResponsePage, setResponsePage, setResponsePage, setResponsePage, setUrlForNewWindowEncoding, toString, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, wasHandled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OpenTransactionInViewRequestCycle(org.apache.wicket.protocol.http.WebApplication aApplication,
org.apache.wicket.protocol.http.WebRequest aRequest,
org.apache.wicket.Response aResponse)
aApplication - Application to use.aRequest - RequestaResponse - Response.| Method Detail |
|---|
protected void onBeginRequest()
onBeginRequest in class org.apache.wicket.RequestCycleprotected void onEndRequest()
onEndRequest in class org.apache.wicket.RequestCycle
public org.apache.wicket.Page onRuntimeException(org.apache.wicket.Page aPage,
RuntimeException aE)
onRuntimeException in class org.apache.wicket.RequestCycle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||