Package org.grails.plugin.platform.events

Examples of org.grails.plugin.platform.events.EventMessage


    public void setPersistenceInterceptor(PersistenceContextInterceptor persistenceInterceptor) {
        this.persistenceInterceptor = persistenceInterceptor;
    }

    public Message<?> preSend(Message<?> message, MessageChannel messageChannel) {
        EventMessage event = (EventMessage)message.getHeaders().get(EventsPublisherGateway.EVENT_OBJECT_KEY);
        if (event != null && event.isGormSession()) {
            persistenceInterceptor.init();
            log.debug("intercepting");
        }

        return message;
View Full Code Here


        return message;
    }

    public void postSend(Message<?> message, MessageChannel messageChannel, boolean b) {
        EventMessage event = (EventMessage)message.getHeaders().get(EventsPublisherGateway.EVENT_OBJECT_KEY);
        if (event.isGormSession()) {
            try {
                persistenceInterceptor.flush();
                log.debug("flushed");
            } catch (RuntimeException re) {
                if (!catchFlushExceptions)
View Full Code Here

*/
public class NullReplyInterceptor implements ChannelInterceptor {


    public Message<?> preSend(Message<?> message, MessageChannel messageChannel) {
        EventMessage evt = (EventMessage)message.getHeaders().get(EventsPublisherGateway.EVENT_OBJECT_KEY);
        if (evt != null) {
            ((PollableChannel) message.getHeaders().getReplyChannel()).send(new GenericMessage<TrackableNullResult>(new TrackableNullResult()));
        }
        return message;
    }
View Full Code Here

    }


    @Override
    protected Object handleRequestMessage(Message<?> message) {
        EventMessage eventObject = (EventMessage) message.getHeaders().get(EventsPublisherGateway.EVENT_OBJECT_KEY);
        Object res = null;
        Message<?> _message = useEventMessage ?
                MessageBuilder.withPayload(eventObject).copyHeaders(message.getHeaders()).build() :
                message;
        res = super.handleRequestMessage(_message);
View Full Code Here

TOP

Related Classes of org.grails.plugin.platform.events.EventMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.