1 4 package com.nightlabs.ipanema.asyncinvoke; 5 6 import java.io.Serializable ; 7 8 21 public class AsyncInvokerInvocationBean 22 extends AsyncInvokerBaseBean 23 { 24 27 protected void doInvoke(AsyncInvokeEnvelope envelope, AsyncInvokerDelegateLocal invokerDelegate) 28 { 29 boolean success = false; 30 try { 31 Serializable result = invokerDelegate.doInvocation(envelope); 32 envelope.setResult(result); 33 success = true; 34 } catch (Throwable x) { 35 logger.error("Invocation failed!", x); 36 messageContext.setRollbackOnly(); 37 try { 38 envelope.setError(x); 39 invokerDelegate.enqueueErrorCallback(envelope); 40 } catch (Throwable x2) { 41 logger.fatal("invokerDelegate.enqueueErrorCallback(...) failed!", x2); 42 } 43 } 44 45 if (success) { 46 SuccessCallback successCallback = envelope.getSuccessCallback(); 47 if (successCallback != null) { 48 try { 49 new AsyncInvoke().enqueue(AsyncInvoke.QUEUE_SUCCESSCALLBACK, envelope); 50 } catch (Throwable x) { 51 logger.fatal("Failed to enqueue in AsyncInvoke.QUEUE_SUCCESSCALLBACK!", x); 52 messageContext.setRollbackOnly(); 53 } 54 } } } 57 } 58 | Popular Tags |