[jboss-cvs] jboss-seam/src/remoting/org/jboss/seam/remoting ...
Gavin King
gavin.king at jboss.com
Wed Jun 13 12:43:04 EDT 2007
User: gavin
Date: 07/06/13 12:43:04
Modified: src/remoting/org/jboss/seam/remoting ExecutionHandler.java
Log:
good start on JBSEAM-116 (finally)
Revision Changes Path
1.4 +16 -6 jboss-seam/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ExecutionHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ExecutionHandler.java 10 Jun 2007 19:26:00 -0000 1.3
+++ ExecutionHandler.java 13 Jun 2007 16:43:04 -0000 1.4
@@ -15,6 +15,7 @@
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.ConversationPropagation;
import org.jboss.seam.core.Manager;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -64,7 +65,7 @@
// Parse the incoming request as XML
SAXReader xmlReader = new SAXReader();
- Document doc = xmlReader.read(request.getInputStream());
+ Document doc = xmlReader.read( request.getInputStream() );
Element env = doc.getRootElement();
RequestContext ctx = unmarshalContext(env);
@@ -73,15 +74,17 @@
Lifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
Lifecycle.setServletRequest(request);
Lifecycle.beginRequest(servletContext, request);
+ ConversationPropagation.instance().setConversationId( ctx.getConversationId() );
- Manager.instance().restoreConversation( ctx.getConversationId() );
+ Manager.instance().restoreConversation();
Lifecycle.resumeConversation(request);
// Extract the calls from the request
List<Call> calls = unmarshalCalls(env);
// Execute each of the calls
- for (Call call : calls) {
+ for (Call call : calls)
+ {
call.execute();
}
@@ -126,9 +129,11 @@
Element convId = context.element("conversationId");
if (convId != null)
+ {
ctx.setConversationId(convId.getText());
}
}
+ }
return ctx;
}
@@ -142,7 +147,8 @@
private List<Call> unmarshalCalls(Element env)
throws Exception
{
- try {
+ try
+ {
List<Call> calls = new ArrayList<Call>();
List<Element> callElements = env.element("body").elements("call");
@@ -163,13 +169,16 @@
// Now unmarshal the ref values
for (Wrapper w : call.getContext().getInRefs().values())
+ {
w.unmarshal();
+ }
Element paramsNode = e.element("params");
// Then process the param values
iter = paramsNode.elementIterator("param");
- while (iter.hasNext()) {
+ while (iter.hasNext())
+ {
Element param = (Element) iter.next();
call.addParameter(call.getContext().createWrapperFromElement(
@@ -181,7 +190,8 @@
return calls;
}
- catch (Exception ex) {
+ catch (Exception ex)
+ {
log.error("Error unmarshalling calls from request", ex);
throw ex;
}
More information about the jboss-cvs-commits
mailing list