Standard implementation of the Engine interface. Each child container must be a Host implementation to process the specific fully qualified host name of that virtual host.
| 47 | * the specific fully qualified host name of that virtual host. |
| 48 | */ |
| 49 | public class StandardEngine extends ContainerBase implements Engine { |
| 50 | |
| 51 | private static final Log log = LogFactory.getLog(StandardEngine.class); |
| 52 | |
| 53 | |
| 54 | // ----------------------------------------------------------- Constructors |
| 55 | |
| 56 | /** |
| 57 | * Create a new StandardEngine component with the default basic Valve. |
| 58 | */ |
| 59 | public StandardEngine() { |
| 60 | pipeline.setBasic(new StandardEngineValve()); |
| 61 | // By default, the engine will hold the reloading thread |
| 62 | backgroundProcessorDelay = 10; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | // ----------------------------------------------------- Instance Variables |
| 67 | |
| 68 | /** |
| 69 | * Host name to use when no server host, or an unknown host, is specified in the request. |
| 70 | */ |
| 71 | private String defaultHost = null; |
| 72 | |
| 73 | |
| 74 | /** |
| 75 | * The <code>Service</code> that owns this Engine, if any. |
| 76 | */ |
| 77 | private Service service = null; |
| 78 | |
| 79 | /** |
| 80 | * The JVM Route ID for this Tomcat instance. All Route ID's must be unique across the cluster. |
| 81 | */ |
| 82 | private String jvmRouteId; |
| 83 | |
| 84 | /** |
| 85 | * Default access log to use for request/response pairs where we can't ID the intended host and context. |
| 86 | */ |
| 87 | private final AtomicReference<AccessLog> defaultAccessLog = new AtomicReference<>(); |
| 88 | |
| 89 | // ------------------------------------------------------------- Properties |
| 90 | |
| 91 | @Override |
| 92 | public Realm getRealm() { |
| 93 | Realm configured = super.getRealm(); |
| 94 | // If no set realm has been called - default to NullRealm |
| 95 | // This can be overridden at engine, context and host level |
| 96 | if (configured == null) { |
| 97 | configured = new NullRealm(); |
| 98 | this.setRealm(configured); |
| 99 | } |
| 100 | return configured; |
| 101 | } |
| 102 | |
| 103 | |
| 104 | @Override |
| 105 | public String getDefaultHost() { |
| 106 | return defaultHost; |