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.servlet;
016    
017    import com.liferay.portal.kernel.servlet.HttpSessionWrapper;
018    
019    import javax.servlet.http.HttpSession;
020    
021    import org.eclipse.jetty.server.session.AbstractSession;
022    import org.eclipse.jetty.server.session.AbstractSessionManager;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     */
027    public class JettyHttpSessionWrapper
028            extends HttpSessionWrapper implements AbstractSessionManager.SessionIf {
029    
030            public JettyHttpSessionWrapper(HttpSession session) {
031                    super(session);
032    
033                    _session = session;
034            }
035    
036            @Override
037            public AbstractSession getSession() {
038                    HttpSessionWrapper sessionWrapper = (HttpSessionWrapper)_session;
039    
040                    JettySharedSessionWrapper jettySharedSessionWrapper =
041                            (JettySharedSessionWrapper)sessionWrapper.getWrappedSession();
042    
043                    return jettySharedSessionWrapper.getSession();
044            }
045    
046            private HttpSession _session;
047    
048    }