KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > enterprise > deploy > spi > DeploymentConfiguration


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Configurator.java
26  *
27  * Created on May 14, 2001, 4:25 PM
28  */

29
30 package javax.enterprise.deploy.spi;
31
32 import javax.enterprise.deploy.model.*;
33 import javax.enterprise.deploy.spi.exceptions.ConfigurationException JavaDoc;
34 import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException JavaDoc;
35 import java.io.InputStream JavaDoc;
36 import java.io.OutputStream JavaDoc;
37
38 /**
39  * An interface that defines a container for all the
40  * server-specific configuration information for a
41  * single top-level J2EE module. The DeploymentConfiguration
42  * object could represent a single stand alone module or an
43  * EAR file that contains several sub-modules.
44  *
45  * @author gfink
46  * @version 0.1
47  */

48 public interface DeploymentConfiguration {
49     
50     /**
51      * Returns an object that provides access to
52      * the deployment descriptor data and classes
53      * of a J2EE module.
54      * @return DeployableObject
55      */

56     public DeployableObject getDeployableObject();
57         
58     /**
59      * Returns the top level configuration bean, DConfigBeanRoot,
60      * associated with the deployment descriptor represented by
61      * the designated DDBeanRoot bean.
62      *
63      * @param bean The top level bean that represents the
64      * associated deployment descriptor.
65      * @return the DConfigBeanRoot for editing the server-specific
66      * properties required by the module.
67      * @throws ConfigurationException reports errors in generating
68      * a configuration bean
69      */

70     public DConfigBeanRoot JavaDoc getDConfigBeanRoot(DDBeanRoot bean)
71            throws ConfigurationException JavaDoc;
72     
73     /**
74      * Remove the root DConfigBean and all its children.
75      *
76      * @param bean the top leve DConfigBean to remove.
77      * @throws BeanNotFoundException the bean provides is
78      * not in this beans child list.
79      */

80     public void removeDConfigBean(DConfigBeanRoot JavaDoc bean)
81         throws BeanNotFoundException JavaDoc;
82
83     /**
84      * Restore from disk to instantated objects all the DConfigBeans
85      * associated with a specific deployment descriptor. The beans
86      * may be fully or partially configured.
87      * @param inputArchive The input stream for the file from which the
88      * DConfigBeans should be restored.
89      * @param bean The DDBeanRoot bean associated with the
90      * deployment descriptor file.
91      * @return The top most parent configuration bean, DConfigBeanRoot
92      * @throws ConfigurationException reports errors in generating
93      * a configuration bean
94      */

95     public DConfigBeanRoot JavaDoc restoreDConfigBean(InputStream JavaDoc inputArchive,
96            DDBeanRoot bean) throws ConfigurationException JavaDoc;
97     
98     /**
99      * Save to disk all the configuration beans associated with
100      * a particular deployment descriptor file. The saved data
101      * may be fully or partially configured DConfigBeans. The
102      * output file format is recommended to be XML.
103      * @param outputArchive The output stream to which the DConfigBeans
104      * should be saved.
105      * @param bean The top level bean, DConfigBeanRoot, from which to be save.
106      * @throws ConfigurationException reports errors in generating
107      * a configuration bean
108      */

109     public void saveDConfigBean(OutputStream JavaDoc outputArchive,DConfigBeanRoot JavaDoc bean)
110             throws ConfigurationException JavaDoc;
111     
112     /**
113      * Restore from disk to a full set of configuration beans previously
114      * stored.
115      * @param inputArchive The input stream from which to restore
116      * the Configuration.
117      * @throws ConfigurationException reports errors in generating
118      * a configuration bean
119      */

120      public void restore(InputStream JavaDoc inputArchive) throws
121             ConfigurationException JavaDoc;
122     
123     /**
124      * Save to disk the current set configuration beans created for
125      * this deployable module.
126      * It is recommended the file format be XML.
127      *
128      * @param outputArchive The output stream to which to save the
129      * Configuration.
130      * @throws ConfigurationException
131      */

132     public void save(OutputStream JavaDoc outputArchive) throws
133             ConfigurationException JavaDoc;
134     
135 }
136
137
Popular Tags