Example usage for com.liferay.portal.kernel.messaging MessageListenerException MessageListenerException

List of usage examples for com.liferay.portal.kernel.messaging MessageListenerException MessageListenerException

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.messaging MessageListenerException MessageListenerException.

Prototype

public MessageListenerException(Throwable cause) 

Source Link

Usage

From source file:com.liferay.events.global.mobile.util.PollQuestionAutoEnabler.java

License:Open Source License

@Override
public void receive(Message message) throws MessageListenerException {
    try {/* ww w  . j a  v  a  2s  .co  m*/
        List<EventPollQuestion> questions = EventPollQuestionLocalServiceUtil.getAutoEnabled(new Date());
        for (EventPollQuestion question : questions) {
            question.setEnabled(true);
            question.setAutoEnable(false);
            EventPollQuestionLocalServiceUtil.updateEventPollQuestion(question);
        }

    } catch (Exception e) {
        e.printStackTrace();
        throw new MessageListenerException(e);
    }
}