001: /*
002: * Copyright (c) 1998-2004 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package javax.enterprise.deploy.spi;
031:
032: import javax.enterprise.deploy.model.DeployableObject;
033: import javax.enterprise.deploy.shared.DConfigBeanVersionType;
034: import javax.enterprise.deploy.shared.ModuleType;
035: import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException;
036: import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
037: import javax.enterprise.deploy.spi.exceptions.TargetException;
038: import javax.enterprise.deploy.spi.status.ProgressObject;
039: import java.io.File;
040: import java.io.InputStream;
041: import java.io.IOException;
042: import java.util.Locale;
043:
044: /**
045: * Manager for the deployments.
046: */
047: public interface DeploymentManager {
048: /**
049: * Returns the targets supported by the manager.
050: */
051: public Target[] getTargets() throws IllegalStateException;
052:
053: /**
054: * Returns the current running modules.
055: */
056: public TargetModuleID[] getRunningModules(ModuleType moduleType,
057: Target[] targetList) throws TargetException,
058: IllegalStateException;
059:
060: /**
061: * Returns the current non-running modules.
062: */
063: public TargetModuleID[] getNonRunningModules(ModuleType moduleType,
064: Target[] targetList) throws TargetException,
065: IllegalStateException;
066:
067: /**
068: * Returns all available modules.
069: */
070: public TargetModuleID[] getAvailableModules(ModuleType moduleType,
071: Target[] targetList) throws TargetException,
072: IllegalStateException, IOException;
073:
074: /**
075: * Returns a configuration for the deployable object.
076: */
077: public DeploymentConfiguration createConfiguration(
078: DeployableObject dObj) throws InvalidModuleException;
079:
080: /**
081: * Deploys the object.
082: */
083: public ProgressObject distribute(Target[] targetList, File archive,
084: File deploymentPlan) throws IllegalStateException;
085:
086: /**
087: * Deploys the object.
088: * @Deprecated
089: */
090: public ProgressObject distribute(Target[] targetList,
091: InputStream archive, InputStream deploymentPlan)
092: throws IllegalStateException;
093:
094: /**
095: * Deploys the object.
096: */
097: public ProgressObject distribute(Target[] targetList,
098: ModuleType type, InputStream archive,
099: InputStream deploymentPlan) throws IllegalStateException;
100:
101: /**
102: * Starts the modules.
103: */
104: public ProgressObject start(TargetModuleID[] moduleIDList)
105: throws IllegalStateException;
106:
107: /**
108: * Stops the modules.
109: */
110: public ProgressObject stop(TargetModuleID[] moduleIDList)
111: throws IllegalStateException;
112:
113: /**
114: * Undeploys the modules.
115: */
116: public ProgressObject undeploy(TargetModuleID[] moduleIDList)
117: throws IllegalStateException;
118:
119: /**
120: * Returns true if the redeploy is supported.
121: */
122: public boolean isRedeploySupported();
123:
124: /**
125: * Redeploys the object.
126: */
127: public ProgressObject redeploy(TargetModuleID[] targetList,
128: File archive, File deploymentPlan)
129: throws IllegalStateException;
130:
131: /**
132: * Redeploys the object.
133: */
134: public ProgressObject redeploy(TargetModuleID[] targetList,
135: InputStream archive, InputStream deploymentPlan)
136: throws IllegalStateException;
137:
138: /**
139: * Frees any resources.
140: */
141: public void release();
142:
143: /**
144: * Returns the default locale.
145: */
146: public Locale getDefaultLocale();
147:
148: /**
149: * Returns the current locale.
150: */
151: public Locale getCurrentLocale();
152:
153: /**
154: * Sets the default locale.
155: */
156: public void setLocale(Locale locale);
157:
158: /**
159: * Returns the supported locales.
160: */
161: public Locale[] getSupportedLocales();
162:
163: /**
164: * Returns true if the locale is supported.
165: */
166: public boolean isLocaleSupported(Locale locale);
167:
168: /**
169: * Returns the bean's J2EE version.
170: */
171: public DConfigBeanVersionType getDConfigBeanVersion();
172:
173: /**
174: * Returns true if the given version is supported.
175: */
176: public boolean isDConfigBeanVersionSupported(
177: DConfigBeanVersionType version);
178:
179: /**
180: * Sets true if the given version is supported.
181: */
182: public void setDConfigBeanVersionSupported(
183: DConfigBeanVersionType version)
184: throws DConfigBeanVersionUnsupportedException;
185: }
|