Example usage for com.liferay.portal.kernel.notifications UserNotificationManagerUtil deleteUserNotificationHandler

List of usage examples for com.liferay.portal.kernel.notifications UserNotificationManagerUtil deleteUserNotificationHandler

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.notifications UserNotificationManagerUtil deleteUserNotificationHandler.

Prototype

public static void deleteUserNotificationHandler(UserNotificationHandler userNotificationHandler) 

Source Link

Usage

From source file:com.liferay.notifications.hook.events.StartupAction.java

License:Open Source License

protected void initUserNotificationHandlers() {
    String[] portletIds = PortletPropsValues.USER_NOTIFICATIONS_PORTLET_IDS;

    for (String portletId : portletIds) {
        Filter filter = new Filter(portletId);

        String userNotificationHandlerClassName = PortletProps.get(PortletPropsKeys.USER_NOTIFICATIONS_HANDLER,
                filter);//from  w  w w  .j  a v  a 2s .c  o  m

        try {
            UserNotificationHandler userNotificationHandler = (UserNotificationHandler) InstanceFactory
                    .newInstance(userNotificationHandlerClassName);

            UserNotificationManagerUtil.deleteUserNotificationHandler(userNotificationHandler);

            UserNotificationManagerUtil.addUserNotificationHandler(userNotificationHandler);
        } catch (Exception e) {
            if (_log.isWarnEnabled()) {
                _log.warn("Unable to add user notification handler " + userNotificationHandlerClassName);
            }
        }
    }
}

From source file:se.vgregion.hook.ShutdownEvent.java

License:Open Source License

@Override
public void run(String[] ids) throws ActionException {
    UserNotificationManagerUtil.deleteUserNotificationHandler(StartupEvent.HANDLER);
}