• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Tomcat internals

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I was trying to undertand tomcat internals from its source code coz i need to implement the same on a grid. I started out with jsp compiler part of it and was stuck at one point. There is a java interface called Mangler under the package org.apache.jasper.compiler. I the Compiler java file under same package, it uses this interface..
Could anyone tell me what this Mangler file does? futher, in the Compiler java file , it uses the methods from this interafce directly? how can we use the interface method without implementing it?
Any help is greatly appreciated

Sangeetha
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"SKAMATH",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This comes down to 'interfaces' and is not Tomcat specific.
Interfaces can be used to define the behaviour of a class without knowing what the specific class is. Therefore 'Mangler' defines the methods that a 'Mangler' class must support, but as long as 'Compiler' knows a class behaves as a 'Mangler', it doesn't need to know anything else.
In 'Compiler' there is a method 'setMangler(Mangler mangler)' that would be used for another class to pass a class that implements the 'Mangler' interface to the 'Compiler' class. From this point on, there is a concrete implementation hiding behind the 'Mangler' interface declaration, but 'Compiler' doesn't care, it only needs the the class to behave like a 'Mangler'
If you want to see what could be hiding there, 'CommandLineCompiler' and 'JspCompiler' implement the 'Mangler' interface.
Dave
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic