org.apache.catalina.startup.Catalina Java Examples

The following examples show how to use org.apache.catalina.startup.Catalina. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Meecrowave.java    From openwebbeans-meecrowave with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #2
Source File: Container.java    From tomee with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #3
Source File: TomcatServer.java    From DataHubSystem with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 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 ());
}
 
Example #4
Source File: StandardServer.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
@Override
public Catalina getCatalina() {
    return catalina;
}
 
Example #5
Source File: StandardServer.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
@Override
public void setCatalina(Catalina catalina) {
    this.catalina = catalina;
}
 
Example #6
Source File: StandardServer.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
@Override
public Catalina getCatalina() {
    return catalina;
}
 
Example #7
Source File: StandardServer.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
@Override
public void setCatalina(Catalina catalina) {
    this.catalina = catalina;
}
 
Example #8
Source File: StandardServer.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
@Override
public Catalina getCatalina() {
    return catalina;
}
 
Example #9
Source File: StandardServer.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
@Override
public void setCatalina(Catalina catalina) {
    this.catalina = catalina;
}
 
Example #10
Source File: Server.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * @return the outer Catalina startup/shutdown component if present.
 */
public Catalina getCatalina();
 
Example #11
Source File: Server.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 *
 * @param catalina the outer Catalina component
 */
public void setCatalina(Catalina catalina);
 
Example #12
Source File: Server.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
public Catalina getCatalina();
 
Example #13
Source File: Server.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
public void setCatalina(Catalina catalina);
 
Example #14
Source File: Server.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Return the outer Catalina startup/shutdown component if present.
 */
public Catalina getCatalina();
 
Example #15
Source File: Server.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Set the outer Catalina startup/shutdown component if present.
 */
public void setCatalina(Catalina catalina);