dulvac commented on code in PR #3059:
URL: https://github.com/apache/jackrabbit-oak/pull/3059#discussion_r3711270969


##########
oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/audit/AuditEventEmitter.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.spi.audit;
+
+import org.jetbrains.annotations.NotNull;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * OSGi service for emitting audit events. Consumed via {@code @Reference}:
+ * <pre>{@code
+ * @Reference private AuditEventEmitter audit;
+ *
+ * void onSomething() {
+ *     if (audit.isEnabledFor("aem.content")) {
+ *         audit.emit(new MyEvent(...));
+ *     }
+ * }
+ * }</pre>
+ * <p>
+ * The emitter dispatches synchronously on the calling thread to all
+ * listeners registered for the event's domain. Not tied to any commit;
+ * not buffered; not rolled back on failure.
+ * <p>
+ * Listeners are invoked under per-listener try/catch isolation — covering

Review Comment:
   The guarantee is in oak. `@ProviderType` means Oak supplies the emitter, and 
the `try/catch` lives in our dispatch code, so a consumer can't opt out. I'll 
reword the javadoc as a guarantee the caller can rely on rather than a 
description of behaviour.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to