use of com.sun.enterprise.config.serverbeans.Module in project Payara by payara.
the class ModuleConfigSource method getProperties.
@Override
public Map<String, String> getProperties() {
Application config = domainConfiguration.getApplications().getApplication(configurationName);
HashMap<String, String> result = new HashMap<>();
if (config != null) {
Module module = config.getModule(moduleName);
if (module != null) {
List<Property> properties = module.getProperty();
for (Property property : properties) {
if (property.getName().startsWith(PROPERTY_PREFIX)) {
result.put(property.getName().substring(PROPERTY_PREFIX.length()), property.getValue());
}
}
}
}
return result;
}
use of com.sun.enterprise.config.serverbeans.Module in project Payara by payara.
the class ModuleConfigSource method getValue.
@Override
public String getValue(String propertyName) {
String result = null;
Application app = domainConfiguration.getApplications().getApplication(configurationName);
if (app != null) {
Module m = app.getModule(moduleName);
if (m != null) {
result = m.getPropertyValue(PROPERTY_PREFIX + propertyName);
}
}
return result;
}
use of com.sun.enterprise.config.serverbeans.Module in project Payara by payara.
the class ModuleConfigSource method setValue.
public boolean setValue(final String propertyName, final String propertyValue) throws TransactionFailure {
boolean result = false;
Application app = domainConfiguration.getApplications().getApplication(configurationName);
if (app != null) {
Module m = app.getModule(moduleName);
if (m != null) {
Property p = m.getProperty(PROPERTY_PREFIX + propertyName);
if (p == null) {
ConfigSupport.apply(new SingleConfigCode<Module>() {
@Override
public Object run(Module config) throws TransactionFailure, PropertyVetoException {
Property prop = config.createChild(Property.class);
prop.setName(PROPERTY_PREFIX + propertyName);
prop.setValue(propertyValue);
config.getProperty().add(prop);
return null;
}
}, m);
} else {
ConfigSupport.apply(new SingleConfigCode<Property>() {
@Override
public Object run(Property config) throws TransactionFailure, PropertyVetoException {
config.setValue(propertyValue);
return null;
}
}, p);
}
result = true;
}
}
return result;
}
use of com.sun.enterprise.config.serverbeans.Module in project Payara by payara.
the class ModuleConfigSource method deleteValue.
public boolean deleteValue(String propertyName) throws TransactionFailure {
boolean result = false;
Application app = domainConfiguration.getApplications().getApplication(configurationName);
if (app != null) {
Module m = app.getModule(moduleName);
for (Property object : m.getProperty()) {
if ((PROPERTY_PREFIX + propertyName).equals(object.getName())) {
ConfigSupport.deleteChild((ConfigBean) ConfigBean.unwrap(m), (ConfigBean) ConfigBean.unwrap(object));
result = true;
}
}
}
return result;
}
use of com.sun.enterprise.config.serverbeans.Module in project Payara by payara.
the class ListComponentsCommand method getAppEngines.
private List<Engine> getAppEngines(final Application app) {
final List<Engine> engineList = new ArrayList<Engine>();
// first add application level engines
engineList.addAll(app.getEngine());
// now add module level engines
for (Module module : app.getModule()) {
engineList.addAll(module.getEngines());
}
return engineList;
}
Aggregations