[Ejtools-cvs] libraries/j2ee.deployment/src/main/javax/enterprise/deploy/model DDBean.java,NONE,1.1
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 09:46:47
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/model In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/main/javax/enterprise/deploy/model Added Files: DDBean.java DDBeanRoot.java DeployableObject.java J2eeApplicationObject.java XpathEvent.java XpathListener.java package.html Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: DDBean.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; /** * An interface for beans that represent a fragment of a standard deployment descriptor. * A link is provided to the J2EE application that includes this bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public interface DDBean { /** * Returns the original xpath string provided by the DConfigBean. * * @return The XPath of this Bean. */ public String getXpath(); /** * Returns the XML text for by this bean. * * @return The XML text for this Bean. */ public String getText(); /** * Returns a tool-specific reference for attribute ID on an element in the deployment * descriptor. This attribute is defined for J2EE 1.2 and 1.3 components. * * @return The XML text for this Bean or 'null' if no attribute was specifed * with the tag. */ public String getId(); /** * Return the root element for this DDBean. * * @return The DDBeanRoot at the root of this DDBean tree. */ public DDBeanRoot getRoot(); /** * Return a list of DDBeans based upon the XPath. * * @param xpath An XPath string referring to a location in the same deployment * descriptor as this standard bean. * @return a list of DDBeans or 'null' if no matching XML data is found. */ public DDBean[] getChildBean(String xpath); /** * Return a list of text values for a given XPath in the deployment descriptor. * * @param xpath An XPath. * @return The list text values for this XPath or 'null' if no matching * XML data is found. */ public String[] getText(String xpath); /** * Register a listener for a specific XPath. * * @param xpath The XPath this listener is to be registered for. * @param xpl The listener object. */ public void addXpathListener(String xpath, XpathListener xpl); /** * Unregister a listener for a specific XPath. * * @param xpath The XPath from which this listener is to be unregistered. * @param xpl The listener object. */ public void removeXpathListener(String xpath, XpathListener xpl); /** * Returns the list of attribute names associated with the XML element. * * @return a list of attribute names on this element. Null is returned if there * are no attributes. */ public String[] getAttributeNames(); /** * Returns the string value of the named attribute. * * @param attrName The attribute name * @return a the value of the attribute. Null is returned if there is * no such attribute. */ public String getAttributeValue(String attrName); } --- NEW FILE: DDBeanRoot.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; import javax.enterprise.deploy.shared.ModuleType; /** * An interface that represents the root of a standard deployment descriptor. A DDBeanRoot * is a type of DDBean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 * @see javax.enterprise.deploy.shared.ModuleType */ public interface DDBeanRoot extends DDBean { /** * Return the ModuleType of deployment descriptor. * * @return The ModuleType of deployment descriptor */ public ModuleType getType(); /** * Return the containing DeployableObject * * @return The DeployableObject that contains this deployment descriptor */ public DeployableObject getDeployableObject(); /** * A convenience method to return the DTD version number. The DeployableObject * has this information. * * @return a string containing the DTD version number This method is being * deprecated. Two DD data formats are being used, DTD and XML Schema. DDBeanRoot.getDDBeanRootVersion * should be used in its place. * @deprecated As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion() */ public String getModuleDTDVersion(); /** * Returns the version number of an XML instance document. This method is replacing * the methods DDBeanRoot.getModuleDTDVersion and DeployableObject.getModuleDTDVersion. * This method returns the version number of any J2EE XML instance document. * * @return a string that is the version number of the XML instance document. * Null is returned if no version number can be found. */ public String getDDBeanRootVersion(); /** * Return the XPath for this standard bean. The root XPath is "/". * * @return "/" this is the root standard bean. */ public String getXpath(); /** * Returns the filename relative to the root of the module of the XML instance * document this DDBeanRoot represents. * * @return String the filename relative to the root of the module */ public String getFilename(); } --- NEW FILE: DeployableObject.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.Enumeration; import javax.enterprise.deploy.model.exceptions.DDBeanCreateException; import javax.enterprise.deploy.shared.ModuleType; /** * The DeployableObject interface is an abstract representation of a J2EE deployable * module (JAR, WAR, RAR, EAR). A DeployableObject provides access to the module's * deployment descriptor and class files. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 * @see javax.enterprise.deploy.shared.ModuleType */ public interface DeployableObject { /** * Return the ModuleType of deployment descriptor (i.e., EAR, JAR, WAR, RAR) this * deployable object represents. Values are found in DeploymentManager. * * @return The ModuleType of deployable object */ public ModuleType getType(); /** * Return the top level standard bean representing the root of the deployment * descriptor. * * @return A standard bean representing the deployment descriptor. */ public DDBeanRoot getDDBeanRoot(); /** * Return an array of standard beans representing the XML content returned based * upon the XPath. * * @param xpath An XPath string identifying the data to be extracted from the * deployment descriptor. * @return a array of DDBeans or 'null' if no matching data found. */ public DDBean[] getChildBean(String xpath); /** * Return the XML content associated with the XPath from a deployment descriptor. * * @param xpath An xpath string referring to a location in the deployment descriptor * @return a list XML content or 'null' if no matching data found. */ public String[] getText(String xpath); /** * Retrieve the specified class from this deployable module. <p> * * One use: to get all finder methods from an EJB If the tool is attempting to * package an module and retrieve a class from the package, the class request * may fail. The class may not yet be available. The tool should respect the manifest * cross-path entries.</p> * * @param className Class to retrieve. * @return Class representation of the class */ public Class getClassFromScope(String className); /** * Returns the DTD version number given in the XML DOCTYPE text provided in every * standard J2EE module's deployment descriptor file. * * @return a string containing the DTD version number * @deprecated As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion() */ public String getModuleDTDVersion(); /** * Returns a DDBeanRoot object for the XML instance document named. This method * should be used to return DDBeanRoot objects for non deployment descriptor XML * instance documents such as WSDL files. * * @param filename The full path for the XML instance document * relative to root of the DeployableObject archive * @return a DDBeanRoot object for the XML data. * @exception FileNotFoundException if the named file can not be found * @exception DDBeanCreateException if an error is encountered creating the DDBeanRoot * object. */ public DDBeanRoot getDDBeanRoot(String filename) throws FileNotFoundException, DDBeanCreateException; /** * Returns an enumeration of the module file entries. All elements in the enumeration * are of type String. Each String represents a file name relative to the root * of the module. * * @return an enumeration of the archive file entries. */ public Enumeration entries(); /** * Returns the InputStream for the given entry name The file name must be relative * to the root of the module. * * @param name the file name relative to the root of the module. * @return the InputStream for the given entry name or null if not found. */ public InputStream getEntry(String name); } --- NEW FILE: J2eeApplicationObject.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; import javax.enterprise.deploy.shared.ModuleType; /** * J2eeApplicationObject is an interface that represents a J2EE application (EAR); * it maintains a DeployableObject for each module in the archive. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 * @see javax.enterprise.deploy.shared.ModuleType */ public interface J2eeApplicationObject extends DeployableObject { /** * Return the DeployableObject of the specified URI designator. * * @param uri Describes where to get the module from. * @return the DeployableObject describing the j2ee module at this uri or * 'null' if there is not match. */ public DeployableObject getDeployableObject(String uri); /** * Return the all DeployableObjects of the specified type. * * @param type The type of module to return. * @return the list of DeployableObjects describing the j2ee module at this * uri or 'null' if there are no matches. */ public DeployableObject[] getDeployableObjects(ModuleType type); /** * Return the all DeployableObjects in this application. * * @return the DeployableObject describing the j2ee module at this uri or 'null' * if there are no matches. */ public DeployableObject[] getDeployableObjects(); /** * Return the list of URIs of the designated module type. * * @param type The type of module to return. * @return the Uris of the contained modules or 'null' if there are no matches. */ public String[] getModuleUris(ModuleType type); /** * Return the list of URIs for all modules in the application. * * @return the Uris of the contained modules or 'null' if there are no matches. */ public String[] getModuleUris(); /** * Return a list of DDBean based upon an XPath; all deployment descriptors of * the specified type are searched. * * @param type The type of deployment descriptor to query. * @param xpath An XPath string referring to a location in the deployment descriptor * @return The list of DDBeans or 'null' of there are no matches. */ public DDBean[] getChildBean(ModuleType type, String xpath); /** * Return the text value from the XPath; search only the deployment descriptors * of the specified type. * * @param type The type of deployment descriptor to query. * @param xpath An xpath string referring to a location in the deployment descriptor * @return The text values of this xpath or 'null' if there are no matches. */ public String[] getText(ModuleType type, String xpath); /** * Register a listener for changes in XPath that are related to this deployableObject. * * @param type The type of deployment descriptor to query. * @param xpath The xpath to listen for. * @param xpl The listener. */ public void addXpathListener(ModuleType type, String xpath, XpathListener xpl); /** * Unregister the listener for an XPath. * * @param type The type of deployment descriptor to query. * @param xpath The xpath to listen for. * @param xpl The listener. */ public void removeXpathListener(ModuleType type, String xpath, XpathListener xpl); } --- NEW FILE: XpathEvent.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; import java.beans.PropertyChangeEvent; /** * An Event class describing ConfigBeans being added/subtracted from a server configuration. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class XpathEvent { /** The associated ConfigBean */ private DDBean bean; /** The change event */ private PropertyChangeEvent pce; /** The event type */ private Object type; /** Adding a DDBean */ public final static Object BEAN_ADDED = new Object(); /** Removing a DDBean */ public final static Object BEAN_CHANGED = new Object(); /** Changing a DDBean */ public final static Object BEAN_REMOVED = new Object(); /** * A description of a change in the ConfigBean tree. * * @param bean The ConfigBean being added/removed. * @param type Indicates an add/change/remove event. */ public XpathEvent(DDBean bean, Object type) { this.bean = bean; this.type = type; } /** * Returns the bean being added/removed/changed. * * @return The bean being added/removed/changed. */ public DDBean getBean() { return this.bean; } /** * Returns the event * * @return The event value */ public PropertyChangeEvent getChangeEvent() { return this.pce; } /** * Is this an add event ? * * @return True if it is an add event */ public boolean isAddEvent() { return (BEAN_ADDED == this.type); } /** * Is this an change event ? * * @return True if it is an change event */ public boolean isChangeEvent() { return (BEAN_CHANGED == this.type); } /** * Is this an remove event ? * * @return True if it is an remove event */ public boolean isRemoveEvent() { return (BEAN_REMOVED == this.type); } /** * Sets the event * * @param pce The event value */ public void setChangeEvent(PropertyChangeEvent pce) { this.pce = pce; } } --- NEW FILE: XpathListener.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.model; /** * The listener interface for receiving XpathEvents. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 * @see javax.enterprise.deploy.model.XpathEvent */ public interface XpathListener { /** * Called when a XPath Event occurs. * * @param xpe The XPath Event */ public void fireXpathEvent(XpathEvent xpe); } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides Tool Vendor implementation classes. <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/88.jsp">JSR 88, J2EE Application Deployment</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |