use of org.entirej.applicationframework.rwt.spring.ext.EJDefaultSpringSecurityConfigProvider in project rap by entirej.
the class EJSpringRestSecurityConfig method getProvider.
private static EJSpringSecurityConfigProvider getProvider() {
EJCoreProperties instance = EJCoreProperties.getInstance();
EJFrameworkExtensionProperties definedProperties = instance.getApplicationDefinedProperties();
if (definedProperties != null) {
EJFrameworkExtensionProperties settings = definedProperties.getPropertyGroup(SPRING_SECURITY);
if (settings != null) {
String configClass = settings.getStringProperty(SPRING_SECURITY_AUTH);
if (configClass != null && !configClass.isEmpty()) {
Class<?> factoryClass;
try {
factoryClass = Class.forName(configClass);
Object obj = factoryClass.newInstance();
if (obj instanceof EJSpringSecurityConfigProvider) {
return (EJSpringSecurityConfigProvider) obj;
} else {
System.err.println("invalid EJSpringSecurityConfigProvider switch to default");
}
} catch (ClassNotFoundException e) {
System.err.println("invalid EJSpringSecurityConfigProvider switch to default");
e.printStackTrace();
} catch (InstantiationException e) {
System.err.println("invalid EJSpringSecurityConfigProvider switch to default");
e.printStackTrace();
} catch (IllegalAccessException e) {
System.err.println("invalid EJSpringSecurityConfigProvider switch to default");
e.printStackTrace();
}
}
}
}
return new EJDefaultSpringSecurityConfigProvider();
}
Aggregations