public void receive(final byte code, final ObjectInput in) throws IOException, ClassNotFoundException { JServerRequestInfo info = new JRMPServerRequestInfoImpl(); int len = in.readShort(); for (int i = 0; i < len; i++) { info.addReplyServiceContext((JServiceContext) in.readObject()); } for (JServerRequestInterceptor si : sis) { si.receiveRequest(info); } }
public void sendException(JServerRequestInfo jri) throws IOException { if (TraceTm.jta.isDebugEnabled()) { TraceTm.jta.debug("JTAServerTransactionInterceptor.sendException"); } if (current == null) { current = Current.getCurrent(); } if (current != null) { // get the Transaction Context (null if there is no transaction) TransactionContext txCtx = current.getPropagationContext(false); if (txCtx != null) { JTATransactionServiceContext jtasc = new JTATransactionServiceContext(); jtasc.setContext(txCtx, true); jri.addReplyServiceContext(jtasc); current.setPropagationContext(null, false); } } }
public void sendOther(JServerRequestInfo jri) throws IOException { if (TraceTm.jta.isDebugEnabled()) { TraceTm.jta.debug("JTAServerTransactionInterceptor.sendOther"); } if (current == null) { current = Current.getCurrent(); } if (current != null) { // get the Transaction Context (null if there is no transaction) TransactionContext txCtx = current.getPropagationContext(false); if (txCtx != null) { JTATransactionServiceContext jtasc = new JTATransactionServiceContext(); jtasc.setContext(txCtx, true); jri.addReplyServiceContext(jtasc); current.setPropagationContext(null, false); } } // log.trace("<-- sent other"); } }
/** * send reply with context * @param jri JServerRequestInfo the jrmp server request information * @exception IOException if an exception occur with the ObjectOutput */ public void sendReply(JServerRequestInfo jri) throws IOException { if (TraceTm.jta.isDebugEnabled()) { TraceTm.jta.debug("JTAServerTransactionInterceptor.send_reply"); } if (current == null) { current = Current.getCurrent(); } if (current != null) { // get the Transaction Context (null if there is no transaction) TransactionContext txCtx = current.getPropagationContext(false); if (txCtx != null) { JTATransactionServiceContext jtasc = new JTATransactionServiceContext(); jtasc.setContext(txCtx, true); jri.addReplyServiceContext(jtasc); current.setPropagationContext(null, false); } } }
private void putHAContext(final JServerRequestInfo jri) { // Get the current HA Context info associated to the thread HACurrent current = HACurrent.getHACurrent(); HAContext haContext = new HAContext(); Stack<RequestId> requests = current.getRequests(); haContext.setRequests(requests); logger.debug("newHACtx: " + haContext); // Create the new HAContext to propagate between interceptors HAServiceContext haServiceContext = new HAServiceContext(haContext); // Finally, include the new HAContext created to be propagated through // the interceptor jri.addReplyServiceContext(haServiceContext); } }
int sz = in.readInt(); for (int i = 0; i < sz; i++) { jsr.addReplyServiceContext((JServiceContext) in.readObject());