org.apache.catalina.startup.Tomcat.createDefaultRealm()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.catalina.startup.Tomcat.createDefaultRealm()方法的一些代码示例,展示了Tomcat.createDefaultRealm()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tomcat.createDefaultRealm()方法的具体详情如下:
包路径:org.apache.catalina.startup.Tomcat
类名称:Tomcat
方法名:createDefaultRealm

Tomcat.createDefaultRealm介绍

[英]Create an in-memory realm. You can replace it for contexts with a real one. The Realm created here will be added to the Engine by default and may be replaced at the Engine level or over-ridden (as per normal Tomcat behaviour) at the Host or Context level.
[中]创建一个内存领域。你可以用一个真实的上下文替换它。默认情况下,这里创建的领域将被添加到引擎中,并可能在引擎级别被替换,或者在主机或上下文级别被过度使用(根据Tomcat的正常行为)。

代码示例

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Access to the engine, for further customization.
 */
public Engine getEngine() {
  if(engine == null ) {
    getServer();
    engine = new StandardEngine();
    engine.setName( "Tomcat" );
    engine.setDefaultHost(hostname);
    engine.setRealm(createDefaultRealm());
    service.setContainer(engine);
  }
  return engine;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Access to the engine, for further customization.
 * @return The engine
 */
public Engine getEngine() {
  Service service = getServer().findServices()[0];
  if (service.getContainer() != null) {
    return service.getContainer();
  }
  Engine engine = new StandardEngine();
  engine.setName( "Tomcat" );
  engine.setDefaultHost(hostname);
  engine.setRealm(createDefaultRealm());
  service.setContainer(engine);
  return engine;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Access to the engine, for further customization.
 * @return The engine
 */
public Engine getEngine() {
  Service service = getServer().findServices()[0];
  if (service.getContainer() != null) {
    return service.getContainer();
  }
  Engine engine = new StandardEngine();
  engine.setName( "Tomcat" );
  engine.setDefaultHost(hostname);
  engine.setRealm(createDefaultRealm());
  service.setContainer(engine);
  return engine;
}

相关文章