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