µ±Ç°Î»ÖÃ: > Linux·þÎñÆ÷ > Tomcat >

Tomcatѧϰ֮Container

ʱ¼ä:2014-12-30 13:21À´Ô´:linux.it.net.cn ×÷Õß:IT

ÈÝÆ÷Ö÷Òª¸ºÔð´¦ÀíÀ´×Ô¿Í»§¶ËµÄÇëÇ󣬲¢°ÑÏìÓ¦½á¹û·µ»Ø¸ø¿Í»§¶Ë¡£Ç°ÃæÌáµ½Ò»¸öServiceÊÇÓÉÒ»¸öÈÝÆ÷ºÍ¶à¸öÁ¬½ÓÆ÷×é³ÉµÄ£¬½Ó¿Úorg.apache.catalina.ContainerÊǶÔÈÝÆ÷µÄ³éÏó£¬À´¿´¿´Õâ¸ö½Ó¿ÚÖж¼ÓÐÄÄЩ·½·¨£¿

1¡¢ÓëÈÝÆ÷²ã´Î½á¹¹Óйصķ½·¨

 

[html] view plaincopyprint?
 
  1. public Container getParent();  
  2. public void setParent(Container container);  
  3. public ClassLoader getParentClassLoader();  
  4. public void setParentClassLoader(ClassLoader parent);  
  5. public void addChild(Container child);  
  6. public void removeChild(Container child);  
  7. public Container findChild(String name);  
  8. public Container[] findChildren();  

¿ÉÒÔΪһ¸öÈÝÆ÷Ìí¼Ó×ÓÈÝÆ÷£¬¿ÉÒÔ²éÕÒÈÝÆ÷µÈ¡£ÆäÖÐsetParentºÍaddChild·½·¨Òª×¢ÒâÒ»µã£¬Èç¹ûÁ½¸öÈÝÆ÷²»ÔÊÐíÓи¸×Ó¹Øϵ£¬»áÅ׳öÒì³£¡£

2¡¢Óëºǫ́´¦ÀíÓйصķ½·¨

 

[html] view plaincopyprint?
  1. public int getBackgroundProcessorDelay();  
  2. public void setBackgroundProcessorDelay(int delay);  
  3. public void backgroundProcess();  
delayÊÇÒ»¸öÕûÐÎÖµ£¬ÓÃÓÚ±íʾµ±Ç°ÈÝÆ÷µ÷ÓÃbackgroundProcess¼°Æä×ÓÈÝÆ÷µ÷ÓÃbackgroundProcessµÄʱ¼ä¼ä¸ô£¬backgroundProcess·½·¨Ö÷Òª×öÁËÒÔÏÂÊ£º

 

(1)¼ì²éWAR°üÓÐûÓб仯

(2)ÖØмÓÔØwebÓ¦ÓÃ

(3)Çå³ýÒѹýÆÚµÄsession

(4)ˢлº³åÇøµÈ

3¡¢Óë×é¼þÓйصķ½·¨

 

[html] view plaincopyprint?
 
  1. public Cluster getCluster();  
  2. public void setCluster(Cluster cluster);  
  3. public Pipeline getPipeline();  
  4. public Realm getRealm();  
  5. public void setRealm(Realm realm);  
  6. public DirContext getResources();  
  7. public void setResources(DirContext resources);  
  8. public Manager getManager();  
  9. public void setManager(Manager manager);  
  10. public Log getLogger();  
  11. public AccessLog getAccessLog();  
ÈÝÆ÷¿ÉÒÔÑ¡ÔñÐÔµØÌí¼ÓһЩ×é¼þ£¬±ÈÈ磺ÈÕÖ¾¡¢°²È«¼ì²é¡¢¼¯Èº¡¢session¹ÜÀíµÈ!

ContainerBaseÊÇContainer³éÏóÀàʵÏÖ£¬Èç¹ûÒª¼Ì³ÐContainerBaseÐèҪʵÏÖgetObjectNameKeyProperties·½·¨£¬Õâ¸ö·½·¨·µ»ØÒ»¸ö´ú±í¸ÃÈÝÆ÷µÄ×Ö·û´®£¬ÔÚ×¢²áÈÝÆ÷µÄʱºò»áÓõ½¡£

TomcatÒ»¹²ÓÐËÄÖÖÀàÐ͵ÄÈÝÆ÷£º

Engine:´ú±íÍêÕûµÄServletÒýÇ棬ÊÇ×²ãµÄÈÝÆ÷£¬ÔÚÕâ¸öÈÝÆ÷Éϵ÷ÓÃsetParent»áÅ׳öÒì³£¡£Ò»¸öEngineÓɶà¸öHostÈÝÆ÷×é³É¡£

Host:´ú±íÒ»¸öÐéÄâÖ÷»ú£¬¿ÉÒÔÔËÐжà¸öÓ¦Óã¬Ëü¸ºÔð°²×°ºÍÕ¹¿ªÕâЩӦÓã¬Æä×ÓÈÝÆ÷ΪContext¡£

Context:´ú±íServletContext£¬¹ÜÀí¶à¸öServlet£¬ÀíÂÛÉÏÖ»ÒªÓÐContext¾Í¿ÉÒÔÔËÐÐServletÁË£¬Æä×ÓÈÝÆ÷ΪWrapper¡£

Wrapper:´ú±íÒ»¸öServlet£¬ÊÇ×îµ×²¿µÄÈÝÆ÷£¬ËüûÓÐ×ÓÈÝÆ÷¡£Ëü¸ºÔð¹ÜÀíÒ»¸öServlet£¬°üº¬ServletµÄ×°ÔØ¡¢³õʼ»¯¡¢Ö´ÐкÍжÔصȡ£Ö»ÓÐWrapperÒ²ÊÇ¿ÉÒÔÔËÐÐServletµÄ!

ÀàͼÈçÏ£º

ÿ¸öÈÝÆ÷µÄ¾ßÌåϸ½ÚºóÐø½éÉÜ......

 
(ÔðÈα༭£ºIT)
------·Ö¸ôÏß----------------------------
À¸Ä¿Áбí
ÍƼöÄÚÈÝ