resolve https://issues.apache.org/activemq/browse/AMQ-2350 - amq may not have exclusive access to the propertyEditorManager

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@801989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-08-07 13:16:56 +00:00
parent 1a6279e170
commit 6b283abdd0
1 changed files with 12 additions and 10 deletions

View File

@ -42,16 +42,18 @@ public final class IntrospectionSupport {
String[] additionalPath = new String[] {
"org.springframework.beans.propertyeditors",
"org.apache.activemq.util" };
String[] searchPath = (String[]) Array.newInstance(String.class,
PropertyEditorManager.getEditorSearchPath().length
+ additionalPath.length);
System.arraycopy(PropertyEditorManager.getEditorSearchPath(), 0,
searchPath, 0,
PropertyEditorManager.getEditorSearchPath().length);
System.arraycopy(additionalPath, 0, searchPath, PropertyEditorManager
.getEditorSearchPath().length, additionalPath.length);
PropertyEditorManager.setEditorSearchPath(searchPath);
synchronized (PropertyEditorManager.class) {
String[] existingSearchPath = PropertyEditorManager.getEditorSearchPath();
String[] newSearchPath = (String[]) Array.newInstance(String.class,
existingSearchPath.length + additionalPath.length);
System.arraycopy(existingSearchPath, 0,
newSearchPath, 0,
existingSearchPath.length);
System.arraycopy(additionalPath, 0,
newSearchPath, existingSearchPath.length,
additionalPath.length);
PropertyEditorManager.setEditorSearchPath(newSearchPath);
}
}
private IntrospectionSupport() {