diff --git a/api-changes.json b/api-changes.json index 49a9e5173..f9f14a11b 100644 --- a/api-changes.json +++ b/api-changes.json @@ -2,6 +2,24 @@ "1.4.1": { "revapi": { "ignore": [ + { + "code": "java.field.addedStaticField", + "new": "field org.mule.runtime.api.config.MuleRuntimeFeature.REUSE_GLOBAL_ERROR_HANDLER", + "package": "org.mule.runtime.api.config", + "classSimpleName": "MuleRuntimeFeature", + "fieldName": "REUSE_GLOBAL_ERROR_HANDLER", + "elementKind": "enumConstant", + "justification": "W-10888504: adding feature flag to reuse global error handlers." + }, + { + "code": "java.field.addedStaticField", + "new": "field org.mule.runtime.api.util.MuleSystemProperties.REUSE_GLOBAL_ERROR_HANDLER_PROPERTY", + "package": "org.mule.runtime.api.util", + "classSimpleName": "MuleSystemProperties", + "fieldName": "REUSE_GLOBAL_ERROR_HANDLER_PROPERTY", + "elementKind": "field", + "justification": "W-10888504: adding system property to reuse global error handlers." + }, { "code": "java.field.addedStaticField", "new": "field org.mule.runtime.api.util.MuleSystemProperties.REVERT_SIGLETON_ERROR_HANDLER_PROPERTY", diff --git a/src/main/java/org/mule/runtime/api/config/MuleRuntimeFeature.java b/src/main/java/org/mule/runtime/api/config/MuleRuntimeFeature.java index 8cff93447..b2cc8b705 100644 --- a/src/main/java/org/mule/runtime/api/config/MuleRuntimeFeature.java +++ b/src/main/java/org/mule/runtime/api/config/MuleRuntimeFeature.java @@ -18,6 +18,7 @@ import static org.mule.runtime.api.util.MuleSystemProperties.HANDLE_SPLITTER_EXCEPTION_PROPERTY; import static org.mule.runtime.api.util.MuleSystemProperties.HONOUR_RESERVED_PROPERTIES_PROPERTY; import static org.mule.runtime.api.util.MuleSystemProperties.PARALLEL_FOREACH_FLATTEN_MESSAGE_PROPERTY; +import static org.mule.runtime.api.util.MuleSystemProperties.REUSE_GLOBAL_ERROR_HANDLER_PROPERTY; import static org.mule.runtime.api.util.MuleSystemProperties.SET_VARIABLE_WITH_NULL_VALUE_PROPERTY; import static org.mule.runtime.api.util.MuleSystemProperties.START_EXTENSION_COMPONENTS_WITH_ARTIFACT_CLASSLOADER_PROPERTY; import static org.mule.runtime.api.util.MuleSystemProperties.TO_STRING_TRANSFORMER_TRANSFORM_ITERATOR_ELEMENTS_PROPERTY; @@ -219,6 +220,14 @@ public enum MuleRuntimeFeature implements Feature { ENABLE_BYTE_BUDDY_OBJECT_CREATION( "When enabled, the Objects factories will be created with Byte Buddy instead of CGLIB.", "W-10672687", "4.5.0", ENABLE_BYTE_BUDDY_OBJECT_CREATION_PROPERTY), + /** + * When enabled, the global error handlers will be reused instead of creating local copies. + * + * @since 4.5.0 + */ + REUSE_GLOBAL_ERROR_HANDLER( + "When enabled, the global error handlers will be reused instead of creating local copies.", + "W-10888504", "4.5.0", REUSE_GLOBAL_ERROR_HANDLER_PROPERTY), ; private final String description; diff --git a/src/main/java/org/mule/runtime/api/util/MuleSystemProperties.java b/src/main/java/org/mule/runtime/api/util/MuleSystemProperties.java index 11c3cd14a..04c826539 100644 --- a/src/main/java/org/mule/runtime/api/util/MuleSystemProperties.java +++ b/src/main/java/org/mule/runtime/api/util/MuleSystemProperties.java @@ -471,6 +471,14 @@ public final class MuleSystemProperties { public static final String REVERT_SIGLETON_ERROR_HANDLER_PROPERTY = SYSTEM_PROPERTY_PREFIX + "revert.singletonErrorHandler"; + /** + * If set to true, the global error handlers will be reused instead of creating local copies. + * + * @since 4.5.0, 4.4.1, 4.3.1 + */ + public static final String REUSE_GLOBAL_ERROR_HANDLER_PROPERTY = + SYSTEM_PROPERTY_PREFIX + "reuse.globalErrorHandler"; + /** * @return {@code true} if the {@link #TESTING_MODE_PROPERTY_NAME} property has been set (regardless of the value) */