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.kernel.deploy.hot;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    /**
020     * @author Ivica Cardic
021     * @author Brian Wing Shun Chan
022     * @author Raymond Aug??
023     */
024    public class HotDeployUtil {
025    
026            public static void fireDeployEvent(HotDeployEvent hotDeployEvent) {
027                    getHotDeploy().fireDeployEvent(hotDeployEvent);
028            }
029    
030            public static void fireUndeployEvent(HotDeployEvent hotDeployEvent) {
031                    getHotDeploy().fireUndeployEvent(hotDeployEvent);
032            }
033    
034            public static HotDeploy getHotDeploy() {
035                    PortalRuntimePermission.checkGetBeanProperty(HotDeployUtil.class);
036    
037                    return _hotDeploy;
038            }
039    
040            public static void registerListener(HotDeployListener hotDeployListener) {
041                    getHotDeploy().registerListener(hotDeployListener);
042            }
043    
044            public static void reset() {
045                    getHotDeploy().reset();
046            }
047    
048            public static void setCapturePrematureEvents(
049                    boolean capturePrematureEvents) {
050    
051                    getHotDeploy().setCapturePrematureEvents(capturePrematureEvents);
052            }
053    
054            public static void unregisterListener(HotDeployListener hotDeployListener) {
055                    getHotDeploy().unregisterListener(hotDeployListener);
056            }
057    
058            public static void unregisterListeners() {
059                    getHotDeploy().unregisterListeners();
060            }
061    
062            public void setHotDeploy(HotDeploy hotDeploy) {
063                    PortalRuntimePermission.checkSetBeanProperty(getClass());
064    
065                    _hotDeploy = hotDeploy;
066            }
067    
068            private static HotDeploy _hotDeploy;
069    
070    }