KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployapi > config > SunDeploymentConfiguration


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 package com.sun.enterprise.deployapi.config;
25
26 import java.io.*;
27 import java.util.Iterator JavaDoc;
28
29 import javax.enterprise.deploy.spi.DeploymentConfiguration JavaDoc;
30 import javax.enterprise.deploy.model.DeployableObject JavaDoc;
31 import javax.enterprise.deploy.model.J2eeApplicationObject JavaDoc;
32 import javax.enterprise.deploy.model.DDBeanRoot JavaDoc;
33 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
34 import javax.enterprise.deploy.spi.DConfigBeanRoot JavaDoc;
35 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
36 import javax.enterprise.deploy.spi.exceptions.ConfigurationException JavaDoc;
37 import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException JavaDoc;
38
39 import com.sun.enterprise.deployapi.config.DConfigBeanRootFactoryImpl;
40 import com.sun.enterprise.util.LocalStringManagerImpl;
41
42 /**
43  * A container for all the server-specific configuration information for a
44  * single top-level J2EE module. The DeploymentConfiguration object could
45  * represent a single stand alone module or an EAR file that contains several
46  * sub-modules.
47  *
48  * @author Jerome Dochez
49  */

50 public class SunDeploymentConfiguration implements DeploymentConfiguration JavaDoc {
51     
52     private DeployableObject JavaDoc deployObject = null;
53     private DeploymentManager JavaDoc deploymentManager=null;
54     
55     protected static LocalStringManagerImpl localStrings =
56       new LocalStringManagerImpl(SunDeploymentConfiguration.class);
57     
58     /** Creates a new instance of SunDeploymentConfiguration */
59     public SunDeploymentConfiguration(DeployableObject JavaDoc deployObject) throws ConfigurationException JavaDoc {
60         this.deployObject = deployObject;
61     }
62         
63     /**
64      * Returns the top level configuration bean, DConfigBeanRoot,
65      * associated with the deployment descriptor represented by
66      * the designated DDBeanRoot bean.
67      *
68      * @param bean The top level bean that represents the
69      * associated deployment descriptor.
70      * @return the DConfigBeanRoot for editing the server-specific
71      * properties required by the module.
72      * @throws ConfigurationException reports errors in generating
73      * a configuration bean
74      */

75     public DConfigBeanRoot JavaDoc getDConfigBeanRoot(DDBeanRoot JavaDoc dDBeanRoot) throws ConfigurationException JavaDoc {
76         
77         return null;
78     }
79     
80     /**
81      * Returns an object that provides access to
82      * the deployment descriptor data and classes
83      * of a J2EE module.
84      * @return DeployableObject
85      */

86     public DeployableObject JavaDoc getDeployableObject() {
87         return deployObject;
88     }
89     
90     /**
91      * Remove the root DConfigBean and all its children.
92      *
93      * @param bean the top leve DConfigBean to remove.
94      * @throws BeanNotFoundException the bean provides is
95      * not in this beans child list.
96      */

97     public void removeDConfigBean(DConfigBeanRoot JavaDoc dConfigBeanRoot) throws BeanNotFoundException JavaDoc {
98     }
99     
100     /**
101      * Restore from disk to a full set of configuration beans previously
102      * stored.
103      * @param inputArchive The input stream from which to restore
104      * the Configuration.
105      * @throws ConfigurationException reports errors in generating
106      * a configuration bean
107      */

108     public void restore(InputStream inputStream) throws ConfigurationException JavaDoc {
109     }
110     
111     /**
112      * Restore from disk to instantated objects all the DConfigBeans
113      * associated with a specific deployment descriptor. The beans
114      * may be fully or partially configured.
115      * @param inputArchive The input stream for the file from which the
116      * DConfigBeans should be restored.
117      * @param bean The DDBeanRoot bean associated with the
118      * deployment descriptor file.
119      * @return The top most parent configuration bean, DConfigBeanRoot
120      * @throws ConfigurationException reports errors in generating
121      * a configuration bean
122      */

123     public DConfigBeanRoot JavaDoc restoreDConfigBean(InputStream inputStream, DDBeanRoot JavaDoc dDBeanRoot) throws ConfigurationException JavaDoc {
124         return null;
125     }
126     
127     /**
128      * Save to disk the current set configuration beans created for
129      * this deployable module.
130      * It is recommended the file format be XML.
131      *
132      * @param outputArchive The output stream to which to save the
133      * Configuration.
134      * @throws ConfigurationException
135      */

136     public void save(OutputStream outputStream) throws ConfigurationException JavaDoc {
137     }
138     
139     /**
140      * Save to disk all the configuration beans associated with
141      * a particular deployment descriptor file. The saved data
142      * may be fully or partially configured DConfigBeans. The
143      * output file format is recommended to be XML.
144      * @param outputArchive The output stream to which the DConfigBeans
145      * should be saved.
146      * @param bean The top level bean, DConfigBeanRoot, from which to be save.
147      * @throws ConfigurationException reports errors in generating
148      * a configuration bean
149      */

150     public void saveDConfigBean(OutputStream outputStream, DConfigBeanRoot JavaDoc dConfigBeanRoot) throws ConfigurationException JavaDoc {
151     }
152            
153     /**
154      * sets the deployment manager
155      */

156     public void setDeploymentManager(DeploymentManager JavaDoc deploymentManager) {
157         this.deploymentManager = deploymentManager;
158     }
159     
160     /**
161      * @return the deployment manager
162      */

163     public DeploymentManager JavaDoc getDeploymentManager() {
164         return deploymentManager;
165     }
166 }
167
Popular Tags