Search in sources :

Example 1 with EventProducerInterceptor

use of org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor in project tesb-rt-se by Talend.

the class EventFeatureImpl method setQueue.

/**
 * Sets the queue.
 *
 * @param queue the new queue
 */
@Inject
public void setQueue(EventQueue queue) {
    if (epi == null) {
        MessageToEventMapper mapper = new MessageToEventMapper();
        mapper.setMaxContentLength(maxContentLength);
        epi = new EventProducerInterceptor(mapper, queue);
    }
}
Also used : MessageToEventMapper(org.talend.esb.sam.agent.eventproducer.MessageToEventMapper) EventProducerInterceptor(org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor) Inject(javax.inject.Inject)

Example 2 with EventProducerInterceptor

use of org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor in project tesb-rt-se by Talend.

the class FlowIdProducerOut method handleINEvent.

/**
 * Calling EventProducerInterceptor in case of logging faults.
 *
 * @param exchange
 *            the message exchange
 * @param reqFid
 *            the FlowId
 *
 * @throws Fault
 *             the fault
 */
protected void handleINEvent(Exchange exchange, String reqFid) throws Fault {
    Message inMsg = exchange.getInMessage();
    EventProducerInterceptor epi = null;
    FlowIdHelper.setFlowId(inMsg, reqFid);
    ListIterator<Interceptor<? extends Message>> interceptors = inMsg.getInterceptorChain().getIterator();
    while (interceptors.hasNext() && epi == null) {
        Interceptor<? extends Message> interceptor = interceptors.next();
        if (interceptor instanceof EventProducerInterceptor) {
            epi = (EventProducerInterceptor) interceptor;
            epi.handleMessage(inMsg);
        }
    }
}
Also used : Message(org.apache.cxf.message.Message) EventProducerInterceptor(org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor) Interceptor(org.apache.cxf.interceptor.Interceptor) EventProducerInterceptor(org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor) AbstractPhaseInterceptor(org.apache.cxf.phase.AbstractPhaseInterceptor)

Aggregations

EventProducerInterceptor (org.talend.esb.sam.agent.eventproducer.EventProducerInterceptor)2 Inject (javax.inject.Inject)1 Interceptor (org.apache.cxf.interceptor.Interceptor)1 Message (org.apache.cxf.message.Message)1 AbstractPhaseInterceptor (org.apache.cxf.phase.AbstractPhaseInterceptor)1 MessageToEventMapper (org.talend.esb.sam.agent.eventproducer.MessageToEventMapper)1