KEYCLOAK-7593 Setters for httpContext

This commit is contained in:
Hynek Mlnarik 2018-06-12 13:39:19 +02:00 committed by Hynek Mlnařík
parent ccb09fbf45
commit 9dc5709ce7
2 changed files with 12 additions and 2 deletions

View file

@ -86,6 +86,9 @@ public class PaxWebIntegrationService {
return httpContext; return httpContext;
} }
public void setHttpContext(HttpContext httpContext) {
this.httpContext = httpContext;
}
public void start() { public void start() {
ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() { ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() {
@ -115,7 +118,9 @@ public class PaxWebIntegrationService {
protected WebContainer addingWebContainerCallback(ServiceReference webContainerServiceReference) { protected WebContainer addingWebContainerCallback(ServiceReference webContainerServiceReference) {
WebContainer service = (WebContainer) bundleContext.getService(webContainerServiceReference); WebContainer service = (WebContainer) bundleContext.getService(webContainerServiceReference);
if (httpContext == null) {
httpContext = service.createDefaultHttpContext(); httpContext = service.createDefaultHttpContext();
}
addJettyWebXml(service); addJettyWebXml(service);

View file

@ -70,6 +70,9 @@ public class PaxWebIntegrationService {
return httpContext; return httpContext;
} }
public void setHttpContext(HttpContext httpContext) {
this.httpContext = httpContext;
}
public void start() { public void start() {
ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() { ServiceTrackerCustomizer trackerCustomizer = new ServiceTrackerCustomizer() {
@ -99,7 +102,9 @@ public class PaxWebIntegrationService {
protected WebContainer addingWebContainerCallback(ServiceReference webContainerServiceReference) { protected WebContainer addingWebContainerCallback(ServiceReference webContainerServiceReference) {
WebContainer service = (WebContainer) bundleContext.getService(webContainerServiceReference); WebContainer service = (WebContainer) bundleContext.getService(webContainerServiceReference);
if (httpContext == null) {
httpContext = service.createDefaultHttpContext(); httpContext = service.createDefaultHttpContext();
}
if (constraintMappings == null) { if (constraintMappings == null) {
throw new IllegalStateException("constraintMappings was null!"); throw new IllegalStateException("constraintMappings was null!");