Java Doc for BaseJkConfig.java in  » Sevlet-Container » tomcat-connectors » org » apache » jk » config » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » tomcat connectors » org.apache.jk.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jk.config.BaseJkConfig

All known Subclasses:   org.apache.jk.config.NSConfig,  org.apache.jk.config.ApacheConfig,  org.apache.jk.config.IISConfig,
BaseJkConfig
public class BaseJkConfig implements LifecycleListener(Code)
Base class for automatic jk based configurations based on the Tomcat server.xml settings and the war contexts initialized during startup.

This config interceptor is enabled by inserting a Config element in the <ContextManager> tag body inside the server.xml file like so:

 < ContextManager ... >
 ...
 <???Config options />
 ...
 < /ContextManager >
 
where options can include any of the following attributes:
  • configHome - default parent directory for the following paths. If not set, this defaults to TOMCAT_HOME. Ignored whenever any of the following paths is absolute.
  • workersConfig - path to workers.properties file used by jk connector. If not set, defaults to "conf/jk/workers.properties".
  • jkLog - path to log file to be used by jk connector.
  • jkDebug - Loglevel setting. May be debug, info, error, or emerg. If not set, defaults to emerg.
  • jkWorker The desired worker. Must be set to one of the workers defined in the workers.properties file. "ajp12", "ajp13" or "inprocess" are the workers found in the default workers.properties file. If not specified, defaults to "ajp13" if an Ajp13Interceptor is in use, otherwise it defaults to "ajp12".
  • forwardAll - If true, forward all requests to Tomcat. This helps insure that all the behavior configured in the web.xml file functions correctly. If false, let Apache serve static resources. The default is true. Warning: When false, some configuration in the web.xml may not be duplicated in Apache. Review the mod_jk conf file to see what configuration is actually being set in Apache.
  • noRoot - If true, the root context is not mapped to Tomcat. If false and forwardAll is true, all requests to the root context are mapped to Tomcat. If false and forwardAll is false, only JSP and servlets requests to the root context are mapped to Tomcat. When false, to correctly serve Tomcat's root context you may also need to modify the web server to point it's home directory to Tomcat's root context directory. Otherwise some content, such as the root index.html, may be served by the web server before the connector gets a chance to claim the request and pass it to Tomcat. The default is true.


author:
   Costin Manolache
author:
   Larry Isaacs
author:
   Bill Barker
version:
   $Revision: 1.2 $



Field Summary
protected  booleanappend
    
protected  FileconfigHome
    
protected  intdebug
    
protected  booleanforwardAll
    
protected  StringjkDebug
    
protected  FilejkLog
    
protected  StringjkWorker
    
protected  booleanlegacy
    
protected  booleannoRoot
    
protected  booleanregenerate
    
protected  StringtomcatHome
    
protected  FileworkersConfig
    


Method Summary
protected  booleanaddExtensionMapping(String ctxPath, String ext, PrintWriter pw)
     Add an extension mapping.
protected  booleanaddMapping(String fullPath, PrintWriter pw)
     Add a fulling specified mapping.
public  voidexecute(LifecycleEvent evt)
     Generate configuration files.
public  voidexecuteContext(Context context, PrintWriter mod_jk)
     executes the ApacheConfig interceptor.
protected  voidexecuteEngine(Engine egn, PrintWriter mod_jk)
     Generate configuration files.
protected  voidexecuteHost(Host hst, PrintWriter mod_jk)
     Generate configuration files.
public  voidexecuteServer(Server svr, PrintWriter mod_jk)
     Generate configuration files.
protected  voidgenerateContextMappings(Context context, PrintWriter mod_jk)
    
protected  booleangenerateJkHead(PrintWriter mod_jk)
    
protected  voidgenerateJkTail(PrintWriter mod_jk)
    
protected  voidgenerateSSLConfig(PrintWriter mod_jk)
    
protected  voidgenerateStupidMappings(Context context, PrintWriter mod_jk)
    
protected  voidgenerateVhostHead(Host host, PrintWriter mod_jk)
    
protected  voidgenerateVhostTail(Host host, PrintWriter mod_jk)
    
protected  StringgetAbsoluteDocBase(Context context)
    
public static  FilegetConfigFile(File base, File configDir, String defaultF)
    
protected  HostgetHost(Container child)
     Get the host associated with this Container (if any).
protected  PrintWritergetWriter()
     Get the output Writer.
protected  voidinitProperties()
    
public static  booleanisAbsolute(String path)
    
public  voidlifecycleEvent(LifecycleEvent evt)
    
protected  voidlog(String msg)
    
public static  Stringpatch(String path)
    
public  voidsetAppend(boolean apnd)
     Append to config file.
public  voidsetConfigHome(String dir)
     set a path to the parent directory of the conf folder.
public  voidsetForwardAll(boolean b)
     If false, we'll try to generate a config that will let apache serve static files.
