001    /**
002     * Copyright (c) 2000-2012 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.poller.comet;
016    
017    /**
018     * @author Edward Han
019     */
020    public class CometHandlerPoolUtil {
021    
022            public static void closeCometHandler(String sessionId)
023                    throws CometException {
024    
025                    _cometHandlerPool.closeCometHandler(sessionId);
026            }
027    
028            public static void closeCometHandlers() throws CometException {
029                    _cometHandlerPool.closeCometHandlers();
030            }
031    
032            public static CometHandler getCometHandler(String sessionId) {
033                    return _cometHandlerPool.getCometHandler(sessionId);
034            }
035    
036            public static void startCometHandler(
037                            CometSession cometSession, CometHandler cometHandler)
038                    throws CometException {
039    
040                    _cometHandlerPool.startCometHandler(cometSession, cometHandler);
041            }
042    
043            public CometHandlerPool getCometHandlerPool() {
044                    return _cometHandlerPool;
045            }
046    
047            public void setCometHandlerPool(CometHandlerPool cometHandlerPool) {
048                    _cometHandlerPool = cometHandlerPool;
049            }
050    
051            private static CometHandlerPool _cometHandlerPool;
052    
053    }