/** * Returns the {@link Engine} of the specified Tomcat {@link Service}. If the {@link Service} has no * {@link Engine} set, a new {@link Engine} will be created and set. * * <p>The return type of {@link Service#getContainer()} has been changed from {@link Container} to * {@link Engine} since 8.5. Calling it directly will cause {@link NoSuchMethodError}. */ static Engine engine(Service service, String hostname) { final Engine engine; try { final Method m = Service.class.getDeclaredMethod("getContainer"); engine = (Engine) m.invoke(service); } catch (Exception e) { throw new Error("failed to invoke Service.getContainer()", e); } if (engine != null) { return engine; } // Create a new engine. final Engine newEngine = new StandardEngine(); newEngine.setName("Tomcat"); newEngine.setDefaultHost(hostname); newEngine.setRealm(new NullRealm()); service.setContainer(newEngine); return newEngine; }
final StandardEngine engine = new StandardEngine(); engine.setName(config.engineName()); engine.setDefaultHost(hostname);
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
public static StandardContext createContext() { final StandardEngine engine = new StandardEngine(); engine.setService( new StandardService() ); final StandardContext context = new StandardContext(); context.setPath( "/" ); context.setSessionCookiePath( "/" ); final WebappLoader webappLoader = new WebappLoader() { @Override public ClassLoader getClassLoader() { return Thread.currentThread().getContextClassLoader(); } }; context.setLoader( webappLoader ); final StandardHost host = new StandardHost(); engine.addChild( host ); host.addChild( context ); return context; }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "Creating engine"); StandardEngine engine = new StandardEngine(); engine.setDebug(debug); // Default host will be set to the first host added engine.setLogger(logger); // Inherited by all children engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
@Override public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Create, configure, and return an Engine that will process all * HTTP requests received from one of the associated Connectors, * based on the specified properties. */ public Engine createEngine() { if( log.isDebugEnabled() ) log.debug("Creating engine"); StandardEngine engine = new StandardEngine(); // Default host will be set to the first host added engine.setRealm(realm); // Inherited by all children return (engine); }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); service.setContainer(engine); } return engine; }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); service.setContainer(engine); } return engine; }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); service.setContainer(engine); } return engine; }
/** * 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; }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); if (defaultRealm == null) { initSimpleAuth(); } engine.setRealm(defaultRealm); service.setContainer(engine); } return engine; }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); if (defaultRealm == null) { initSimpleAuth(); } engine.setRealm(defaultRealm); service.setContainer(engine); } return engine; }
/** * 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; }
/** * 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; }