@SafeVarargs static PhaseInterceptorChain getChain(AtomicReference<ChainHolder> lastData, SortedSet<Phase> phaseList, List<Interceptor<? extends Message>> ... providers) { ChainHolder last = lastData.get(); if (last == null || !last.matches(providers)) { PhaseInterceptorChain chain = new PhaseInterceptorChain(phaseList); List<ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>> copy = new ArrayList<ModCountCopyOnWriteArrayList< Interceptor<? extends Message>>>(providers.length); for (List<Interceptor<? extends Message>> p : providers) { copy.add(new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>(p)); chain.add(p); } last = new ChainHolder(chain, copy); lastData.set(last); } return last.chain.cloneChain(); }
private PhaseInterceptorChain getChain(SortedSet<Phase> phaseList, List<Interceptor<? extends Message>> ... providers) { ChainHolder last = lastData.get(); if (last == null || !last.matches(providers)) { PhaseInterceptorChain chain = new PhaseInterceptorChain(phaseList); List<ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>> copy = new ArrayList<ModCountCopyOnWriteArrayList< Interceptor<? extends Message>>>(providers.length); for (List<Interceptor<? extends Message>> p : providers) { copy.add(new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>(p)); chain.add(p); } last = new ChainHolder(chain, copy); lastData.set(last); } return last.chain.cloneChain(); }
@SafeVarargs static PhaseInterceptorChain getChain(AtomicReference<ChainHolder> lastData, SortedSet<Phase> phaseList, List<Interceptor<? extends Message>> ... providers) { ChainHolder last = lastData.get(); if (last == null || !last.matches(providers)) { PhaseInterceptorChain chain = new PhaseInterceptorChain(phaseList); List<ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>> copy = new ArrayList<ModCountCopyOnWriteArrayList< Interceptor<? extends Message>>>(providers.length); for (List<Interceptor<? extends Message>> p : providers) { copy.add(new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>(p)); chain.add(p); } last = new ChainHolder(chain, copy); lastData.set(last); } return last.chain.cloneChain(); }
private PhaseInterceptorChain getChain(SortedSet<Phase> phaseList, List<Interceptor<? extends Message>> ... providers) { ChainHolder last = lastData.get(); if (last == null || !last.matches(providers)) { PhaseInterceptorChain chain = new PhaseInterceptorChain(phaseList); List<ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>> copy = new ArrayList<ModCountCopyOnWriteArrayList< Interceptor<? extends Message>>>(providers.length); for (List<Interceptor<? extends Message>> p : providers) { copy.add(new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>(p)); chain.add(p); } last = new ChainHolder(chain, copy); lastData.set(last); } return last.chain.cloneChain(); }
/** * Get interceptor chain for retransmitting a message. * * @return chain (<code>null</code> if none set) */ public PhaseInterceptorChain getRetransmitChain(Message msg) { Endpoint ep = msg.getExchange().getEndpoint(); PhaseInterceptorChain pic = (PhaseInterceptorChain)ep.get(WSRM_RETRANSMIT_CHAIN); if (pic == null) { return null; } return pic.cloneChain(); } }
/** * Clones and saves the interceptor chain the first time this is called, so that it can be used for retransmission. * Calls after the first are ignored. * * @param msg */ public void initializeInterceptorChain(Message msg) { Endpoint ep = msg.getExchange().getEndpoint(); synchronized (ep) { if (ep.get(WSRM_RETRANSMIT_CHAIN) == null) { LOG.info("Setting retransmit chain from message"); PhaseInterceptorChain chain = (PhaseInterceptorChain)msg.getInterceptorChain(); chain = chain.cloneChain(); ep.put(WSRM_RETRANSMIT_CHAIN, chain); } } }
exchange.setOutMessage(partialResponse); PhaseInterceptorChain newChian = ((PhaseInterceptorChain)inMessage.getInterceptorChain()) .cloneChain(); partialResponse.setInterceptorChain(newChian); exchange.setDestination(target);
exchange.setOutMessage(partialResponse); PhaseInterceptorChain newChian = ((PhaseInterceptorChain)inMessage.getInterceptorChain()) .cloneChain(); partialResponse.setInterceptorChain(newChian); exchange.setDestination(target);