org.glassfish.deployapi.config
Class SunConfigBean

java.lang.Object
  extended by org.glassfish.deployapi.config.SunConfigBean
All Implemented Interfaces:
XpathListener, DConfigBean

public abstract class SunConfigBean
extends Object
implements DConfigBean, 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
protected  DDBean ddBean
           
protected static LocalStringManagerImpl localStrings
           
protected  PropertyChangeSupport propertyChange
           
 
Constructor Summary
SunConfigBean()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Register a property listener for this bean.
static String extractTextFromXML(String key, String xmlFragment)
          Convenience method extract node value from the passed xml fragment.
 void fireXpathEvent(XpathEvent xpe)
          Notification of change from the standard DDBean
 DConfigBean getDConfigBean(DDBean bean)
          Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.
protected  DConfigBeanRoot getDConfigBeanRoot()
           
 DDBean getDDBean()
          Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.
abstract  Object getDescriptor()
           
 SunConfigBean getParent()
           
 String[] getXpaths()
          Return a list of XPaths designating the deployment descriptor information this DConfigBean requires.
protected abstract  Map getXPathToBeanMapping()
           
 void notifyDDChange(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  void process()
          evaluate a standard bean
 void removeDConfigBean(DConfigBean dConfigBean)
          Remove a child DConfigBean from this bean.
 void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Unregister a property listener for this bean.
protected  void setDDBean(DDBean ddBean)
          we are being set a new DDBean, we need to reevaluate ourself.
protected  void setParent(SunConfigBean parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ddBean

protected DDBean ddBean

propertyChange

protected PropertyChangeSupport propertyChange

localStrings

protected static final LocalStringManagerImpl localStrings
Constructor Detail

SunConfigBean

public SunConfigBean()
Method Detail

getDConfigBean

public DConfigBean getDConfigBean(DDBean bean)
                           throws 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 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:
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 DDBean getDDBean()
Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.

Specified by:
getDDBean in interface DConfigBean
Returns:
The bean class containing the XML text for this DConfigBean.

setDDBean

protected void setDDBean(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(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 DConfigBean
Parameters:
event - an event containing a reference to the DDBean which has changed.

removeDConfigBean

public void removeDConfigBean(DConfigBean dConfigBean)
                       throws BeanNotFoundException
Remove a child DConfigBean from this bean.

Specified by:
removeDConfigBean in interface 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 DConfigBean
Parameters:
pcl - PropertyChangeListener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Unregister a property listener for this bean.

Specified by:
removePropertyChangeListener in interface DConfigBean
Parameters:
pcl - Listener to remove.

fireXpathEvent

public void fireXpathEvent(XpathEvent xpe)
Notification of change from the standard DDBean

Specified by:
fireXpathEvent in interface 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 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 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 DConfigBeanRoot getDConfigBeanRoot()
Returns:
the ConfigBeanRoot for this config bean

toString

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


Copyright © 2012. All Rights Reserved.