use of sun.security.util.PropertyExpander.ExpandException in project Payara by payara.
the class ConfigDomainParser method parseIDEntry.
private void parseIDEntry(ProviderConfig pConfig, Map<String, GFServerConfigProvider.InterceptEntry> newConfig, String intercept) throws IOException {
String id = pConfig.getProviderId();
String type = pConfig.getProviderType();
String moduleClass = pConfig.getClassName();
MessagePolicy requestPolicy = parsePolicy((RequestPolicy) pConfig.getRequestPolicy());
MessagePolicy responsePolicy = parsePolicy((ResponsePolicy) pConfig.getResponsePolicy());
// get the module options
Map<String, Object> options = new HashMap<>();
List<Property> pList = pConfig.getProperty();
if (pList != null) {
Iterator<Property> pit = pList.iterator();
while (pit.hasNext()) {
Property property = pit.next();
try {
options.put(property.getName(), PropertyExpander.expand(property.getValue(), false));
} catch (ExpandException ee) {
// interpret value itself.
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "jmac.unexpandedproperty");
}
options.put(property.getName(), property.getValue());
}
}
}
if (_logger.isLoggable(FINE)) {
_logger.fine("ID Entry: " + "\n module class: " + moduleClass + "\n id: " + id + "\n type: " + type + "\n request policy: " + requestPolicy + "\n response policy: " + responsePolicy + "\n options: " + options);
}
// create ID entry
GFServerConfigProvider.IDEntry idEntry = new GFServerConfigProvider.IDEntry(type, moduleClass, requestPolicy, responsePolicy, options);
GFServerConfigProvider.InterceptEntry intEntry = newConfig.get(intercept);
if (intEntry == null) {
throw new IOException("intercept entry for " + intercept + " must be specified before ID entries");
}
if (intEntry.idMap == null) {
intEntry.idMap = new HashMap<>();
}
// map id to Intercept
intEntry.idMap.put(id, idEntry);
}
Aggregations