Thread: [Ejtools-cvs] CVS: libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi JBoss30DConfigB
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-01 18:45:32
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/main/org/jboss/enterprise/deploy/spi Added Files: JBoss30DConfigBean.java JBoss30DConfigBeanRoot.java JBoss30DeploymentConfiguration.java JBoss30DeploymentManager.java JBoss30Target.java JBoss30TargetModuleID.java Log Message: Initial Import --- NEW FILE: JBoss30DConfigBean.java --- package org.jboss.enterprise.deploy.spi; import java.beans.PropertyChangeListener; import javax.enterprise.deploy.model.*; import javax.enterprise.deploy.spi.DConfigBean; import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException; import javax.enterprise.deploy.spi.exceptions.ConfigurationException; /** * The interface for configuring a server-specific deployment * descriptor, or subset of same. A DConfigBean corresponds * to a specific location in a standard deployment * descriptor, typically where values (such as names * and roles) are used. * * <p> * There are three different ways that DConfigBeans are created: * <ul> * <LI> <CODE>DeploymentConfigurator.getDConfigBean(DDBeanRoot)</CODE> * is called by the deployment tool to create a DConfigBeanRoot for each * deployment descriptor in the J2EE application. * </li> * <li> <CODE>DConfigBean.getDConfigBean(DDBean)</CODE> is called * by the deployment tool for each DDBean that corresponds to * a relative XPath pattern given to the deployment tool by the method * <CODE>DConfigBean.getXpaths().</CODE> * </li> * <li> Each DConfigBean can structure its configurations as a tree-structure * of DConfigBeans; a DConfigBean can have properties of type DConfigBean * or DConfigBean[]. * </li> * </ul> * * <p> * The properties of DConfigBeans are displayed and edited by the * deployment tool by using the JavaBean Property classes. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30DConfigBean implements DConfigBean { /** * Return the JavaBean containing the deployment * descriptor XML text associated with this DConfigBean. * * @return The bean class containing the XML text for * this DConfigBean. */ public DDBean getDDBean() { return null; } /** * Return a list of XPaths designating the deployment descriptor * information this DConfigBean requires. * * A given server vendor will need to specify some server-specific * information. Each String returned by this method is an XPath * describing a certain portion of the standard deployment descriptor * for which there is corresponding server-specific configuration. * * @return a list of XPath Strings representing XML data to be retrieved * or 'null' if there are none. */ public String[] getXpaths() { return null; } /** * Return the JavaBean containing the server-specific deployment * configuration information based upon the XML data provided * by the DDBean. * * @param bean The DDBean containing the XML data to be * evaluated. * @return The DConfigBean to display the server-specific properties * for the standard bean. * @throws ConfigurationException reports errors in generating * a configuration bean. This DDBean is considered * undeployable to this server until this exception * is resolved. * A suitably descriptive message is required so the user * can diagnose the error. */ public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException { return null; } /** * Remove a child DConfigBean from this bean. * * @param bean The child DConfigBean to be removed. * @throws BeanNotFoundException the bean provided * is not in the child list of this bean. */ public void removeDConfigBean(DConfigBean bean) throws BeanNotFoundException { } /** * A notification that the DDBean provided in the * event has changed and this bean or its child beans need * to reevaluate themselves. * * @param event an event containing a reference to the * DDBean which has changed. */ public void notifyDDChange(XpathEvent event) { } /** * Register a property listener for this bean. * * @param pcl PropertyChangeListener to add */ public void addPropertyChangeListener(PropertyChangeListener pcl) { } /** * Unregister a property listener for this bean. * * @param pcl Listener to remove. */ public void removePropertyChangeListener(PropertyChangeListener pcl) { } } --- NEW FILE: JBoss30DConfigBeanRoot.java --- package org.jboss.enterprise.deploy.spi; /** * The DConfigBeanRoot interface represent the root of a * deployment descriptor. A DConfigBeanRoot is associated * with a DDRoot object which in turn is associated * with a specific deployment descriptor file. * * <p> Only DConfigBeanRoots are saved or restored by methods * in DeploymentConfigurator. * * @author gfink * @created 15 avril 2002 * @version */ public class JBoss30DConfigBeanRoot extends JBoss30DConfigBean { } --- NEW FILE: JBoss30DeploymentConfiguration.java --- package org.jboss.enterprise.deploy.spi; import java.io.InputStream; import java.io.OutputStream; import javax.enterprise.deploy.model.*; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.spi.DeploymentConfiguration; import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException; import javax.enterprise.deploy.spi.exceptions.ConfigurationException; /** * An interface that defines a container for all the * server-specific configuration information for a * single top-level J2EE module. The DeploymentConfiguration * object could represent a single stand alone module or an * EAR file that contains several sub-modules. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30DeploymentConfiguration implements DeploymentConfiguration { /** * Returns an object that provides access to * the deployment descriptor data and classes * of a J2EE module. * * @return DeployableObject */ public DeployableObject getDeployableObject() { return null; } /** * Returns the top level configuration bean, DConfigBeanRoot, * associated with the deployment descriptor represented by * the designated DDBeanRoot bean. * * @param bean The top level bean that represents the * associated deployment descriptor. * @return the DConfigBeanRoot for editing the server-specific * properties required by the module. * @throws ConfigurationException reports errors in generating * a configuration bean */ public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean) throws ConfigurationException { return null; } /** * Remove the root DConfigBean and all its children. * * @param bean the top leve DConfigBean to remove. * @throws BeanNotFoundException the bean provides is * not in this beans child list. */ public void removeDConfigBean(DConfigBeanRoot bean) throws BeanNotFoundException { } /** * Restore from disk to instantated objects all the DConfigBeans * associated with a specific deployment descriptor. The beans * may be fully or partially configured. * * @param inputArchive The input stream for the file from which the * DConfigBeans should be restored. * @param bean The DDBeanRoot bean associated with the * deployment descriptor file. * @return The top most parent configuration bean, DConfigBeanRoot * @throws ConfigurationException reports errors in generating * a configuration bean */ public DConfigBeanRoot restoreDConfigBean(InputStream inputArchive, DDBeanRoot bean) throws ConfigurationException { return null; } /** * Save to disk all the configuration beans associated with * a particular deployment descriptor file. The saved data * may be fully or partially configured DConfigBeans. The * output file format is recommended to be XML. * * @param outputArchive The output stream to which the DConfigBeans * should be saved. * @param bean The top level bean, DConfigBeanRoot, from which to be save. * @throws ConfigurationException reports errors in generating * a configuration bean */ public void saveDConfigBean(OutputStream outputArchive, DConfigBeanRoot bean) throws ConfigurationException { } /** * Restore from disk to a full set of configuration beans previously * stored. * * @param inputArchive The input stream from which to restore * the Configuration. * @throws ConfigurationException reports errors in generating * a configuration bean */ public void restore(InputStream inputArchive) throws ConfigurationException { } /** * Save to disk the current set configuration beans created for * this deployable module. * It is recommended the file format be XML. * * @param outputArchive The output stream to which to save the * Configuration. * @throws ConfigurationException */ public void save(OutputStream outputArchive) throws ConfigurationException { } } --- NEW FILE: JBoss30DeploymentManager.java --- package org.jboss.enterprise.deploy.spi; import java.io.File; import java.io.InputStream; import java.util.Locale; import javax.enterprise.deploy.model.DeployableObject; import javax.enterprise.deploy.shared.DConfigBeanVersionType; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.spi.exceptions.*; import javax.enterprise.deploy.spi.status.*; /** * The DeploymentManager object provides the core set of functions a J2EE * platform must provide for J2EE application deployment. It provides server * related information, such as, a list of deployment targets, and vendor * unique runtime configuration information. * * @author laurent * @created 31 mars 2002 */ public class JBoss30DeploymentManager implements DeploymentManager { /** Description of the Field */ protected Locale[] supportedLocale = new Locale[]{ new Locale("en", "UK"), new Locale("fr", "FR") }; /** Description of the Field */ protected boolean connected; /** Description of the Field */ protected Locale currentLocale; protected DConfigBeanVersionType versionType = DConfigBeanVersionType.V1_3_1; /** *Constructor for the DeploymentManagerImpl object * * @param uri Description of Parameter */ public JBoss30DeploymentManager(String uri) { // Assumes it is disconnected connected = false; } /** *Constructor for the DeploymentManagerImpl object * * @param uri Description of Parameter * @param username Description of Parameter * @param password Description of Parameter */ public JBoss30DeploymentManager(String uri, String username, String password) { // Assumes it is connected connected = true; } /** * Set the active locale for this implementation of * javax.enterprise.deploy.spi subpackages to run. * * @param locale The new value * @throws UnsupportedOperationException the provide locale is not * supported. */ public void setLocale(Locale locale) throws UnsupportedOperationException { if (isLocaleSupported(locale)){ currentLocale = locale; } } /** * Set the configuration beans to be used to the J2EE platform version * specificed. * * @param version a DConfigBeanVersionType * object representing the J2EE platform version for which support is * requested. * @throws DConfigBeanVersionUnsupportedException when the requested bean * version is not supported. */ public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException { if (false) { throw new DConfigBeanVersionUnsupportedException(""); } versionType = version; } /** * Retrieve the list of deployment targets supported by this * DeploymentManager. * * @return A list of deployment Target designators * the user may select for application deployment or 'null' if there are * none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public Target[] getTargets() throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getTargets"); } // TODO // Use JSR77 connection to get the targets return null; } /** * Retrieve the list of J2EE application modules distributed to the * identified targets and that are currently running on the associated * server or servers. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module run status. * @return An array of TargetModuleID objects * representing the running modules or 'null' if there are none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getRunningModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * Retrieve the list of J2EE application modules distributed to the * identified targets and that are currently not running on the associated * server or servers. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module not running status. * @return An array of TargetModuleID objects * representing the non-running modules or 'null' if there are none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getNonRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getNonRunningModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * Retrieve the list of all J2EE application modules running or not running * on the identified targets. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module not running status. * @return An array of TargetModuleID objects * representing all deployed modules running or not or 'null' if there * are no deployed modules. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getAvailableModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getAvailableModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * This method designates whether this platform vendor provides application * redeployment functionality. A value of true means it is supported. False * means it is not. * * @return A value of true means redeployment is supported by this * vendor's DeploymentManager. False means it is not. */ public boolean isRedeploySupported() { return true; } /** * Returns the default locale supported by this implementation of * javax.enterprise.deploy.spi subpackages. * * @return Locale the default locale for this implementation. */ public Locale getDefaultLocale() { return supportedLocale[0]; } /** * Returns the active locale this implementation of * javax.enterprise.deploy.spi subpackages is running. * * @return Locale the active locale of this implementation. */ public Locale getCurrentLocale() { return currentLocale; } /** * Returns an array of supported locales for this implementation. * * @return Locale[] the list of supported locales. */ public Locale[] getSupportedLocales() { return supportedLocale; } /** * Reports if this implementation supports the designated locale. * * @param locale Description of Parameter * @return A value of 'true' means it is support and 'false' it is * not. */ public boolean isLocaleSupported(Locale locale) { for (int i = 0; i < supportedLocale.length; i++) { if (supportedLocale[i].equals(locale)) { return true; } } return true; } /** * Returns the J2EE platform version number for which the configuration * beans are provided. The beans must have been compiled with the J2SE * version required by the J2EE platform. * * @return a DConfigBeanVersionType object representing the platform * version number for which these beans are provided. */ public DConfigBeanVersionType getDConfigBeanVersion() { return versionType; } /** * Returns 'true' if the configuration beans support the J2EE platform * version specified. It returns 'false' if the version is not supported. * * @param version a DConfigBeanVersionType object representing the J2EE * platform version for which support is requested. * @return 'true' if the version is supported and 'false if not. */ public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version) { return true; } /** * Retrieve the object that provides server-specific deployment * configuration information for the J2EE deployable component. * * @param dObj An object representing a J2EE deployable * component. * @return Description of the Returned Value * @throws InvalidModuleException The DeployableObject is an unknown or * unsupport component for this configuration tool. */ public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException { return null; } /** * The distribute method performs three tasks; it validates the deployment * configuration data, generates all container specific classes and * interfaces, and moves the fully baked archive to the designated * deployment targets. * * @param targetList A list of server targets the user is * specifying this application be deployed to. * @param moduleArchive The file name of the application archive * to be disrtibuted. * @param deploymentPlan The XML file containing the runtime * configuration information associated with this application archive. * @return ProgressObject an object that tracks and * reports the status of the distribution process. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to distribute"); } return null; } /** * The distribute method performs three tasks; it validates the deployment * configuration data, generates all container specific classes and * interfaces, and moves the fully baked archive to the designated * deployment targets. * * @param targetList A list of server targets the user is * specifying this application be deployed to. * @param moduleArchive The input stream containing the * application archive to be disrtibuted. * @param deploymentPlan The input stream containing the deployment * configuration information associated with this application archive. * @return ProgressObject an object that tracks and * reports the status of the distribution process. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to distribute"); } return null; } /** * Start the application running. <p> * * Only the TargetModuleIDs which represent a root module are valid for * being started. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be individually started. A root TargetModuleID module * and all its child modules will be started. * * @param moduleIDList A array of TargetModuleID objects * representing the modules to be started. * @return ProgressObject an object that tracks and * reports the status of the start operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to start"); } return null; } /** * Stop the application running. <p> * * Only the TargetModuleIDs which represent a root module are valid for * being stopped. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be individually stopped. A root TargetModuleID module * and all its child modules will be stopped. * * @param moduleIDList A array of TargetModuleID objects * representing the modules to be stopped. * @return ProgressObject an object that tracks and * reports the status of the stop operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject stop(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to stop"); } return null; } /** * Remove the application from the target server. <p> * * Only the TargetModuleIDs which represent a root module are valid for * undeployment. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be undeployed. A root TargetModuleID module and all its * child modules will be undeployed. The root TargetModuleID module and all * its child modules must stopped before they can be undeployed. * * @param moduleIDList An array of TargetModuleID objects * representing the root modules to be stopped. * @return ProgressObject an object that tracks and * reports the status of the stop operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject undeploy(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to undeploy"); } return null; } /** * (optional) The redeploy method provides a means for updating currently * deployed J2EE applications. This is an optional method for vendor * implementation. Redeploy replaces a currently deployed application with * an updated version. The runtime configuration information for the updated * application must remain identical to the application it is updating. When * an application update is redeployed, all existing client connections to * the original running application must not be disrupted; new clients will * connect to the application update. This operation is valid for * TargetModuleIDs that represent a root module. A root TargetModuleID has * no parent. A root TargetModuleID module and all its child modules will be * redeployed. A child TargetModuleID module cannot be individually * redeployed. The redeploy operation is complete only when this action for * all the modules has completed. * * @param moduleIDList An array of designators of the * applications to be updated. * @param moduleArchive The file name of the application * archive to be disrtibuted. * @param deploymentPlan The deployment configuration * information associated with this application archive. * @return ProgressObject an object that * tracks and reports the status of the redeploy operation. * @throws IllegalStateException is thrown when the method is * called when running in disconnected mode. * @throws UnsupportedOperationException this optional command is not * supported by this implementation. */ public ProgressObject redeploy(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan) throws UnsupportedOperationException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to redeploy"); } if (!isRedeploySupported()) { throw new UnsupportedOperationException("Redeploy is not supported"); } return null; } /** * (optional) The redeploy method provides a means for updating currently * deployed J2EE applications. This is an optional method for vendor * implementation. Redeploy replaces a currently deployed application with * an updated version. The runtime configuration information for the updated * application must remain identical to the application it is updating. When * an application update is redeployed, all existing client connections to * the original running application must not be disrupted; new clients will * connect to the application update. This operation is valid for * TargetModuleIDs that represent a root module. A root TargetModuleID has * no parent. A root TargetModuleID module and all its child modules will be * redeployed. A child TargetModuleID module cannot be individually * redeployed. The redeploy operation is complete only when this action for * all the modules has completed. * * @param moduleIDList An array of designators of the * applications to be updated. * @param moduleArchive The input stream containing the * application archive to be disrtibuted. * @param deploymentPlan The input stream containing the * runtime configuration information associated with this application * archive. * @return ProgressObject an object that * tracks and reports the status of the redeploy operation. * @throws IllegalStateException is thrown when the method is * called when running in disconnected mode. * @throws UnsupportedOperationException this optional command is not * supported by this implementation. */ public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) throws UnsupportedOperationException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to redeploy"); } if (!isRedeploySupported()) { throw new UnsupportedOperationException("Redeploy is not supported"); } return null; } /** * The release method is the mechanism by which the tool signals to the * DeploymentManager that the tool does not need it to continue running * connected to the platform. The tool may be signaling it wants to run in a * disconnected mode or it is planning to shutdown. When release is called * the DeploymentManager may close any J2EE resource connections it had for * deployment configuration and perform other related resource cleanup. It * should not accept any new operation requests (i.e., distribute, start * stop, undeploy, redeploy. It should finish any operations that are * currently in process. Each ProgressObject associated with a running * operation should be marked as released (see the ProgressObject). */ public void release() { if (connected) { // TODO // Perfoms some disconnection connected = false; } } } --- NEW FILE: JBoss30Target.java --- package org.jboss.enterprise.deploy.spi; import javax.enterprise.deploy.spi.*; /** * A Target interface represents a single logical * core server of one instance of a J2EE platform * product. It is a designator for a server and * the implied location to copy a configured * application for the server to access. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30Target implements Target { /** Description of the Field */ protected String name = null; /** Description of the Field */ protected String description = null; /** *Constructor for the JBoss30Target object * * @param name Description of Parameter */ public JBoss30Target(String name) { this.name = name; } /** *Constructor for the JBoss30Target object * * @param name Description of Parameter * @param description Description of Parameter */ public JBoss30Target(String name, String description) { this.name = name; this.description = description; } /** * Retrieve the name of the target server. * * @return The value of name attribute */ public String getName() { return name; } /** * Retrieve other descriptive information * about the target. * * @return The value of description attribute */ public String getDescription() { return description; } } --- NEW FILE: JBoss30TargetModuleID.java --- package org.jboss.enterprise.deploy.spi; import javax.enterprise.deploy.spi.*; /** * A TargetModuleID interface represents a unique * identifier for a deployed application module. * A deployable application module can be an EAR, * JAR, WAR or RAR file. * * A TargetModuleID can represent a root module or * a child module. A root module TargetModuleID * has no parent. It represents a deployed EAR * file or stand alone module. A child module * TargetModuleID represents a deployed sub module * of a J2EE application. * * A child TargetModuleID has only one parent, * the super module it was bundled and deployed * with. * * The identifier consists of the target name * and the unique identifier for the deployed * application module. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30TargetModuleID implements TargetModuleID { /** Description of the Field */ protected Target target = null; /** Description of the Field */ protected String moduleID = null; /** *Constructor for the JBoss30TargetModuleID object * * @param target Description of Parameter * @param moduleID Description of Parameter */ public JBoss30TargetModuleID(Target target, String moduleID) { this.target = target; this.moduleID = moduleID; } /** * Retrieve the name of the target server. * this module was deployed to. * * @return Target an object representing * a server target. */ public Target getTarget() { return target; } /** * Retrieve the id assigned to represent * the deployed module. * * @return The value of moduleID attribute */ public String getModuleID() { return moduleID; } /** * Retrieve the identifier of the parent * object of this deployed module. If there * is no parent then this is the root object * deployed. The root could represent an EAR * file or it could be a stand alone module * that was deployed. * * @return the TargetModuleID of the parent * of this object. A <code>null</code> * value means this module is the root * object deployed. */ public TargetModuleID getParentTargetModuleID() { return null; } /** * Retrieve a list of identifiers of the children * of this deployed module. * * @return a list of TargetModuleIDs identifying the * childern of this object. A <code>null</code> * value means this module has no childern */ public TargetModuleID[] getChildTargetModuleID() { return null; } /** * Retrieve the identifier representing * the deployed module. * * @return Description of the Returned Value */ public String toString() { return moduleID; } } |