001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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(String key, String[] classes, String[] ids)
036                    throws ActionException {
037    
038                    _instance.process(key, classes, ids, null, null, null);
039            }
040    
041            public static void process(
042                            String key, String[] classes, HttpSession session)
043                    throws ActionException {
044    
045                    _instance.process(key, classes, null, null, null, session);
046            }
047    
048            public static void process(
049                            String key, String[] classes, HttpServletRequest request,
050                            HttpServletResponse response)
051                    throws ActionException {
052    
053                    _instance.process(key, classes, null, request, response, 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    }