use of com.predic8.membrane.core.config.spring.BaseLocationApplicationContext in project service-proxy by membrane.
the class SimpleApiConfig method setUrl.
/**
* @description the url to the configuration file
* @default api.yaml
*/
@MCAttribute
public void setUrl(String url) {
this.url = url;
if (context != null) {
if (amc == null) {
String workingDir = ((BaseLocationApplicationContext) context).getBaseLocation();
amc = new ApiManagementConfiguration(workingDir, this.url);
} else {
amc.setLocation(this.url);
}
}
}
use of com.predic8.membrane.core.config.spring.BaseLocationApplicationContext in project service-proxy by membrane.
the class EtcdRegistryApiConfig method initAmc.
public void initAmc() {
String workingDir = ((BaseLocationApplicationContext) context).getBaseLocation();
String etcdUrlForAmc = null;
URL u = null;
try {
u = new URL(getUrl());
} catch (MalformedURLException e) {
try {
u = new URL("http://" + getUrl());
} catch (MalformedURLException ignored) {
}
}
if (u == null) {
log.error("Url malformed: " + getUrl());
}
etcdUrlForAmc = "etcd://" + u.getHost() + ":" + u.getPort();
amc = new ApiManagementConfiguration(workingDir, etcdUrlForAmc, membraneId);
}
Aggregations