egovframework.rte.itl.webservice.EgovWebServiceServlet.java Source code

Java tutorial

Introduction

Here is the source code for egovframework.rte.itl.webservice.EgovWebServiceServlet.java

Source

/*
 * Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package egovframework.rte.itl.webservice;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * ?   Servlet?     Servlet  ?
 * <p>
 * <b>NOTE:</b> ?   Servlet?    
 * Servlet class?.
 * @author   ?
 * @since 2009.06.01
 * @version 1.0
 * @see <pre>
 *  == ?(Modification Information) ==
 *   
 *   ?      ?           
 *  -------    --------    ---------------------------
 *   2009.06.01  ?            ?
 * 
 * </pre>
 */
@SuppressWarnings("serial")
public class EgovWebServiceServlet extends CXFNonSpringServlet {
    private Log LOG = LogFactory.getLog(this.getClass());

    public void loadBus(ServletConfig servletConfig) throws ServletException {
        super.loadBus(servletConfig);

        LOG.debug("EgovWebServiceServlet loadBus");

        ApplicationContext applicationContext = WebApplicationContextUtils
                .getWebApplicationContext(servletConfig.getServletContext());
        if (applicationContext == null) {
            LOG.error("applicationContext is null");
            return;
        }

        EgovWebServiceContext context = null;
        try {
            context = (EgovWebServiceContext) applicationContext.getBean("egovWebServiceContext",
                    EgovWebServiceContext.class);
        } catch (BeansException e) {
            LOG.error("Cannot get EgovWebServiceContext", e);
            return;
        }

        context.publishServer(bus);
    }
}