public ServiceActivatorArchive addServiceActivator(Class<? extends ServiceActivator> cls) { if (getArchive().getName().endsWith(".war")) { getArchive().as(WebArchive.class).addClass(cls); } else if (getArchive().getName().endsWith(".jar")) { getArchive().as(JavaArchive.class).addClass(cls); } this.asset.addServiceActivator(cls); return this; }
public ServiceActivatorArchive addServiceActivator(Class<? extends ServiceActivator> cls) { if (getArchive().getName().endsWith(".war")) { getArchive().as(WebArchive.class).addClass(cls); } else if (getArchive().getName().endsWith(".jar")) { getArchive().as(JavaArchive.class).addClass(cls); } this.asset.addServiceActivator(cls); return this; }
/** * Constructs a new instance using the underlying specified archive, which is required * * @param archive */ public SecuredImpl(ArchiveBase<?> archive) { super(archive); Node node = getArchive().as(JARArchive.class).get("WEB-INF/web.xml"); if (node == null) { this.asset = new WebXmlAsset(); getArchive().as(JARArchive.class).add(this.asset); } else { Asset asset = node.getAsset(); if (!(asset instanceof WebXmlAsset)) { this.asset = new WebXmlAsset(asset.openStream()); getArchive().as(JARArchive.class).add(this.asset); } else { this.asset = (WebXmlAsset) asset; } } // Setup web.xml this.asset.setContextParam("resteasy.scan", "true"); this.asset.setLoginConfig("KEYCLOAK", "ignored"); }
/** * Constructs a new instance using the underlying specified archive, which is required * * @param archive */ public SecuredImpl(ArchiveBase<?> archive) { super(archive); Node node = getArchive().as(JARArchive.class).get("WEB-INF/web.xml"); if (node == null) { this.asset = new WebXmlAsset(); getArchive().as(JARArchive.class).add(this.asset); } else { Asset asset = node.getAsset(); if (!(asset instanceof WebXmlAsset)) { this.asset = new WebXmlAsset(asset.openStream()); getArchive().as(JARArchive.class).add(this.asset); } else { this.asset = (WebXmlAsset) asset; } } // Setup web.xml this.asset.setContextParam("resteasy.scan", "true"); this.asset.setLoginConfig("KEYCLOAK", "ignored"); }
super(archive); Node node = getArchive().as(JARArchive.class).get("WEB-INF/web.xml"); if (node == null) { this.asset = new WebXmlAsset(); getArchive().as(JARArchive.class).add(this.asset); } else { NamedAsset asset = (NamedAsset) node.getAsset(); if (!(asset instanceof WebXmlAsset)) { this.asset = new WebXmlAsset(asset.openStream()); getArchive().as(JARArchive.class).add(this.asset); } else { this.asset = (WebXmlAsset) asset; getArchive().as(JARArchive.class).addModule("org.wildfly.swarm.keycloak", "runtime"); getArchive().as(JARArchive.class).addAsServiceProvider("io.undertow.servlet.ServletExtension", "org.wildfly.swarm.keycloak.runtime.SecurityContextServletExtension"); getArchive().as(JARArchive.class).add(createAsset(keycloakJson), "WEB-INF/keycloak.json"); } else {