本文整理汇总了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();
}
示例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();
}
}
});
}
示例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 ());
}
示例4: getCatalina
import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
* Return the outer Catalina startup/shutdown component if present.
*/
@Override
public Catalina getCatalina() {
return catalina;
}
示例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;
}
示例6: getCatalina
import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
* Return the outer Catalina startup/shutdown component if present.
*/
@Override
public Catalina getCatalina() {
return catalina;
}
示例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;
}
示例8: getCatalina
import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
@Override
public Catalina getCatalina() {
return null;
}
示例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");
}
示例10: getCatalina
import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
* Return the outer Catalina startup/shutdown component if present.
*/
public Catalina getCatalina();
示例11: setCatalina
import org.apache.catalina.startup.Catalina; //导入依赖的package包/类
/**
* Set the outer Catalina startup/shutdown component if present.
*/
public void setCatalina(Catalina catalina);