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


Java Engine.getRealm方法代码示例

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


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

示例1: createMBeans

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

    // Create the MBean for the Engine itself
    if (log.isDebugEnabled()) {
        log.debug("Creating MBean for Engine " + engine);
    }
    //MBeanUtils.createMBean(engine);
    engine.addContainerListener(this);
    if (engine instanceof StandardEngine) {
        ((StandardEngine) engine).addPropertyChangeListener(this);
    }

    // Create the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (log.isDebugEnabled())
            log.debug("Creating MBean for Realm " + eRealm);
        //MBeanUtils.createMBean(eRealm);
    }

    // Create the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int j = 0; j < hosts.length; j++) {
        createMBeans((Host) hosts[j]);
    }

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

示例2: destroyMBeans

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

    // Deregister ourselves as a ContainerListener
    engine.removeContainerListener(this);

    // Deregister the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int k = 0; k < hosts.length; k++) {
        destroyMBeans((Host) hosts[k]);
    }

    // Deregister the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (log.isDebugEnabled())
            log.debug("Destroying MBean for Realm " + eRealm);
        //MBeanUtils.destroyMBean(eRealm);
    }

    // Deregister the MBean for the Engine itself
    if (log.isDebugEnabled()) {
        log.debug("Destroying MBean for Engine " + engine);
    }
    //MBeanUtils.destroyMBean(engine);

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

示例3: getTomcatContextRealm

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 *
 * @return Tomcat Realms
 * @throws AttributeNotFoundException
 * @throws InstanceNotFoundException
 * @throws MBeanException
 * @throws ReflectionException
 */
public Realm getTomcatContextRealm() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException {
    try {
        ObjectName name = new ObjectName("Catalina", "type", "Engine");
        Engine engine = (Engine) JwalaAuthenticationProvider.getmBeanServer().getAttribute(name, "managedResource");
        return engine.getRealm();
    } catch (MalformedObjectNameException ex) {
        LOGGER.error("Invalid Realm", ex);
    }
    return null;
}
 
开发者ID:cerner,项目名称:jwala,代码行数:19,代码来源:JwalaAuthenticationProvider.java

示例4: createMBeans

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

    // Create the MBean for the Engine itself
    if (debug >= 2) {
        log("Creating MBean for Engine " + engine);
    }
    MBeanUtils.createMBean(engine);
    engine.addContainerListener(this);
    if (engine instanceof StandardEngine) {
        ((StandardEngine) engine).addPropertyChangeListener(this);
    }

    // Create the MBeans for the associated nested components
    Logger eLogger = engine.getLogger();
    if (eLogger != null) {
        if (debug >= 2)
            log("Creating MBean for Logger " + eLogger);
        MBeanUtils.createMBean(eLogger);
    }
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (debug >= 2)
            log("Creating MBean for Realm " + eRealm);
        MBeanUtils.createMBean(eRealm);
    }

    // Create the MBeans for the associated Valves
    if (engine instanceof StandardEngine) {
        Valve eValves[] = ((StandardEngine)engine).getValves();
        for (int j = 0; j < eValves.length; j++) {
            if (debug >= 2)
                log("Creating MBean for Valve " + eValves[j]);
            MBeanUtils.createMBean(eValves[j]);
        }
    }

    // Create the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int j = 0; j < hosts.length; j++) {
        createMBeans((Host) hosts[j]);
    }

    // Create the MBeans for DefaultContext
    DefaultContext dcontext = engine.getDefaultContext();
    if (dcontext != null) {
        dcontext.setParent(engine);
        createMBeans(dcontext);
    }

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

示例5: destroyMBeans

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

    // Deregister ourselves as a ContainerListener
    engine.removeContainerListener(this);

    // Deregister the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int k = 0; k < hosts.length; k++) {
        destroyMBeans((Host) hosts[k]);
    }

    // Deregister the MBeans for the associated Valves
    if (engine instanceof StandardEngine) {
        Valve eValves[] = ((StandardEngine)engine).getValves();
        for (int k = 0; k < eValves.length; k++) {
            if (debug >= 3)
                log("Destroying MBean for Valve " + eValves[k]);
            MBeanUtils.destroyMBean(eValves[k], engine);
        }
    }

    // Deregister the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (debug >= 3)
            log("Destroying MBean for Realm " + eRealm);
        MBeanUtils.destroyMBean(eRealm);
    }
    Logger eLogger = engine.getLogger();
    if (eLogger != null) {
        if (debug >= 3)
            log("Destroying MBean for Logger " + eLogger);
        MBeanUtils.destroyMBean(eLogger);
    }

    // Deregister the MBean for the Engine itself
    if (debug >= 2) {
        log("Destroying MBean for Engine " + engine);
    }
    MBeanUtils.destroyMBean(engine);

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


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