Java Doc for FarmWarDeployer.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » ha » deploy » 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 » apache tomcat 6.0.14 » org.apache.catalina.ha.deploy 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.ha.ClusterListener
      org.apache.catalina.ha.deploy.FarmWarDeployer

FarmWarDeployer
public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,FileChangeListener(Code)

A farm war deployer is a class that is able to deploy/undeploy web applications in WAR form within the cluster.

Any host can act as the admin, and will have three directories
  • deployDir - the directory where we watch for changes
  • applicationDir - the directory where we install applications
  • tempDir - a temporaryDirectory to store binary data when downloading a war from the cluster
Currently we only support deployment of WAR files since they are easier to send across the wire.
author:
   Filip Hanik
author:
   Peter Rossbach
version:
   $Revision: 516438 $


Field Summary
protected  FileappBase
     The host appBase.
protected  CatalinaClustercluster
    
protected  FileconfigBase
     Path where context descriptors should be deployed.
protected  StringdeployDir
    
protected  HashMapfileFactories
    
protected  Hosthost
     The associated host.
public static  org.apache.juli.logging.Loglog
    
protected  MBeanServermBeanServer
     MBean server.
protected  ObjectNameoname
     The associated deployer ObjectName.
protected  intprocessDeployFrequency
     Frequency of the Farm watchDir check.
protected  booleanstarted
    
protected  StringtempDir
    
protected  StringwatchDir
    
protected  booleanwatchEnabled
    
protected  WarWatcherwatcher
    

Constructor Summary
public  FarmWarDeployer()
    

Method Summary
public  booleanaccept(ClusterMessage msg)
     Before the cluster invokes messageReceived the cluster will ask the receiver to accept or decline the message, In the future, when messages get big, the accept method will only take a message header
Parameters:
  msg - ClusterMessage boolean - returns true to indicate that messageReceived should beinvoked.
protected  voidaddServiced(String name)
     Invoke the check method on the deployer.
public  voidbackgroundProcess()
    
protected  voidcheck(String name)
     Invoke the check method on the deployer.
public  voidcleanDeployDir()
    
protected  booleancopy(File from, File to)
     Copy a file to the specified temp directory.
public  booleanequals(Object listener)
    
public  voidfileModified(File newWar)
    
public  voidfileRemoved(File removeWar)
    
protected  FilegetAppBase()
     Return a File object representing the "application root" directory for our associated Host.
public  CatalinaClustergetCluster()
    
protected  StringgetConfigFile(String path)
     Given a context path, get the config file name.
protected  StringgetContextName(File war)
    
public  StringgetDeployDir()
    
protected  StringgetDocBase(String path)
     Given a context path, get the config file name.
public synchronized  FileMessageFactorygetFactory(FileMessage msg)
    
public  StringgetInfo()
     Return descriptive information about this deployer implementation and the corresponding version number, in the format <description>/<version>.
public  intgetProcessDeployFrequency()
     Return the frequency of watcher checks.
public  StringgetTempDir()
    
public  StringgetWatchDir()
    
public  booleangetWatchEnabled()
    
public  inthashCode()
    
public  voidinstall(String contextPath, URL war)
     Install a new web application, whose web application archive is at the specified URL, into this container and all the other members of the cluster with the specified context path.
protected  booleanisServiced(String name)
     Invoke the check method on the deployer.
public  booleanisWatchEnabled()
    
public  voidmessageReceived(ClusterMessage msg)
     Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.
public  voidremove(String contextPath, boolean undeploy)
     Remove an existing web application, attached to the specified context path.
protected  voidremove(String path)
     Invoke the remove method on the deployer.
public  voidremoveFactory(FileMessage msg)
    
protected  voidremoveServiced(String name)
     Invoke the check method on the deployer.
public  voidsetCluster(CatalinaCluster cluster)
    
public  voidsetDeployDir(String deployDir)
    
public  voidsetProcessDeployFrequency(int processExpiresFrequency)
     Set the watcher checks frequency.