public  voidsetJkDebug(String level)
     Set the verbosity level ( use debug, error, etc.
public  voidsetJkLog(String path)
    
public  voidsetJkWorker(String worker)
    
public  voidsetLegacy(boolean legacy)
    
public  voidsetNoRoot(boolean b)
     Special option - do not generate mappings for the ROOT context.
public  voidsetWorkersConfig(String path)
     set a path to the workers.properties file.

Field Detail
append
protected boolean append(Code)



configHome
protected File configHome(Code)



debug
protected int debug(Code)



forwardAll
protected boolean forwardAll(Code)



jkDebug
protected String jkDebug(Code)



jkLog
protected File jkLog(Code)



jkWorker
protected String jkWorker(Code)



legacy
protected boolean legacy(Code)



noRoot
protected boolean noRoot(Code)



regenerate
protected boolean regenerate(Code)



tomcatHome
protected String tomcatHome(Code)



workersConfig
protected File workersConfig(Code)





Method Detail
addExtensionMapping
protected boolean addExtensionMapping(String ctxPath, String ext, PrintWriter pw)(Code)
Add an extension mapping. Override with method to generate web server specific configuration



addMapping
protected boolean addMapping(String fullPath, PrintWriter pw)(Code)
Add a fulling specified mapping. Override with method to generate web server specific configuration



execute
public void execute(LifecycleEvent evt)(Code)
Generate configuration files. Override with method to generate web server specific configuration.



executeContext
public void executeContext(Context context, PrintWriter mod_jk)(Code)
executes the ApacheConfig interceptor. This method generates apache configuration files for use with mod_jk.

context a Context object. mod_jk Writer for output.




executeEngine
protected void executeEngine(Engine egn, PrintWriter mod_jk)(Code)
Generate configuration files. Override with method to generate web server specific configuration.



executeHost
protected void executeHost(Host hst, PrintWriter mod_jk)(Code)
Generate configuration files. Override with method to generate web server specific configuration.



executeServer
public void executeServer(Server svr, PrintWriter mod_jk)(Code)
Generate configuration files. Override with method to generate web server specific configuration.



generateContextMappings
protected void generateContextMappings(Context context, PrintWriter mod_jk)(Code)



generateJkHead
protected boolean generateJkHead(PrintWriter mod_jk)(Code)
Generate general options



generateJkTail
protected void generateJkTail(PrintWriter mod_jk)(Code)
Generate general options



generateSSLConfig
protected void generateSSLConfig(PrintWriter mod_jk)(Code)
Generate SSL options



generateStupidMappings
protected void generateStupidMappings(Context context, PrintWriter mod_jk)(Code)



generateVhostHead
protected void generateVhostHead(Host host, PrintWriter mod_jk)(Code)
Generate Virtual Host start



generateVhostTail
protected void generateVhostTail(Host host, PrintWriter mod_jk)(Code)
Generate Virtual Host end



getAbsoluteDocBase
protected String getAbsoluteDocBase(Context context)(Code)



getConfigFile
public static File getConfigFile(File base, File configDir, String defaultF)(Code)



getHost
protected Host getHost(Container child)(Code)
Get the host associated with this Container (if any).



getWriter
protected PrintWriter getWriter() throws IOException(Code)
Get the output Writer. Override with method to generate web server specific configuration.



initProperties
protected void initProperties()(Code)
Initialize defaults for properties that are not set explicitely



isAbsolute
public static boolean isAbsolute(String path)(Code)



lifecycleEvent
public void lifecycleEvent(LifecycleEvent evt)(Code)
Generate the configuration - only when the server is completely initialized ( before starting )



log
protected void log(String msg)(Code)



patch
public static String patch(String path)(Code)



setAppend
public void setAppend(boolean apnd)(Code)
Append to config file. Set to true if the config information should be appended.



setConfigHome
public void setConfigHome(String dir)(Code)
set a path to the parent directory of the conf folder. That is, the parent directory within which path setters would be resolved against, if relative. For example if ConfigHome is set to "/home/tomcat" and regConfig is set to "conf/mod_jk.conf" then the resulting path used would be: "/home/tomcat/conf/mod_jk.conf".

However, if the path is set to an absolute path, this attribute is ignored.

If not set, execute() will set this to TOMCAT_HOME.

dir - path to a directory




setForwardAll
public void setForwardAll(boolean b)(Code)
If false, we'll try to generate a config that will let apache serve static files. The default is true, forward all requests in a context to tomcat.



setJkDebug
public void setJkDebug(String level)(Code)
Set the verbosity level ( use debug, error, etc. ) If not set, no log is written.



setJkLog
public void setJkLog(String path)(Code)
set the path to the log file path String path to a file



setJkWorker
public void setJkWorker(String worker)(Code)
set the Ajp protocal protocal String protocol, "ajp12" or "ajp13"



setLegacy
public void setLegacy(boolean legacy)(Code)



setNoRoot
public void setNoRoot(boolean b)(Code)
Special option - do not generate mappings for the ROOT context. The default is true, and will not generate the mappings, not redirecting all pages to tomcat (since /* matches everything). This means that the web server's root remains intact but isn't completely servlet/JSP enabled. If the ROOT webapp can be configured with the web server serving static files, there's no problem setting this option to false. If not, then setting it true means the web server will be out of picture for all requests.



setWorkersConfig
public void setWorkersConfig(String path)(Code)
set a path to the workers.properties file. path String path to workers.properties file



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.