001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package javax.enterprise.deploy.spi;
023:
024: import javax.enterprise.deploy.model.DeployableObject;
025: import javax.enterprise.deploy.shared.DConfigBeanVersionType;
026: import javax.enterprise.deploy.shared.ModuleType;
027: import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException;
028: import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
029: import javax.enterprise.deploy.spi.exceptions.TargetException;
030: import javax.enterprise.deploy.spi.status.ProgressObject;
031: import java.io.File;
032: import java.io.InputStream;
033: import java.util.Locale;
034:
035: /**
036: * The DeploymentManager object provides the core set of functions a J2EE platform must provide for J2EE application deployment.
037: * It provides server related information, such as, a list of deployment targets, and vendor unique runtime configuration
038: * information.
039: *
040: * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
041: * @version $Revision: 57196 $
042: */
043: public interface DeploymentManager {
044: // Constants -----------------------------------------------------
045:
046: // Public --------------------------------------------------------
047:
048: /**
049: * Get the available targets
050: *
051: * @return the available targets
052: * @throws IllegalStateException when the manager is disconnected
053: */
054: Target[] getTargets() throws IllegalStateException;
055:
056: /**
057: * Get the running modules
058: *
059: * @param moduleType the module type
060: * @param targets the targets
061: * @return the target modules
062: * @throws TargetException an invalid target
063: * @throws IllegalStateException when the manager is disconnected
064: */
065: TargetModuleID[] getRunningModules(ModuleType moduleType,
066: Target[] targets) throws TargetException,
067: IllegalStateException;
068:
069: /**
070: * Get the non running modules
071: *
072: * @param moduleType the module type
073: * @param targets the targets
074: * @return the target modules
075: * @throws TargetException an invalid target
076: * @throws IllegalStateException when the manager is disconnected
077: */
078: TargetModuleID[] getNonRunningModules(ModuleType moduleType,
079: Target[] targets) throws TargetException,
080: IllegalStateException;
081:
082: /**
083: * Get the available modules both running and non running
084: *
085: * @param moduleType the module type
086: * @param targets the targets
087: * @return the target modules
088: * @throws TargetException an invalid target
089: * @throws IllegalStateException when the manager is disconnected
090: */
091: TargetModuleID[] getAvailableModules(ModuleType moduleType,
092: Target[] targets) throws TargetException,
093: IllegalStateException;
094:
095: /**
096: * Retrieve server specific configuration for a component
097: *
098: * @param obj the deployable component
099: * @return the configuration
100: * @throws InvalidModuleException when the module does not exist or is not supported
101: */
102: DeploymentConfiguration createConfiguration(DeployableObject obj)
103: throws InvalidModuleException;
104:
105: /**
106: * Validates the configuration, generates all container specific classes and moves the archive
107: * to the targets
108: *
109: * @param targets the targets
110: * @param moduleArchive the module archive
111: * @param deploymentPlan the runtime configuration
112: * @return the progress object
113: * @throws IllegalStateException when the manager is disconnected
114: */
115: ProgressObject distribute(Target[] targets, File moduleArchive,
116: File deploymentPlan) throws IllegalStateException;
117:
118: /**
119: * Validates the configuration, generates all container specific classes and moves the archive
120: * to the targets
121: *
122: * @param targets the targets
123: * @param moduleArchive the module archive
124: * @param deploymentPlan the runtime configuration
125: * @return the progress object
126: * @throws IllegalStateException when the manager is disconnected
127: */
128: ProgressObject distribute(Target[] targets,
129: InputStream moduleArchive, InputStream deploymentPlan)
130: throws IllegalStateException;
131:
132: /**
133: * Start the modules
134: *
135: * @param moduleIDList the list of modules
136: * @return the progress object
137: * @throws IllegalStateException when the manager is disconnected
138: */
139: ProgressObject start(TargetModuleID[] moduleIDList)
140: throws IllegalStateException;
141:
142: /**
143: * Stop the modules
144: *
145: * @param moduleIDList the list of modules
146: * @return the progress object
147: * @throws IllegalStateException when the manager is disconnected
148: */
149: ProgressObject stop(TargetModuleID[] moduleIDList)
150: throws IllegalStateException;
151:
152: /**
153: * Removes the modules
154: *
155: * @param moduleIDList the list of modules
156: * @return the progress object
157: * @throws IllegalStateException when the manager is disconnected
158: */
159: ProgressObject undeploy(TargetModuleID[] moduleIDList)
160: throws IllegalStateException;
161:
162: /**
163: * Is redeploy supported
164: *
165: * @return true when redeploy is supported, false otherwise
166: */
167: boolean isRedeploySupported();
168:
169: /**
170: * Redeploys the modules
171: *
172: * @param moduleIDList the list of modules
173: * @return the progress object
174: * @throws IllegalStateException when the manager is disconnected
175: * @throws UnsupportedOperationException when redeploy is not supported
176: */
177: ProgressObject redeploy(TargetModuleID[] moduleIDList,
178: File moduleArchive, File deploymentPlan)
179: throws UnsupportedOperationException, IllegalStateException;
180:
181: /**
182: * Redeploys the modules
183: *
184: * @param moduleIDList the list of modules
185: * @return the progress object
186: * @throws IllegalStateException when the manager is disconnected
187: * @throws UnsupportedOperationException when redeploy is not supported
188: */
189: ProgressObject redeploy(TargetModuleID[] moduleIDList,
190: InputStream moduleArchive, InputStream deploymentPlan)
191: throws UnsupportedOperationException, IllegalStateException;
192:
193: /**
194: * Release the deployment manager
195: */
196: void release();
197:
198: /**
199: * Get the default locale
200: *
201: * @return the default locale
202: */
203: Locale getDefaultLocale();
204:
205: /**
206: * Get the current local
207: *
208: * @return the current locale
209: */
210: Locale getCurrentLocale();
211:
212: /**
213: * Set the locale
214: *
215: * @param locale the new local
216: * @throws UnsupportedOperationException when the locale is not supported
217: */
218: void setLocale(Locale locale) throws UnsupportedOperationException;
219:
220: /**
221: * Get the supported locales
222: *
223: * @return the supported locales
224: */
225: Locale[] getSupportedLocales();
226:
227: /**
228: * Is the locale supported
229: *
230: * @param locale the locale
231: * @return true when supported, false otherwise
232: */
233: boolean isLocaleSupported(Locale locale);
234:
235: /**
236: * Get the J2EE platform version
237: *
238: * @return the version
239: */
240: DConfigBeanVersionType getDConfigBeanVersion();
241:
242: /**
243: * Test whether the version is supported
244: *
245: * @param version the version
246: * @return true when supported, false otherwise
247: */
248: boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version);
249:
250: /**
251: * Set the J2EE version
252: *
253: * @param version the version
254: * @throws UnsupportedOperationException when the version is not supported
255: */
256: void setDConfigBeanVersion(DConfigBeanVersionType version)
257: throws DConfigBeanVersionUnsupportedException;
258: }
|