Search in sources :

Example 1 with ConfigurationException

use of javax.enterprise.deploy.spi.exceptions.ConfigurationException in project Payara by payara.

the class SunDeploymentManager method createConfiguration.

/**
 * Retrieve the object that provides server-specific deployment
 * configuration information for the J2EE deployable component.
 *
 * @param dObj An object representing a J2EE deployable component.
 * @throws InvalidModuleException The DeployableObject is an
 *                      unknown or unsupport component for this
 *                      configuration tool.
 */
public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException {
    try {
        SunDeploymentConfiguration deploymentConfiguration = new SunDeploymentConfiguration(dObj);
        deploymentConfiguration.setDeploymentManager(this);
        return deploymentConfiguration;
    } catch (ConfigurationException e) {
        InvalidModuleException ime = new InvalidModuleException(e.getMessage());
        ime.initCause(e);
        throw ime;
    }
}
Also used : ConfigurationException(javax.enterprise.deploy.spi.exceptions.ConfigurationException) SunDeploymentConfiguration(org.glassfish.deployapi.config.SunDeploymentConfiguration) InvalidModuleException(javax.enterprise.deploy.spi.exceptions.InvalidModuleException)

Example 2 with ConfigurationException

use of javax.enterprise.deploy.spi.exceptions.ConfigurationException in project Payara by payara.

the class SunConfigBean method getDConfigBean.

/**
 * Return the JavaBean containing the server-specific deployment
 * configuration information based upon the XML data provided
 * by the DDBean.
 *
 * @return The DConfigBean to display the server-specific properties
 *         for the standard bean.
 * @param bean The DDBean containing the XML data to be
 *        evaluated.
 * @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.
 */
public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
    Map mapping = getXPathToBeanMapping();
    if (mapping == null) {
        return null;
    }
    if (mapping.containsKey(bean.getXpath())) {
        Class c = (Class) mapping.get(bean.getXpath());
        try {
            Object o = c.newInstance();
            if (o instanceof SunConfigBean) {
                SunConfigBean child = (SunConfigBean) o;
                child.setParent(this);
                child.setDDBean(bean);
                return child;
            }
        } catch (Exception e) {
            Logger.getAnonymousLogger().log(Level.WARNING, "Error occurred", e);
            throw new ConfigurationException(e.getMessage());
        }
    }
    return null;
}
Also used : ConfigurationException(javax.enterprise.deploy.spi.exceptions.ConfigurationException) ConfigurationException(javax.enterprise.deploy.spi.exceptions.ConfigurationException)

Aggregations

ConfigurationException (javax.enterprise.deploy.spi.exceptions.ConfigurationException)2 InvalidModuleException (javax.enterprise.deploy.spi.exceptions.InvalidModuleException)1 SunDeploymentConfiguration (org.glassfish.deployapi.config.SunDeploymentConfiguration)1