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


Java Server.getGlobalNamingResources方法代码示例

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


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

示例1: createMBeans

import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified Server and its nested components.
 *
 * @param server Server for which to create MBeans
 *
 * @exception Exception if an exception is thrown during MBean creation
 */
protected void createMBeans(Server server) throws Exception {

    // Create the MBean for the Server itself
    if (log.isDebugEnabled())
        log.debug("Creating MBean for Server " + server);
    //MBeanUtils.createMBean(server);
    if (server instanceof StandardServer) {
        ((StandardServer) server).addPropertyChangeListener(this);
    }

    // Create the MBeans for the global NamingResources (if any)
    NamingResources resources = server.getGlobalNamingResources();
    if (resources != null) {
        createMBeans(resources);
    }

    // Create the MBeans for each child Service
    Service services[] = server.findServices();
    for (int i = 0; i < services.length; i++) {
        // FIXME - Warp object hierarchy not currently supported
        if (services[i].getContainer().getClass().getName().equals
            ("org.apache.catalina.connector.warp.WarpEngine")) {
            if (log.isDebugEnabled()) {
                log.debug("Skipping MBean for Service " + services[i]);
            }
            continue;
        }
        createMBeans(services[i]);
    }

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

示例2: destroyMBeans

import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
 * Deregister the MBeans for the specified Server and its related
 * components.
 *
 * @param server Server for which to destroy MBeans
 *
 * @exception Exception if an exception is thrown during MBean destruction
 */
protected void destroyMBeans(Server server) throws Exception {

    // Destroy the MBeans for the global NamingResources (if any)
    NamingResources resources = server.getGlobalNamingResources();
    if (resources != null) {
        destroyMBeans(resources);
    }

    // Destroy the MBeans for each child Service
    Service services[] = server.findServices();
    for (int i = 0; i < services.length; i++) {
        // FIXME - Warp object hierarchy not currently supported
        if (services[i].getContainer().getClass().getName().equals
            ("org.apache.catalina.connector.warp.WarpEngine")) {
            if (log.isDebugEnabled()) {
                log.debug("Skipping MBean for Service " + services[i]);
            }
            continue;
        }
        destroyMBeans(services[i]);
    }

    // Destroy the MBean for the Server itself
    if (log.isDebugEnabled()) {
        log.debug("Destroying MBean for Server " + server);
    }
    //MBeanUtils.destroyMBean(server);
    if (server instanceof StandardServer) {
        ((StandardServer) server).removePropertyChangeListener(this);
    }

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

示例3: createMBeans

import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified Server and its nested components.
 *
 * @param server Server for which to create MBeans
 *
 * @exception Exception if an exception is thrown during MBean creation
 */
protected void createMBeans(Server server) throws Exception {

    // Create the MBean for the Server itself
    if (debug >= 2)
        log("Creating MBean for Server " + server);
    MBeanUtils.createMBean(server);
    if (server instanceof StandardServer) {
        ((StandardServer) server).addPropertyChangeListener(this);
    }

    // Create the MBeans for the global NamingResources (if any)
    NamingResources resources = server.getGlobalNamingResources();
    if (resources != null) {
        createMBeans(resources);
    }

    // Create the MBeans for each child Service
    Service services[] = server.findServices();
    for (int i = 0; i < services.length; i++) {
        // FIXME - Warp object hierarchy not currently supported
        if (services[i].getContainer().getClass().getName().equals
            ("org.apache.catalina.connector.warp.WarpEngine")) {
            if (debug >= 1) {
                log("Skipping MBean for Service " + services[i]);
            }
            continue;
        }
        createMBeans(services[i]);
    }

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

示例4: destroyMBeans

import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
 * Deregister the MBeans for the specified Server and its related
 * components.
 *
 * @param server Server for which to destroy MBeans
 *
 * @exception Exception if an exception is thrown during MBean destruction
 */
protected void destroyMBeans(Server server) throws Exception {
    
    // Destroy the MBeans for the global NamingResources (if any)
    NamingResources resources = server.getGlobalNamingResources();
    if (resources != null) {
        destroyMBeans(resources);
    }
    
    // Destroy the MBeans for each child Service
    Service services[] = server.findServices();
    for (int i = 0; i < services.length; i++) {
        // FIXME - Warp object hierarchy not currently supported
        if (services[i].getContainer().getClass().getName().equals
            ("org.apache.catalina.connector.warp.WarpEngine")) {
            if (debug >= 1) {
                log("Skipping MBean for Service " + services[i]);
            }
            continue;
        }
        destroyMBeans(services[i]);
    }

    // Destroy the MBean for the Server itself
    if (debug >= 2) {
        log("Destroying MBean for Server " + server);
    }
    MBeanUtils.destroyMBean(server);
    if (server instanceof StandardServer) {
        ((StandardServer) server).removePropertyChangeListener(this);
    }

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

示例5: storeServer

import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
 * Store the specified Server properties.
 *
 * @param writer PrintWriter to which we are storing
 * @param indent Number of spaces to indent this element
 * @param server Object to be stored
 *
 * @exception Exception if an exception occurs while storing
 */
private void storeServer(PrintWriter writer, int indent,
                         Server server) throws Exception {

    // Store the beginning of this element
    writer.println("<?xml version='1.0' encoding='utf-8'?>");
    for (int i = 0; i < indent; i++) {
        writer.print(' ');
    }
    writer.print("<Server");
    storeAttributes(writer, server);
    writer.println(">");

    // Store nested <Listener> elements
    if (server instanceof Lifecycle) {
        LifecycleListener listeners[] =
            ((Lifecycle) server).findLifecycleListeners();
        for (int i = 0; i < listeners.length; i++) {
            storeListener(writer, indent + 2, listeners[i]);
        }
    }

    // Store nested <GlobalNamingResources> element
    NamingResources globalNamingResources =
        server.getGlobalNamingResources();
    if (globalNamingResources != null) {
        for (int i = 0; i < indent + 2; i++) {
            writer.print(' ');
        }
        writer.println("<GlobalNamingResources>");
        storeNamingResources(writer, indent + 4, globalNamingResources);
        for (int i = 0; i < indent + 2; i++) {
            writer.print(' ');
        }
        writer.println("</GlobalNamingResources>");
    }

    // Store nested <Service> elements
    Service services[] = server.findServices();
    for (int i = 0; i < services.length; i++) {
        storeService(writer, indent + 2, services[i]);
    }

    // Store the ending of this element
    for (int i = 0; i < indent; i++) {
        writer.print(' ');
    }
    writer.println("</Server>");

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


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