Class 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
    • Constructor Detail

      • SunConfigBean

        public SunConfigBean()
    • Method Detail

      • getDConfigBean

        public javax.enterprise.deploy.spi.DConfigBean getDConfigBean​(javax.enterprise.deploy.model.DDBean bean)
                                                               throws javax.enterprise.deploy.spi.exceptions.ConfigurationException
        Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.
        Specified by:
        getDConfigBean in interface javax.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:
        getDDBean in interface javax.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 Exception
        we 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:
        notifyDDChange in interface javax.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.BeanNotFoundException
        Remove a child DConfigBean from this bean.
        Specified by:
        removeDConfigBean in interface javax.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:
        addPropertyChangeListener in interface javax.enterprise.deploy.spi.DConfigBean
        Parameters:
        pcl - PropertyChangeListener to add
      • removePropertyChangeListener

        public void removePropertyChangeListener​(PropertyChangeListener propertyChangeListener)
        Unregister a property listener for this bean.
        Specified by:
        removePropertyChangeListener in interface javax.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:
        fireXpathEvent in interface javax.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:
        getXpaths in interface javax.enterprise.deploy.spi.DConfigBean
        Returns:
        a list of XPath Strings representing XML data to be retrieved or 'null' if there are none.
      • extractTextFromXML

        public static String extractTextFromXML​(String key,
                                                String xmlFragment)
        Convenience method extract node value from the passed xml fragment.
        Parameters:
        key - the xml tag name
        xml - 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 Exception
        evaluate 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
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a meaningful string about myself