1 22 package org.jboss.invocation.unified.marshall; 23 24 import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller; 25 import org.jboss.remoting.marshal.UnMarshaller; 26 import org.jboss.remoting.marshal.http.HTTPUnMarshaller; 27 import org.jboss.remoting.InvocationRequest; 28 import org.jboss.invocation.MarshalledInvocation; 29 import org.jboss.tm.TransactionPropagationContextUtil; 30 import org.jboss.tm.TransactionPropagationContextImporter; 31 32 import java.io.InputStream ; 33 import java.io.IOException ; 34 import java.util.Map ; 35 36 42 public class HTTPInvocationUnMarshaller extends HTTPUnMarshaller 43 { 44 public final static String DATATYPE = "invocationhttp"; 45 46 public Object read(InputStream inputStream, Map metadata) throws IOException , ClassNotFoundException 47 { 48 Object ret = super.read(inputStream, metadata); 49 50 if(ret instanceof InvocationRequest) 51 { 52 InvocationRequest remoteInv = (InvocationRequest) ret; 53 Object param = remoteInv.getParameter(); 54 55 if(param instanceof MarshalledInvocation) 56 { 57 MarshalledInvocation mi = (MarshalledInvocation) param; 58 Object txCxt = mi.getTransactionPropagationContext(); 59 if(txCxt != null) 60 { 61 TransactionPropagationContextImporter tpcImporter = TransactionPropagationContextUtil.getTPCImporter(); 62 mi.setTransaction(tpcImporter.importTransactionPropagationContext(txCxt)); 63 } 64 } 65 } 66 67 return ret; 68 } 69 70 public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException 71 { 72 HTTPInvocationUnMarshaller unmarshaller = new HTTPInvocationUnMarshaller(); 73 unmarshaller.setClassLoader(this.customClassLoader); 74 return unmarshaller; 75 } 76 } | Popular Tags |