All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.efaps.maven_efaps_jetty.configuration.ServletDefinition Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2003 - 2009 The eFaps Team
 *
 * 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.
 *
 * Revision:        $Rev: 3255 $
 * Last Changed:    $Date: 2009-11-02 18:27:58 -0500 (Mon, 02 Nov 2009) $
 * Last Changed By: $Author: tim.moxter $
 */

package org.efaps.maven_efaps_jetty.configuration;

import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

/**
 * @author The eFaps Team
 * @version $Id: ServletDefinition.java 3255 2009-11-02 23:27:58Z tim.moxter $
 * @todo description
 */
public class ServletDefinition
    extends AbstractDefinition
{
    /**
     * Initialize order of the servlet.
     */
    private Integer initOrder;

    /**
     * Display name of the servlet.
     */
    private String displayName;

    /**
     *
     * @param _handler servlet context handler
     */
    public void updateServer(final ServletContextHandler _handler)
    {
        final ServletHolder servlet = new ServletHolder();
        servlet.setName(getName());
        servlet.setDisplayName(this.displayName);
        servlet.setClassName(getClassName());
        servlet.setInitParameters(getIniParams());
        if (this.initOrder != null)  {
            servlet.setInitOrder(this.initOrder);
        }
        _handler.addServlet(servlet, getPathSpec());
    }

    /**
     * Setter method for instance variable {@link #initOrder}.
     *
     * @param _initOrder    new initt order to set
     * @see #initOrder
     */
    public void setInitOrder(final int _initOrder)
    {
        this.initOrder = _initOrder;
    }

    /**
     * Setter method for instance variable {@link #displayName}.
     *
     * @param _displayName  new display name to set
     * @see #displayName
     */
    public void setDisplayName(final String _displayName)
    {
        this.displayName = _displayName;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy