added proxy

This commit is contained in:
Lucio Lelii 2022-06-22 18:52:11 +02:00
parent a894e23b23
commit d62df31df1
2 changed files with 10 additions and 4 deletions

View File

@ -40,13 +40,16 @@ public class LegacyISPublisher implements Publisher{
AuthorizationProvider provider = container.configuration().authorizationProvider();
for (String context : provider.getContexts())
try {
logger.info("publishing container in context {}", context);
AuthorizedTasks.executeSafely(new Runnable() {
@Override
public void run() {
try {
logger.info("(inside task)publishing container in context {}", context);
registry.getStubs().create(toXml(hostingNode), hostingNode.type().toString());
}catch (Exception e) {
logger.error("error publishing container", e);
throw new RuntimeException(e);
}
@ -69,13 +72,16 @@ public class LegacyISPublisher implements Publisher{
AuthorizationProvider provider = application.container().configuration().authorizationProvider();
for (String context : provider.getContexts())
try {
logger.info("publishing application in context {}", context);
AuthorizedTasks.executeSafely(new Runnable() {
@Override
public void run() {
try {
logger.info("(inside task)publishing application in context {}", context);
registry.getStubs().create(toXml(enpoint), enpoint.type().toString());
}catch (Exception e) {
logger.error("erro publishing application", e);
throw new RuntimeException(e);
}

View File

@ -48,11 +48,11 @@ public class ApplicationProfileBuilder {
endpoint.profile().endpoints().clear();
String baseAddress;
if (configuration.proxied()){
String protocol = configuration.proxyAddress().getProtocol();
String port = configuration.proxyAddress().getPort()!=null?":"+configuration.proxyAddress().getPort():"";
if (configuration.proxied() && container.proxy()!=null){
String protocol = container.proxy().getProtocol();
String port = container.proxy().getPort()!=null?":"+container.proxy().getPort():"";
baseAddress=String.format("%s://%s%s%s", protocol , configuration.proxyAddress().getHostname(), port,context.application().getContextPath());
baseAddress=String.format("%s://%s%s%s", protocol , container.proxy().getHostname(), port,context.application().getContextPath());
} else {
String protocol = container.protocol();
int port = container.port();