public  voidsetTempDir(String tempDir)
    
public  voidsetWatchDir(String watchDir)
    
public  voidsetWatchEnabled(boolean watchEnabled)
    
public  voidstart()
    
public  voidstop()
    
protected  voidundeployDir(File dir)
     Delete the specified directory, including all of its contents and subdirectories recursively.

Field Detail
appBase
protected File appBase(Code)
The host appBase.



cluster
protected CatalinaCluster cluster(Code)



configBase
protected File configBase(Code)
Path where context descriptors should be deployed.



deployDir
protected String deployDir(Code)



fileFactories
protected HashMap fileFactories(Code)



host
protected Host host(Code)
The associated host.



log
public static org.apache.juli.logging.Log log(Code)



mBeanServer
protected MBeanServer mBeanServer(Code)
MBean server.



oname
protected ObjectName oname(Code)
The associated deployer ObjectName.



processDeployFrequency
protected int processDeployFrequency(Code)
Frequency of the Farm watchDir check. Cluster wide deployment will be done once for the specified amount of backgrondProcess calls (ie, the lower the amount, the most often the checks will occur).



started
protected boolean started(Code)



tempDir
protected String tempDir(Code)



watchDir
protected String watchDir(Code)



watchEnabled
protected boolean watchEnabled(Code)



watcher
protected WarWatcher watcher(Code)




Constructor Detail
FarmWarDeployer
public FarmWarDeployer()(Code)




Method Detail
accept
public boolean accept(ClusterMessage msg)(Code)
Before the cluster invokes messageReceived the cluster will ask the receiver to accept or decline the message, In the future, when messages get big, the accept method will only take a message header
Parameters:
  msg - ClusterMessage boolean - returns true to indicate that messageReceived should beinvoked. If false is returned, the messageReceived method willnot be invoked.



addServiced
protected void addServiced(String name) throws Exception(Code)
Invoke the check method on the deployer.



backgroundProcess
public void backgroundProcess()(Code)



check
protected void check(String name) throws Exception(Code)
Invoke the check method on the deployer.



cleanDeployDir
public void cleanDeployDir()(Code)



copy
protected boolean copy(File from, File to)(Code)
Copy a file to the specified temp directory.
Parameters:
  from - copy from temp
Parameters:
  to - to host appBase directory true, copy successful



equals
public boolean equals(Object listener)(Code)



fileModified
public void fileModified(File newWar)(Code)



fileRemoved
public void fileRemoved(File removeWar)(Code)



getAppBase
protected File getAppBase()(Code)
Return a File object representing the "application root" directory for our associated Host.



getCluster
public CatalinaCluster getCluster()(Code)



getConfigFile
protected String getConfigFile(String path)(Code)
Given a context path, get the config file name.



getContextName
protected String getContextName(File war)(Code)
Create a context path from war
Parameters:
  war - War filename '/filename' or if war name is ROOT.war context name is empty string ''



getDeployDir
public String getDeployDir()(Code)



getDocBase
protected String getDocBase(String path)(Code)
Given a context path, get the config file name.



getFactory
public synchronized FileMessageFactory getFactory(FileMessage msg) throws java.io.FileNotFoundException, java.io.IOException(Code)
create factory for all transported war files
Parameters:
  msg - Factory for all app message (war files)
throws:
  java.io.FileNotFoundException -
throws:
  java.io.IOException -



getInfo
public String getInfo()(Code)
Return descriptive information about this deployer implementation and the corresponding version number, in the format <description>/<version>.



getProcessDeployFrequency
public int getProcessDeployFrequency()(Code)
Return the frequency of watcher checks.



getTempDir
public String getTempDir()(Code)



getWatchDir
public String getWatchDir()(Code)



getWatchEnabled
public boolean getWatchEnabled()(Code)



hashCode
public int hashCode()(Code)



install
public void install(String contextPath, URL war) throws IOException(Code)
Install a new web application, whose web application archive is at the specified URL, into this container and all the other members of the cluster with the specified context path. A context path of "" (the empty string) should be used for the root application for this container. Otherwise, the context path must start with a slash.

If this application is successfully installed locally, a ContainerEvent of type INSTALL_EVENT will be sent to all registered listeners, with the newly created Context as an argument.
Parameters:
  contextPath - The context path to which this application should be installed(must be unique)
Parameters:
  war - A URL of type "jar:" that points to a WAR file, or type"file:" that points to an unpacked directory structurecontaining the web application to be installed
exception:
  IllegalArgumentException - if the specified context path is malformed (it must be ""or start with a slash)
exception:
  IllegalStateException - if the specified context path is already attached to anexisting web application
exception:
  IOException - if an input/output error was encountered duringinstallation




isServiced
protected boolean isServiced(String name) throws Exception(Code)
Invoke the check method on the deployer.



isWatchEnabled
public boolean isWatchEnabled()(Code)



messageReceived
public void messageReceived(ClusterMessage msg)(Code)
Callback from the cluster, when a message is received, The cluster will broadcast it invoking the messageReceived on the receiver.
Parameters:
  msg - ClusterMessage - the message received from the cluster



remove
public void remove(String contextPath, boolean undeploy) throws IOException(Code)
Remove an existing web application, attached to the specified context path. If this application is successfully removed, a ContainerEvent of type REMOVE_EVENT will be sent to all registered listeners, with the removed Context as an argument. Deletes the web application war file and/or directory if they exist in the Host's appBase.
Parameters:
  contextPath - The context path of the application to be removed
Parameters:
  undeploy - boolean flag to remove web application from server
exception:
  IllegalArgumentException - if the specified context path is malformed (it must be ""or start with a slash)
exception:
  IllegalArgumentException - if the specified context path does not identify acurrently installed web application
exception:
  IOException - if an input/output error occurs during removal



remove
protected void remove(String path) throws Exception(Code)
Invoke the remove method on the deployer.



removeFactory
public void removeFactory(FileMessage msg)(Code)
Remove file (war) from messages)
Parameters:
  msg -



removeServiced
protected void removeServiced(String name) throws Exception(Code)
Invoke the check method on the deployer.



setCluster
public void setCluster(CatalinaCluster cluster)(Code)



setDeployDir
public void setDeployDir(String deployDir)(Code)



setProcessDeployFrequency
public void setProcessDeployFrequency(int processExpiresFrequency)(Code)
Set the watcher checks frequency.
Parameters:
  processExpiresFrequency - the new manager checks frequency



setTempDir
public void setTempDir(String tempDir)(Code)



setWatchDir
public void setWatchDir(String watchDir)(Code)



setWatchEnabled
public void setWatchEnabled(boolean watchEnabled)(Code)



start
public void start() throws Exception(Code)



stop
public void stop() throws LifecycleException(Code)



undeployDir
protected void undeployDir(File dir)(Code)
Delete the specified directory, including all of its contents and subdirectories recursively.
Parameters:
  dir - File object representing the directory to be deleted



Fields inherited from org.apache.catalina.ha.ClusterListener
protected CatalinaCluster cluster(Code)(Java Doc)
public static org.apache.juli.logging.Log log(Code)(Java Doc)
protected StringManager sm(Code)(Java Doc)

Methods inherited from org.apache.catalina.ha.ClusterListener
final public boolean accept(Serializable msg, Member member)(Code)(Java Doc)
abstract public boolean accept(ClusterMessage msg)(Code)(Java Doc)
public boolean equals(Object listener)(Code)(Java Doc)
public CatalinaCluster getCluster()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void messageReceived(Serializable msg, Member member)(Code)(Java Doc)
abstract public void messageReceived(ClusterMessage msg)(Code)(Java Doc)
public void setCluster(CatalinaCluster cluster)(Code)(Java Doc)

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.