KEYCLOAK-4671 Add server-private-spi to dependency deployer

This commit is contained in:
Stian Thorgersen 2017-04-25 09:21:15 +02:00
parent e48340121b
commit 54ee055bd8
16 changed files with 19 additions and 16 deletions

View file

@ -30,7 +30,7 @@ public class LDAPStorageMapperSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -30,7 +30,7 @@ public class JpaEntitySpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class ClientAuthenticatorSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class FormActionSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class FormAuthenticatorSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class RequiredActionSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -29,7 +29,7 @@ public class IdentityProviderSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -29,7 +29,7 @@ public class SocialProviderSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class CredentialSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class PasswordHashSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class EventListenerSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -28,7 +28,7 @@ public class PasswordPolicySpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -359,7 +359,8 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory, Pr
}
private boolean isInternal(ProviderFactory<?> factory) {
return factory.getClass().getPackage().getName().startsWith("org.keycloak");
String packageName = factory.getClass().getPackage().getName();
return packageName.startsWith("org.keycloak") && !packageName.startsWith("org.keycloak.examples");
}
/**

View file

@ -27,7 +27,7 @@ import org.keycloak.provider.Spi;
public class ClientRegistrationSpi implements Spi {
@Override
public boolean isInternal() {
return false;
return true;
}
@Override

View file

@ -42,6 +42,7 @@ public class KeycloakProviderDependencyProcessor implements DeploymentUnitProces
private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common");
private static final ModuleIdentifier KEYCLOAK_CORE = ModuleIdentifier.create("org.keycloak.keycloak-core");
private static final ModuleIdentifier KEYCLOAK_SERVER_SPI = ModuleIdentifier.create("org.keycloak.keycloak-server-spi");
private static final ModuleIdentifier KEYCLOAK_SERVER_SPI_PRIVATE = ModuleIdentifier.create("org.keycloak.keycloak-server-spi-private");
private static final ModuleIdentifier KEYCLOAK_JPA = ModuleIdentifier.create("org.keycloak.keycloak-model-jpa");
private static final ModuleIdentifier JAXRS = ModuleIdentifier.create("javax.ws.rs.api");
private static final ModuleIdentifier RESTEASY = ModuleIdentifier.create("org.jboss.resteasy.resteasy-jaxrs");
@ -66,6 +67,7 @@ public class KeycloakProviderDependencyProcessor implements DeploymentUnitProces
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_SERVER_SPI, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_SERVER_SPI_PRIVATE, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAXRS, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, RESTEASY, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, APACHE, false, false, false, false));

View file

@ -48,7 +48,7 @@ public class KeycloakProviderDeploymentProcessor implements DeploymentUnitProces
if (!KeycloakProviderDependencyProcessor.isKeycloakProviderDeployment(deploymentUnit)) return;
logger.infof("Deploying Keycloak provider: {0}", deploymentUnit.getName());
logger.infov("Deploying Keycloak provider: {0}", deploymentUnit.getName());
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
ProviderManager pm = new ProviderManager(module.getClassLoader());
ProviderManagerRegistry.SINGLETON.deploy(pm);
@ -66,7 +66,7 @@ public class KeycloakProviderDeploymentProcessor implements DeploymentUnitProces
public void undeploy(DeploymentUnit context) {
ProviderManager pm = context.getAttachment(ATTACHMENT_KEY);
if (pm != null) {
logger.infof("Undeploying Keycloak provider: {0}", context.getName());
logger.infov("Undeploying Keycloak provider: {0}", context.getName());
ProviderManagerRegistry.SINGLETON.undeploy(pm);
context.removeAttachment(ATTACHMENT_KEY);
}