mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-7119 Fix startup with ACS 5.2.7.
This commit is contained in:
@@ -35,6 +35,8 @@ import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.PropertyValue;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
@@ -51,7 +53,7 @@ import org.springframework.beans.factory.config.TypedStringValue;
|
||||
*/
|
||||
public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(RMMethodSecurityPostProcessor.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(RMMethodSecurityPostProcessor.class);
|
||||
|
||||
public static final String PROP_OBJECT_DEFINITION_SOURCE = "objectDefinitionSource";
|
||||
public static final String PROPERTY_PREFIX = "rm.methodsecurity.";
|
||||
@@ -94,10 +96,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
{
|
||||
if (beanFactory.containsBeanDefinition(bean))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Adding RM method security definitions for " + bean);
|
||||
}
|
||||
LOGGER.debug("Adding RM method security definitions for {}", bean);
|
||||
|
||||
BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
|
||||
PropertyValue beanValue = beanDef.getPropertyValues().getPropertyValue(PROP_OBJECT_DEFINITION_SOURCE);
|
||||
@@ -134,10 +133,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
String securityBeanName = split[index] + SECURITY_BEAN_POSTFIX;
|
||||
if (!securityBeanNameCache.contains(securityBeanName) && beanFactory.containsBean(securityBeanName))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Adding " + securityBeanName + " to list from properties.");
|
||||
}
|
||||
LOGGER.debug("Adding {} to list from properties.", securityBeanName);
|
||||
|
||||
securityBeanNameCache.add(securityBeanName);
|
||||
}
|
||||
@@ -166,10 +162,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("Missing RM security definition for method " + key);
|
||||
}
|
||||
LOGGER.warn("Missing RM security definition for method {}", key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,13 +173,22 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
* @param stringValue
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> convertToMap(String stringValue)
|
||||
protected Map<String, String> convertToMap(String stringValue)
|
||||
{
|
||||
String[] values = stringValue.trim().split("\n");
|
||||
Map<String, String> map = new HashMap<String, String>(values.length);
|
||||
for (String value : values)
|
||||
{
|
||||
String[] pair = value.trim().split("=");
|
||||
String trimmed = value.trim();
|
||||
if (trimmed.equals(""))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
String[] pair = trimmed.split("=", 2);
|
||||
if (pair.length != 2)
|
||||
{
|
||||
LOGGER.error("Error converting string to map: {}", trimmed);
|
||||
}
|
||||
map.put(pair[0], pair[1]);
|
||||
}
|
||||
return map;
|
||||
|
Reference in New Issue
Block a user