Package org.glassfish.deployapi.config
Class SunConfigBean
- java.lang.Object
-
- org.glassfish.deployapi.config.SunConfigBean
-
- All Implemented Interfaces:
javax.enterprise.deploy.model.XpathListener,javax.enterprise.deploy.spi.DConfigBean
public abstract class SunConfigBean extends Object implements javax.enterprise.deploy.spi.DConfigBean, javax.enterprise.deploy.model.XpathListener
Superclass for all the ConfigBeans. ConfigBeans are organized with a parent-child relationship. The parent defines xPaths and their mapping to child beans and return this mapping from the getXPathToBeanMapping method. Each bean is associated with a DOL descriptor (virtual field for this class) accessible through the getDescriptor() call.- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.enterprise.deploy.model.DDBeanddBeanprotected static LocalStringManagerImpllocalStringsprotected PropertyChangeSupportpropertyChange
-
Constructor Summary
Constructors Constructor Description SunConfigBean()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener propertyChangeListener)Register a property listener for this bean.static StringextractTextFromXML(String key, String xmlFragment)Convenience method extract node value from the passed xml fragment.voidfireXpathEvent(javax.enterprise.deploy.model.XpathEvent xpe)Notification of change from the standard DDBeanjavax.enterprise.deploy.spi.DConfigBeangetDConfigBean(javax.enterprise.deploy.model.DDBean bean)Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.protected javax.enterprise.deploy.spi.DConfigBeanRootgetDConfigBeanRoot()javax.enterprise.deploy.model.DDBeangetDDBean()Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.abstract ObjectgetDescriptor()SunConfigBeangetParent()String[]getXpaths()Return a list of XPaths designating the deployment descriptor information this DConfigBean requires.protected abstract MapgetXPathToBeanMapping()voidnotifyDDChange(javax.enterprise.deploy.model.XpathEvent xpathEvent)A notification that the DDBean provided in the event has changed and this bean or its child beans need to reevaluate themselves.protected abstract voidprocess()evaluate a standard beanvoidremoveDConfigBean(javax.enterprise.deploy.spi.DConfigBean dConfigBean)Remove a child DConfigBean from this bean.voidremovePropertyChangeListener(PropertyChangeListener propertyChangeListener)Unregister a property listener for this bean.protected voidsetDDBean(javax.enterprise.deploy.model.DDBean ddBean)we are being set a new DDBean, we need to reevaluate ourself.protected voidsetParent(SunConfigBean parent)StringtoString()
-
-
-
Field Detail
-
ddBean
protected javax.enterprise.deploy.model.DDBean ddBean
-
propertyChange
protected PropertyChangeSupport propertyChange
-
localStrings
protected static final LocalStringManagerImpl localStrings
-
-
Method Detail
-
getDConfigBean
public javax.enterprise.deploy.spi.DConfigBean getDConfigBean(javax.enterprise.deploy.model.DDBean bean) throws javax.enterprise.deploy.spi.exceptions.ConfigurationExceptionReturn the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.- Specified by:
getDConfigBeanin interfacejavax.enterprise.deploy.spi.DConfigBean- Parameters:
bean- The DDBean containing the XML data to be evaluated.- Returns:
- The DConfigBean to display the server-specific properties for the standard bean.
- Throws:
javax.enterprise.deploy.spi.exceptions.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.
-
getDDBean
public javax.enterprise.deploy.model.DDBean getDDBean()
Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.- Specified by:
getDDBeanin interfacejavax.enterprise.deploy.spi.DConfigBean- Returns:
- The bean class containing the XML text for this DConfigBean.
-
setDDBean
protected void setDDBean(javax.enterprise.deploy.model.DDBean ddBean) throws Exceptionwe are being set a new DDBean, we need to reevaluate ourself.- Parameters:
DDBean- is the new standard DDBean container- Throws:
Exception
-
notifyDDChange
public void notifyDDChange(javax.enterprise.deploy.model.XpathEvent xpathEvent)
A notification that the DDBean provided in the event has changed and this bean or its child beans need to reevaluate themselves.- Specified by:
notifyDDChangein interfacejavax.enterprise.deploy.spi.DConfigBean- Parameters:
event- an event containing a reference to the DDBean which has changed.
-
removeDConfigBean
public void removeDConfigBean(javax.enterprise.deploy.spi.DConfigBean dConfigBean) throws javax.enterprise.deploy.spi.exceptions.BeanNotFoundExceptionRemove a child DConfigBean from this bean.- Specified by:
removeDConfigBeanin interfacejavax.enterprise.deploy.spi.DConfigBean- Parameters:
bean- The child DConfigBean to be removed.- Throws:
BeanNotFoundException- the bean provided is not in the child list of this bean.
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Register a property listener for this bean.- Specified by:
addPropertyChangeListenerin interfacejavax.enterprise.deploy.spi.DConfigBean- Parameters:
pcl- PropertyChangeListener to add
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Unregister a property listener for this bean.- Specified by:
removePropertyChangeListenerin interfacejavax.enterprise.deploy.spi.DConfigBean- Parameters:
pcl- Listener to remove.
-
fireXpathEvent
public void fireXpathEvent(javax.enterprise.deploy.model.XpathEvent xpe)
Notification of change from the standard DDBean- Specified by:
fireXpathEventin interfacejavax.enterprise.deploy.model.XpathListener- Parameters:
the- change event
-
getXpaths
public String[] getXpaths()
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.- Specified by:
getXpathsin interfacejavax.enterprise.deploy.spi.DConfigBean- Returns:
- a list of XPath Strings representing XML data to be retrieved or 'null' if there are none.
-
setParent
protected void setParent(SunConfigBean parent)
-
getParent
public SunConfigBean getParent()
-
extractTextFromXML
public static String extractTextFromXML(String key, String xmlFragment)
Convenience method extract node value from the passed xml fragment.- Parameters:
key- the xml tag namexml- fragment to extract the tag value- Returns:
- the xml tag value
-
getXPathToBeanMapping
protected abstract Map getXPathToBeanMapping()
- Returns:
- the mapping from xpaths to child config beans where the map keys are the xpaths and the values are the class object for the child config beans
-
process
protected abstract void process() throws Exceptionevaluate a standard bean- Throws:
Exception
-
getDescriptor
public abstract Object getDescriptor()
- Returns:
- the associated DOL Descriptor for this config beans
-
getDConfigBeanRoot
protected javax.enterprise.deploy.spi.DConfigBeanRoot getDConfigBeanRoot()
- Returns:
- the ConfigBeanRoot for this config bean
-
-