001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.events;
016    
017    import com.liferay.portal.kernel.events.ActionException;
018    
019    import javax.servlet.http.HttpServletRequest;
020    import javax.servlet.http.HttpServletResponse;
021    import javax.servlet.http.HttpSession;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Michael Young
026     */
027    public class EventsProcessorUtil {
028    
029            public static void process(String key, String[] classes)
030                    throws ActionException {
031    
032                    _instance.process(key, classes, null, null, null, null);
033            }
034    
035            public static void process(
036                            String key, String[] classes, HttpServletRequest request,
037                            HttpServletResponse response)
038                    throws ActionException {
039    
040                    _instance.process(key, classes, null, request, response, null);
041            }
042    
043            public static void process(
044                            String key, String[] classes, HttpSession session)
045                    throws ActionException {
046    
047                    _instance.process(key, classes, null, null, null, session);
048            }
049    
050            public static void process(String key, String[] classes, String[] ids)
051                    throws ActionException {
052    
053                    _instance.process(key, classes, ids, null, null, null);
054            }
055    
056            public static void registerEvent(String key, Object event) {
057                    _instance.registerEvent(key, event);
058            }
059    
060            public static void setEventsProcessor(EventsProcessor eventsProcessor) {
061                    _instance = eventsProcessor;
062            }
063    
064            public static void unregisterEvent(String key, Object event) {
065                    _instance.unregisterEvent(key, event);
066            }
067    
068            private static EventsProcessor _instance = new EventsProcessorImpl();
069    
070    }