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


Java Catalina类代码示例

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


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

示例1: createServer

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
private static Server createServer(final String serverXml) {
    final Catalina catalina = new Catalina() {
        // skip few init we don't need *here*
        @Override
        protected void initDirs() {
            // no-op
        }

        @Override
        protected void initStreams() {
            // no-op
        }

        @Override
        protected void initNaming() {
            // no-op
        }
    };
    catalina.setConfigFile(serverXml);
    catalina.load();
    return catalina.getServer();
}
 
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:Container.java

示例2: TomcatRuntimeImpl

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * @param catalina
 */
TomcatRuntimeImpl(Catalina catalina) {
    this.catalina = catalina;
    this.status = TomcatStatus.UNKNOWN;

    catalina.getServer().addLifecycleListener(new LifecycleListener() {
        @Override
        public void lifecycleEvent(LifecycleEvent event) {
            String type = event.getType().toUpperCase();
            status = TomcatStatus.valueOf(type);

            if (Lifecycle.AFTER_START_EVENT.equals(event.getType()) || Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
                semaphore.release();
            }
        }
    });
}
 
开发者ID:pidster-dot-org,项目名称:embed-apache-tomcat,代码行数:20,代码来源:TomcatRuntimeImpl.java

示例3: init

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Initialize Tomcat inner datasets.
 */
public void init () throws TomcatException
{
   tomcatpath = configurationManager.getTomcatConfiguration ().getPath ();
   final String extractDirectory = tomcatpath;

   File extractDirectoryFile = new File (extractDirectory);
   LOGGER.info("Starting tomcat in " + extractDirectoryFile.getPath());

   try
   {
      extract (extractDirectoryFile, extractDirectory);
      // create tomcat various paths
      new File (extractDirectory, "conf").mkdirs ();
      File cfg =
         new File (ClassLoader.getSystemResource ("server.xml").toURI ());
      Files.copy (cfg, new File (extractDirectory, "conf/server.xml"));
      new File (extractDirectory, "logs").mkdirs ();
      new File (extractDirectory, "webapps").mkdirs ();
      new File (extractDirectory, "work").mkdirs ();
      File tmpDir = new File (extractDirectory, "temp");
      tmpDir.mkdirs ();

      System.setProperty ("java.io.tmpdir", tmpDir.getAbsolutePath ());
      System.setProperty ("catalina.base",
         extractDirectoryFile.getAbsolutePath ());
      System.setProperty ("catalina.home",
         extractDirectoryFile.getAbsolutePath ());

      cat = new Catalina ();
   }
   catch (Exception e)
   {
      throw new TomcatException ("Cannot initalize Tomcat environment.", e);
   }

   Runtime.getRuntime ().addShutdownHook (new TomcatShutdownHook ());
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:41,代码来源:TomcatServer.java

示例4: getCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
@Override
public Catalina getCatalina() {
    return catalina;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:StandardServer.java

示例5: setCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
@Override
public void setCatalina(Catalina catalina) {
    this.catalina = catalina;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:StandardServer.java

示例6: getCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
@Override
public Catalina getCatalina() {
	return catalina;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:StandardServer.java

示例7: setCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
@Override
public void setCatalina(Catalina catalina) {
	this.catalina = catalina;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:StandardServer.java

示例8: getCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
@Override
public Catalina getCatalina() {
    return null;
}
 
开发者ID:pidster-dot-org,项目名称:embed-apache-tomcat,代码行数:5,代码来源:SafeServerImpl.java

示例9: setCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
@Override
public void setCatalina(Catalina catalina) {
    throw new UnsupportedOperationException("Catalina can't be changed at runtime");
}
 
开发者ID:pidster-dot-org,项目名称:embed-apache-tomcat,代码行数:5,代码来源:SafeServerImpl.java

示例10: getCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
public Catalina getCatalina();
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:Server.java

示例11: setCatalina

import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
public void setCatalina(Catalina catalina);
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:Server.java


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