From e0e6d30a905e47931a89b7e9063d752a6f28106d Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 05 Feb 2014 22:45:49 +0000
Subject: [PATCH] OPENDJ-1235: Migrate configuration framework
---
opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java b/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
index f5f1284..9f51ee9 100644
--- a/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
+++ b/opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
@@ -43,9 +43,8 @@
* <p>
* Note that in a client/server environment, the client is probably not capable
* of validating the Java class (e.g. it will not be able to load it nor have
- * access to the interfaces it is supposed to implement). For this reason, it is
- * possible to switch off validation in the client by using the appropriate
- * {@link PropertyDefinitionsOptions}.
+ * access to the interfaces it is supposed to implement). For this reason,
+ * validation is disabled in client applications.
*/
public final class ClassPropertyDefinition extends PropertyDefinition<String> {
@@ -117,7 +116,7 @@
// Load a named class.
private static Class<?> loadClass(String className, boolean initialize) throws ClassNotFoundException {
- return Class.forName(className, initialize, ClassLoaderProvider.getInstance().getClassLoader());
+ return Class.forName(className, initialize, ConfigurationFramework.getInstance().getClassLoader());
}
// List of interfaces which property values must implement.
@@ -152,11 +151,11 @@
* {@inheritDoc}
*/
@Override
- public String decodeValue(String value, PropertyDefinitionsOptions options) {
+ public String decodeValue(String value) {
Reject.ifNull(value);
try {
- validateValue(value, options);
+ validateValue(value);
} catch (PropertyException e) {
throw PropertyException.illegalPropertyValueException(this, value, e.getCause());
}
@@ -219,7 +218,7 @@
* {@inheritDoc}
*/
@Override
- public void validateValue(String value, PropertyDefinitionsOptions options) {
+ public void validateValue(String value) {
Reject.ifNull(value);
// Always make sure the name is a valid class name.
@@ -229,7 +228,7 @@
* If additional validation is enabled then attempt to load the class
* and check the interfaces that it implements/extends.
*/
- if (options.allowClassValidation()) {
+ if (!ConfigurationFramework.getInstance().isClient()) {
validateClassInterfaces(value, false);
}
}
--
Gitblit v1.10.0