[Ejtools-cvs] CVS: thirdparty/sun/jsr88/src/main/javax/enterprise/deploy/model DDBean.java,NONE,1.1
Brought to you by:
letiemble
Update of /cvsroot/ejtools/thirdparty/sun/jsr88/src/main/javax/enterprise/deploy/model In directory usw-pr-cvs1:/tmp/cvs-serv31212/sun/jsr88/src/main/javax/enterprise/deploy/model Added Files: DDBean.java DDBeanRoot.java DeployableObject.java J2eeApplicationObject.java XpathEvent.java XpathListener.java Log Message: Initial Import --- NEW FILE: DDBean.java --- 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. */ public interface DDBean { /** * Returns the location in the deployment descriptor from which * this bean is derived. * @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 the ATTLIST ID value for the XML tag defined by * the Xpath for this bean. * @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); } --- NEW FILE: DDBeanRoot.java --- /* * DDBeanRoot.java * * Created on May 17, 2001, 3:23 PM */ 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 gfink */ 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 */ public String getModuleDTDVersion(); /** * Return the XPath for this standard bean. * The root XPath is "/". * @return "/" this is the root standard bean. */ public String getXpath(); } --- NEW FILE: DeployableObject.java --- /* * DeployableObject.java * * Created on May 23, 2001, 12:38 PM */ package javax.enterprise.deploy.model; 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 gfink * @version 0.1 */ 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. * * @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 * * <PRE> * A module's deployment descriptor file always contains * a document type identifier, DOCTYPE. The DOCTYPE statement * contains the module DTD version number in the label of the * statement. * * The format of the DOCTYPE statement is: *<ul> * <!DOCTYPE root_element PUBLIC * "-//organization//label//language" "location"> *</ul> * * root_element - is the name of the root document in the DTD. * organization - is the name of the organization responsible * for the creation and maintenance of the DTD * being referenced. * label - is a unique descriptive name for the public text being * referenced. * language - is the ISO 639 language id representing the natural * language encoding of th DTD. * location - is the URL of the DTD. * * An example J2EE deployment descriptor DOCTYPE statement is: *<ul> * <!DOCTYPE application-client PUBLIC * "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" * "http://java.sun.com/dtd/application-client_1_3.dtd"> *</ul> * In this example the label is, "DTD J2EE Application Client 1.3", * and the DTD version number is 1.3. A call to getModuleDTDVersion * would return a string containing, "1.3". * </PRE> */ public String getModuleDTDVersion(); } --- NEW FILE: J2eeApplicationObject.java --- 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. */ 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 he XPath to listen for * @param xpl The listener */ public void removeXpathListener(ModuleType type, String xpath, XpathListener xpl); } --- NEW FILE: XpathEvent.java --- package javax.enterprise.deploy.model; import java.beans.PropertyChangeEvent; /** * An Event class describing ConfigBeans being added/subtracted * from a server configuration. */ public final class XpathEvent { private final DDBean bean; private final Object typ; private PropertyChangeEvent changeEvent; /** * Adding a DDBean */ public static final Object BEAN_ADDED = new Object(); /** * Removing a DDBean */ public static final Object BEAN_REMOVED = new Object(); /** * Changing a DDBean */ public static final Object BEAN_CHANGED = new Object(); /** * A description of a change in the ConfigBean tree. * @param bean The ConfigBean being added/removed. * @param typ Indicates an add/remove event. */ public XpathEvent(DDBean bean, Object typ) { this.bean = bean; this.typ = typ; } public PropertyChangeEvent getChangeEvent() { if(typ == BEAN_CHANGED) return changeEvent; return null; } public void setChangeEvent(PropertyChangeEvent pce) { changeEvent = pce; } /** * The bean being added/removed/changed. * @return The bean being added/removed/changed. */ public DDBean getBean() {return bean;} /** Is this an add event? * @return true if this is an add event. */ public boolean isAddEvent() {return typ == BEAN_ADDED;} /** Is this a remove event? * @return true if this is a remove event. */ public boolean isRemoveEvent() {return typ == BEAN_REMOVED;} /** Is this a change event? * @return true if this is a change event. */ public boolean isChangeEvent() {return typ == BEAN_CHANGED;} } --- NEW FILE: XpathListener.java --- /* * XpathListener.java * * Created on May 23, 2001, 2:27 PM */ package javax.enterprise.deploy.model; /** * The listener interface for receiving XpathEvents * * @author gfink * @version */ public interface XpathListener { public void fireXpathEvent(XpathEvent xpe); } |