KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > ClusterDeployer


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.cluster;
18
19 /**
20  * A <b>ClusterDeployer</b> interface allows to plug in and out the
21  * different deployment implementations
22  *
23  * @author Filip Hanik
24  * @version $Revision: 1.4 $, $Date: 2004/11/27 21:10:20 $
25  */

26 import org.apache.catalina.LifecycleException;
27 import java.io.IOException JavaDoc;
28 import java.net.URL JavaDoc;
29
30 public interface ClusterDeployer extends MessageListener {
31     /**
32      * Descriptive information about this component implementation.
33      */

34     public String JavaDoc info = "ClusterDeployer/1.0";
35     /**
36      * Start the cluster deployer, the owning container will invoke this
37      * @throws Exception - if failure to start cluster
38      */

39     public void start() throws Exception JavaDoc;
40
41     /**
42      * Stops the cluster deployer, the owning container will invoke this
43      * @throws LifecycleException
44      */

45     public void stop() throws LifecycleException;
46
47     /**
48      * Sets the deployer for this cluster deployer to use.
49      * @param deployer Deployer
50      */

51     // FIXME
52
//public void setDeployer(Deployer deployer);
53

54     /**
55      * Install a new web application, whose web application archive is at the
56      * specified URL, into this container and all the other
57      * members of the cluster with the specified context path.
58      * A context path of "" (the empty string) should be used for the root
59      * application for this container. Otherwise, the context path must
60      * start with a slash.
61      * <p>
62      * If this application is successfully installed locally,
63      * a ContainerEvent of type
64      * <code>INSTALL_EVENT</code> will be sent to all registered listeners,
65      * with the newly created <code>Context</code> as an argument.
66      *
67      * @param contextPath The context path to which this application should
68      * be installed (must be unique)
69      * @param war A URL of type "jar:" that points to a WAR file, or type
70      * "file:" that points to an unpacked directory structure containing
71      * the web application to be installed
72      *
73      * @exception IllegalArgumentException if the specified context path
74      * is malformed (it must be "" or start with a slash)
75      * @exception IllegalStateException if the specified context path
76      * is already attached to an existing web application
77      * @exception IOException if an input/output error was encountered
78      * during installation
79      */

80     public void install(String JavaDoc contextPath, URL JavaDoc war) throws IOException JavaDoc;
81
82     /**
83      * Remove an existing web application, attached to the specified context
84      * path. If this application is successfully removed, a
85      * ContainerEvent of type <code>REMOVE_EVENT</code> will be sent to all
86      * registered listeners, with the removed <code>Context</code> as
87      * an argument. Deletes the web application war file and/or directory
88      * if they exist in the Host's appBase.
89      *
90      * @param contextPath The context path of the application to be removed
91      * @param undeploy boolean flag to remove web application from server
92      *
93      * @exception IllegalArgumentException if the specified context path
94      * is malformed (it must be "" or start with a slash)
95      * @exception IllegalArgumentException if the specified context path does
96      * not identify a currently installed web application
97      * @exception IOException if an input/output error occurs during
98      * removal
99      */

100     public void remove(String JavaDoc contextPath, boolean undeploy) throws IOException JavaDoc;
101
102     /**
103      * call from container Background Process
104      */

105     public void backgroundProcess();
106 }
107
Popular Tags