Introductions Two decades in software development Software Engineering Solutions, Inc. ...
-
Upload
thomasina-garrison -
Category
Documents
-
view
217 -
download
0
Transcript of Introductions Two decades in software development Software Engineering Solutions, Inc. ...
![Page 1: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/1.jpg)
![Page 2: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/2.jpg)
Introductions
Two decades in software development Software Engineering Solutions, Inc.
www.swengsol.com Technical Reviewer:
Core JavaServer Faces 3rd Edition “Top 1000” reviewer at Amazon.com.
![Page 3: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/3.jpg)
Why another Tomcat book? Current focus is on administrators Tend to view Tomcat as a black box Exactly HOW does it do what it does?
![Page 4: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/4.jpg)
Pieces of the Puzzle
Java EE HTML over HTTP Servlet Container.
![Page 5: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/5.jpg)
Java EE
![Page 6: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/6.jpg)
Uniform Resource Locators
http:// www.swengsol.com
:80/myWebApp /adobe/invoices/EditInvoice ?id=x123;jsessionid=…
scheme porthostcontext path
servlet path
path info
path parameters
query string
![Page 7: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/7.jpg)
HTML over HTTP
![Page 8: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/8.jpg)
Servlet Specification
WAR file format Servlet Filter Listener Session web.xml
![Page 9: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/9.jpg)
Servlet Container Interaction
![Page 10: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/10.jpg)
Concurrency
![Page 11: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/11.jpg)
The Tomcat Servlet Container
Top Level Components
Containers
Nested Components
Connectors
![Page 12: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/12.jpg)
Container Overview
Note the shading …
our “baby server”
Pipeline pattern
Context helpers
![Page 13: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/13.jpg)
Containment: Server and Service
<Server port="8005" shutdown="SHUTDOWN"><Service name="Catalina">
Protocol-specific processing
Protocol-agnostic processing
![Page 14: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/14.jpg)
Containment: Connectors
<Connector port="80" protocol="HTTP/1.1" … />
![Page 15: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/15.jpg)
Containment: Catalina Engine
<Engine name="Catalina" defaultHost="localhost” baseDir=“…”> …
</Engine>
![Page 16: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/16.jpg)
Containment: Virtual Host
IP-based
Each FQHN resolves to a specific IP address
Needs dedicated IP addresses
![Page 17: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/17.jpg)
Containment: Virtual Host
Name-based
Multiple FQHNs resolve to a single IP address
Host: request header interrogated Simple but requires help with SSL
![Page 18: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/18.jpg)
Containment: Virtual Host
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" … >
Relative to CATALINA_BASE
![Page 19: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/19.jpg)
CATALINA_HOME/conf/<EngineName>/<HostName>/<contextPath>.xml
Containment: Context
<Context path="/examples" ...> Relative to appBaseContext Fragment locations:
META-INF/context.xml
Vendor-specific Vendor-agnostic
![Page 20: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/20.jpg)
Containment: Another View
![Page 21: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/21.jpg)
BenefitsLate Binding (assembly of functionality)Security (single choke point)Customization (encrypt, generate, locate)Variance across TimeVariance across SpaceIsolation Zones
Advanced Topics: Java Class Loading First Principles
![Page 22: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/22.jpg)
RulesConsistency (always return same instance)Delegation (security)Visibility (Delegation hierarchy + CL inversion)
Advanced Topics: Java Class Loading First Principles
![Page 23: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/23.jpg)
Available OptionsImplicit class loading:
MyClass myClass = new MyClass()Explicit class loading:ClassLoader ldr =
ClassLoader.getSystemClassLoader();Class cls = ldr.loadClass("MyClass");MyClass myClass = (MyClass) cls.newInstance();
Advanced Topics: Java Class Loading First Principles
![Page 24: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/24.jpg)
Advanced Topics: Java Class Loading
No parent Native code in JVM Core Java classes from rt.jar JRE_HOME/jre/lib/ext
(implicit CLASSPATH)
Classes on CLASSPATH Truncated by Tomcat CATALINA_HOME/lib Visible to web apps and
Tomcat code
Directory configured in catalina.properties
Visible to all web apps
WEB-INF/classes and WEB-INF/lib
Delegates to parent for standard Java classes
Directory configured in [catalina.properties]
Visible only to Tomcat code
Lets you override core JDK classes
JAVA_HOME/lib/endorsed
![Page 25: Introductions Two decades in software development Software Engineering Solutions, Inc. Technical Reviewer: Core.](https://reader035.fdocuments.us/reader035/viewer/2022081513/56649f165503460f94c2c603/html5/thumbnails/25.jpg)
Advanced Topics: Web Application Class Loading
[1]
[2]
[3]