当前位置: 首页>>代码示例>>Java>>正文


Java Valve.setNext方法代码示例

本文整理汇总了Java中org.apache.catalina.Valve.setNext方法的典型用法代码示例。如果您正苦于以下问题:Java Valve.setNext方法的具体用法?Java Valve.setNext怎么用?Java Valve.setNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.Valve的用法示例。


在下文中一共展示了Valve.setNext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addValve

import org.apache.catalina.Valve; //导入方法依赖的package包/类
/**
 * <p>Add a new Valve to the end of the pipeline associated with this
 * Container.  Prior to adding the Valve, the Valve's
 * <code>setContainer()</code> method will be called, if it implements
 * <code>Contained</code>, with the owning Container as an argument.
 * The method may throw an
 * <code>IllegalArgumentException</code> if this Valve chooses not to
 * be associated with this Container, or <code>IllegalStateException</code>
 * if it is already associated with a different Container.</p>
 *
 * @param valve Valve to be added
 *
 * @exception IllegalArgumentException if this Container refused to
 *  accept the specified Valve
 * @exception IllegalArgumentException if the specified Valve refuses to be
 *  associated with this Container
 * @exception IllegalStateException if the specified Valve is already
 *  associated with a different Container
 */
@Override
public void addValve(Valve valve) {

    // Validate that we can add this Valve
    if (valve instanceof Contained)
        ((Contained) valve).setContainer(this.container);

    // Start the new component if necessary
    if (getState().isAvailable()) {
        if (valve instanceof Lifecycle) {
            try {
                ((Lifecycle) valve).start();
            } catch (LifecycleException e) {
                log.error("StandardPipeline.addValve: start: ", e);
            }
        }
    }

    // Add this Valve to the set associated with this Pipeline
    if (first == null) {
        first = valve;
        valve.setNext(basic);
    } else {
        Valve current = first;
        while (current != null) {
            if (current.getNext() == basic) {
                current.setNext(valve);
                valve.setNext(basic);
                break;
            }
            current = current.getNext();
        }
    }
    
    container.fireContainerEvent(Container.ADD_VALVE_EVENT, valve);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:56,代码来源:StandardPipeline.java

示例2: addValve

import org.apache.catalina.Valve; //导入方法依赖的package包/类
/**
  * <p>Add a new Valve to the end of the pipeline associated with this
  * Container.  Prior to adding the Valve, the Valve's
  * <code>setContainer()</code> method will be called, if it implements
  * <code>Contained</code>, with the owning Container as an argument.
  * The method may throw an
  * <code>IllegalArgumentException</code> if this Valve chooses not to
  * be associated with this Container, or <code>IllegalStateException</code>
  * if it is already associated with a different Container.</p>
  *
  * @param valve Valve to be added
  *
  * @exception IllegalArgumentException if this Container refused to
  *  accept the specified Valve
  * @exception IllegalArgumentException if the specifie Valve refuses to be
  *  associated with this Container
  * @exception IllegalStateException if the specified Valve is already
  *  associated with a different Container
  */
 public void addValve(Valve valve) {
 
     // Validate that we can add this Valve
     if (valve instanceof Contained)
         ((Contained) valve).setContainer(this.container);

     // Start the new component if necessary
     if (started) {
         if (valve instanceof Lifecycle) {
             try {
                 ((Lifecycle) valve).start();
             } catch (LifecycleException e) {
                 log.error("StandardPipeline.addValve: start: ", e);
             }
         }
         // Register the newly added valve
         registerValve(valve);
     }

     // Add this Valve to the set associated with this Pipeline
     if (first == null) {
     	first = valve;
     	valve.setNext(basic);
     } else {
         Valve current = first;
         while (current != null) {
	if (current.getNext() == basic) {
		current.setNext(valve);
		valve.setNext(basic);
		break;
	}
	current = current.getNext();
}
     }

 }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:56,代码来源:StandardPipeline.java

示例3: removeValve

import org.apache.catalina.Valve; //导入方法依赖的package包/类
/**
 * Remove the specified Valve from the pipeline associated with this
 * Container, if it is found; otherwise, do nothing.  If the Valve is
 * found and removed, the Valve's <code>setContainer(null)</code> method
 * will be called if it implements <code>Contained</code>.
 *
 * @param valve Valve to be removed
 */
public void removeValve(Valve valve) {

    Valve current;
    if(first == valve) {
        first = first.getNext();
        current = null;
    } else {
        current = first;
    }
    while (current != null) {
        if (current.getNext() == valve) {
            current.setNext(valve.getNext());
            break;
        }
        current = current.getNext();
    }

    if (first == basic) first = null;

    if (valve instanceof Contained)
        ((Contained) valve).setContainer(null);

    // Stop this valve if necessary
    if (started) {
        if (valve instanceof Lifecycle) {
            try {
                ((Lifecycle) valve).stop();
            } catch (LifecycleException e) {
                log.error("StandardPipeline.removeValve: stop: ", e);
            }
        }
        // Unregister the removed valave
        unregisterValve(valve);
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:45,代码来源:StandardPipeline.java

示例4: addValve

import org.apache.catalina.Valve; //导入方法依赖的package包/类
/**
 * <p>
 * Add a new Valve to the end of the pipeline associated with this
 * Container. Prior to adding the Valve, the Valve's
 * <code>setContainer()</code> method will be called, if it implements
 * <code>Contained</code>, with the owning Container as an argument. The
 * method may throw an <code>IllegalArgumentException</code> if this Valve
 * chooses not to be associated with this Container, or
 * <code>IllegalStateException</code> if it is already associated with a
 * different Container.
 * </p>
 *
 * @param valve
 *            Valve to be added
 *
 * @exception IllegalArgumentException
 *                if this Container refused to accept the specified Valve
 * @exception IllegalArgumentException
 *                if the specified Valve refuses to be associated with this
 *                Container
 * @exception IllegalStateException
 *                if the specified Valve is already associated with a
 *                different Container
 */
@Override
public void addValve(Valve valve) {

	// Validate that we can add this Valve
	if (valve instanceof Contained)
		((Contained) valve).setContainer(this.container);

	// Start the new component if necessary
	if (getState().isAvailable()) {
		if (valve instanceof Lifecycle) {
			try {
				((Lifecycle) valve).start();
			} catch (LifecycleException e) {
				log.error("StandardPipeline.addValve: start: ", e);
			}
		}
	}

	// Add this Valve to the set associated with this Pipeline
	if (first == null) {
		first = valve;
		valve.setNext(basic);
	} else {
		Valve current = first;
		while (current != null) {
			if (current.getNext() == basic) {
				current.setNext(valve);
				valve.setNext(basic);
				break;
			}
			current = current.getNext();
		}
	}

	container.fireContainerEvent(Container.ADD_VALVE_EVENT, valve);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:61,代码来源:StandardPipeline.java


注:本文中的org.apache.catalina.Valve.setNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。