• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Contained类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.catalina.Contained的典型用法代码示例。如果您正苦于以下问题:Java Contained类的具体用法?Java Contained怎么用?Java Contained使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Contained类属于org.apache.catalina包,在下文中一共展示了Contained类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: destroyMBean

import org.apache.catalina.Contained; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Valve</code> object.
 *
 * @param valve The Valve to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 * @deprecated  Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static void destroyMBean(Valve valve, Container container)
    throws Exception {

    ((Contained)valve).setContainer(container);
    String mname = createManagedName(valve);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, valve);
    try {
        ((Contained)valve).setContainer(null);
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    if( mserver.isRegistered(oname) ) {
        mserver.unregisterMBean(oname);
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:34,代码来源:MBeanUtils.java


示例2: destroyMBean

import org.apache.catalina.Contained; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Valve</code> object.
 *
 * @param valve The Valve to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
static void destroyMBean(Valve valve, Container container)
    throws Exception {

    ((Contained)valve).setContainer(container);
    String mname = createManagedName(valve);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, valve);
    try {
        ((Contained)valve).setContainer(null);
    } catch (Throwable t) {
    ;
    }
    if( mserver.isRegistered(oname) ) {
        mserver.unregisterMBean(oname);
    }

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


示例3: destroyMBean

import org.apache.catalina.Contained; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Valve</code> object.
 *
 * @param valve The Valve to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
public static void destroyMBean(Valve valve, Container container)
    throws Exception {

    ((Contained)valve).setContainer(container);
    String mname = createManagedName(valve);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, valve);
    try {
        ((Contained)valve).setContainer(null);
    } catch (Throwable t) {
    ;
    }
    mserver.unregisterMBean(oname);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:30,代码来源:MBeanUtils.java


示例4: addValve

import org.apache.catalina.Contained; //导入依赖的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 && (valve instanceof Lifecycle)) {
        try {
            ((Lifecycle) valve).start();
        } catch (LifecycleException e) {
            log("StandardPipeline.addValve: start: ", e);
        }
    }

    // Add this Valve to the set associated with this Pipeline
    synchronized (valves) {
        Valve results[] = new Valve[valves.length +1];
        System.arraycopy(valves, 0, results, 0, valves.length);
        results[valves.length] = valve;
        valves = results;
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:44,代码来源:StandardPipeline.java


示例5: destroyMBean

import org.apache.catalina.Contained; //导入依赖的package包/类
/**
 * Deregister the MBean for this <code>Valve</code> object.
 *
 * @param valve
 *            The Valve to be managed
 *
 * @exception Exception
 *                if an MBean cannot be deregistered
 * @deprecated Unused. Will be removed in Tomcat 8.0.x
 */
@Deprecated
static void destroyMBean(Valve valve, Container container) throws Exception {

	((Contained) valve).setContainer(container);
	String mname = createManagedName(valve);
	ManagedBean managed = registry.findManagedBean(mname);
	if (managed == null) {
		return;
	}
	String domain = managed.getDomain();
	if (domain == null)
		domain = mserver.getDefaultDomain();
	ObjectName oname = createObjectName(domain, valve);
	try {
		((Contained) valve).setContainer(null);
	} catch (Throwable t) {
		ExceptionUtils.handleThrowable(t);
	}
	if (mserver.isRegistered(oname)) {
		mserver.unregisterMBean(oname);
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:34,代码来源:MBeanUtils.java


示例6: destroyMBean

import org.apache.catalina.Contained; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Valve</code> object.
 *
 * @param valve The Valve to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
static void destroyMBean(Valve valve, Container container)
    throws Exception {

    ((Contained)valve).setContainer(container);
    String mname = createManagedName(valve);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, valve);
    try {
        ((Contained)valve).setContainer(null);
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    if( mserver.isRegistered(oname) ) {
        mserver.unregisterMBean(oname);
    }

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:32,代码来源:MBeanUtils.java


示例7: addValve

import org.apache.catalina.Contained; //导入依赖的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


示例8: addValve

import org.apache.catalina.Contained; //导入依赖的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


示例9: removeValve

import org.apache.catalina.Contained; //导入依赖的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


示例10: addValve

import org.apache.catalina.Contained; //导入依赖的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


示例11: addValve

import org.apache.catalina.Contained; //导入依赖的package包/类
public void addValve(Valve valve) {
  if (valve instanceof Contained)
    ((Contained) valve).setContainer(this.container);

  synchronized (valves) {
    Valve results[] = new Valve[valves.length +1];
    System.arraycopy(valves, 0, results, 0, valves.length);
    results[valves.length] = valve;
    valves = results;
  }
}
 
开发者ID:eclipsky,项目名称:HowTomcatWorks,代码行数:12,代码来源:SimplePipeline.java


示例12: setContainer

import org.apache.catalina.Contained; //导入依赖的package包/类
@Override
public void setContainer(final Container container) {
    this.container = container;
    if (delegate != null && Contained.class.isInstance(delegate)) {
        Contained.class.cast(delegate).setContainer(container);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:8,代码来源:LazyValve.java


示例13: removeValve

import org.apache.catalina.Contained; //导入依赖的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) {

    synchronized (valves) {

        // Locate this Valve in our list
        int j = -1;
        for (int i = 0; i < valves.length; i++) {
            if (valve == valves[i]) {
                j = i;
                break;
            }
        }
        if (j < 0)
            return;

        // Remove this valve from our list
        Valve results[] = new Valve[valves.length - 1];
        int n = 0;
        for (int i = 0; i < valves.length; i++) {
            if (i == j)
                continue;
            results[n++] = valves[i];
        }
        valves = results;
        try {
            if (valve instanceof Contained)
                ((Contained) valve).setContainer(null);
        } catch (Throwable t) {
            ;
        }

    }

    // Stop this valve if necessary
    if (started && (valve instanceof Lifecycle)) {
        try {
            ((Lifecycle) valve).stop();
        } catch (LifecycleException e) {
            log("StandardPipeline.removeValve: stop: ", e);
        }
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:52,代码来源:StandardPipeline.java


示例14: setBasic

import org.apache.catalina.Contained; //导入依赖的package包/类
public void setBasic(Valve valve) {
  this.basic = valve;
  ((Contained) valve).setContainer(container);
}
 
开发者ID:eclipsky,项目名称:HowTomcatWorks,代码行数:5,代码来源:SimplePipeline.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StdCouchDbConnector类代码示例发布时间:2022-05-22
下一篇:
Java AxisRange类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap