public void setEnterpriseContext(Object ctx) { getTransientPayload().put(InvocationKey.ENTERPRISE_CONTEXT, ctx); }
public Object getEnterpriseContext() { return getTransientPayload().get(InvocationKey.ENTERPRISE_CONTEXT); }
/** * get the transaction. */ public Transaction getTransaction() { Transaction tx = (Transaction) getAsIsPayload().get(InvocationKey.TRANSACTION); if( tx == null ) tx = (Transaction) getTransientPayload().get(InvocationKey.TRANSACTION); return tx; }
/** * set the transaction. */ public void setTransaction(Transaction tx) { if( tx instanceof Serializable ) getAsIsPayload().put(InvocationKey.TRANSACTION, tx); else getTransientPayload().put(InvocationKey.TRANSACTION, tx); }
/** * Choses a new target based on delegate load balance policy. * * @param familyClusterInfo cluster family information * @param invocation current invocation * @return a new target */ protected Object chooseNewTarget(FamilyClusterInfo familyClusterInfo, Invocation invocation) { Object newTarget = delegateLoadBalancePolicy.chooseTarget(familyClusterInfo, invocation); if (trace) { log.trace("New target chosen: " + newTarget); } invocation.getTransientPayload().put("TX_STICKY_TARGET", newTarget); return newTarget; } }
/** * Advanced store * Here you can pass a TYPE that indicates where to put the value. * TRANSIENT: the value is put in a map that WON'T be passed * AS_IS: no need to marshall the value when passed (use for all JDK * java types) * PAYLOAD: we need to marshall the value as its type is application specific */ public void setValue(Object key, Object value, PayloadKey type) { if(type == PayloadKey.TRANSIENT) { getTransientPayload().put(key,value); } else if(type == PayloadKey.AS_IS) { getAsIsPayload().put(key,value); } else if(type == PayloadKey.PAYLOAD) { getPayload().put(key,value); } else { throw new IllegalArgumentException("Unknown PayloadKey: " + type); } }
invocation.getTransientPayload().put("TX_STICKY_TARGET", stickyTarget);