Example usage for com.liferay.portal.kernel.util SubscriptionSender flushNotifications

List of usage examples for com.liferay.portal.kernel.util SubscriptionSender flushNotifications

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util SubscriptionSender flushNotifications.

Prototype

public void flushNotifications() throws Exception 

Source Link

Usage

From source file:com.liferay.subscription.internal.messaging.SubscriptionSenderMessageListener.java

License:Open Source License

@Override
protected void doReceive(Message message) throws Exception {
    SubscriptionSender subscriptionSender = (SubscriptionSender) message.getPayload();

    StopWatch stopWatch = new StopWatch();

    stopWatch.start();//w  ww .j  a va2  s .  com

    if (_log.isInfoEnabled()) {
        _log.info("Sending notifications for {mailId=" + subscriptionSender.getMailId() + "}");
    }

    subscriptionSender.flushNotifications();

    if (_log.isInfoEnabled()) {
        _log.info(StringBundler.concat("Sending notifications for {mailId=", subscriptionSender.getMailId(),
                "} completed in ", String.valueOf(stopWatch.getTime() / Time.SECOND), " seconds"));
    }
}