001    /**
002     * Copyright (c) 2000-2013 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.module.framework;
016    
017    import javax.servlet.ServletConfig;
018    import javax.servlet.http.HttpServlet;
019    import javax.servlet.http.HttpServletRequest;
020    import javax.servlet.http.HttpServletResponse;
021    
022    /**
023     * @author Miguel Pastor
024     * @author Raymond Aug??
025     * @see    ModuleFrameworkClassLoader
026     */
027    public class ModuleFrameworkServletAdapter extends HttpServlet {
028    
029            public HttpServlet addingService(Object serviceReference) {
030                    return (HttpServlet)_moduleFrameworkAdapterHelper.execute(
031                            "addingService", serviceReference);
032            }
033    
034            @Override
035            public void destroy() {
036                    _moduleFrameworkAdapterHelper.execute("destroy");
037            }
038    
039            @Override
040            public void init(ServletConfig servletConfig) {
041                    _moduleFrameworkAdapterHelper.exec(
042                            "init", new Class[] {ServletConfig.class}, servletConfig);
043            }
044    
045            public void modifiedService(
046                    Object serviceReference, HttpServlet httpService) {
047    
048                    _moduleFrameworkAdapterHelper.execute(
049                            "modifiedService", serviceReference, httpService);
050            }
051    
052            public void removedService(
053                    Object serviceReference, HttpServlet httpService) {
054    
055                    _moduleFrameworkAdapterHelper.execute(
056                            "removedService", serviceReference, httpService);
057            }
058    
059            @Override
060            protected void service(
061                    HttpServletRequest request, HttpServletResponse response) {
062    
063                    _moduleFrameworkAdapterHelper.exec(
064                            "service",
065                            new Class[] {HttpServletRequest.class, HttpServletResponse.class},
066                            request, response);
067            }
068    
069            private static ModuleFrameworkAdapterHelper _moduleFrameworkAdapterHelper =
070                    new ModuleFrameworkAdapterHelper(
071                            "com.liferay.osgi.bootstrap.ModuleFrameworkServlet");
072    
073    }